@dataira/tunnel
v0.1.3
Published
Dataira tunnel connector for local databases
Maintainers
Readme
@dataira/tunnel
Outbound-only tunnel connector for Dataira.
Dataira lets teams connect to their operational data and ask questions in natural language. The tunnel connector is for databases that are not reachable from Dataira's cloud directly, such as databases on your laptop, private network, or VPC.
The connector opens an outbound WebSocket connection to Dataira, then forwards read-only schema and query requests to your local database. You do not need to open inbound ports.
Usage
Create a tunnel datasource in Dataira, copy the generated command, and run it on the machine that can reach your database:
npx @dataira/tunnel \
--datasource <datasource-id> \
--forward postgresql://user:pass@localhost:5432/dbname \
--api-key <one-time-tunnel-key>You can also install it globally:
npm i -g @dataira/tunnel
dataira-tunnel --datasource <datasource-id> --forward <database-url> --api-key <key>Supported Databases
- PostgreSQL:
postgresql://user:pass@localhost:5432/dbname - MySQL:
mysql://user:pass@localhost:3306/dbname - ClickHouse:
http://user:pass@localhost:8123/<database>
Options
--datasource <id> Datasource ID from Dataira
--forward <url> Local database URL
--worker-url <url> Dataira gateway WebSocket URL (optional; defaults to production)
--api-key <key> Tunnel setup key
--log-level <level> quiet, normal, or debug
--quiet Alias for --log-level quiet
--debug Alias for --log-level debug
--interactive Human-friendly output mode
--non-interactive Timestamped log output modeLearn more at dataira.ai.
