Connection options
Use connection options to tell dbvr which datasource a command should use.
Ways to connect¶
Connect to a database in one of these ways:
- use an existing datasource with
-dsor--datasource - provide a full connection specification with
-con,-ds-spec,-connect, or-datasource-specification - define a connection inline with
--driverand connection parameters
Include credentials, network handlers, and driver-specific parameters if required.
--datasource¶
Use an existing datasource by ID or name.
Use datasource list to see available datasources.
--datasource-specification¶
Provide a full datasource specification string. The specification is a list of key=value pairs separated by |.
Example
--driver¶
Define a connection inline instead of using an existing datasource. Use driver list to see available
driver IDs.
Combine with the connection parameters below and authentication options to fully specify the connection.
Example
--host¶
Set the database host name or IP address.
Info
Ignored if --url is specified.
--port¶
Set the database port number. Must be a valid integer.
Info
Ignored if --url is specified.
--database¶
Set the database name. For some drivers, this may represent a schema, service name, or logical database.
Info
Ignored if --url is specified.
--server¶
Set the logical server name required by certain drivers.
Info
Ignored if --url is specified.
--url¶
Provide the full JDBC connection URL.
Note
When specified, it overrides --host, --port, --database, and --server.
--auth-model¶
Specify the authentication model supported by the selected driver.
Authentication models define how credentials are provided - for example, username/password, Kerberos, IAM, OAuth, or key-based authentication.
Tip
Run auth-models to see all available authentication models and their parameters. Not every model is
supported by every driver. Use only the models applicable to your selected driver.
--save-password¶
Control whether the database password is stored in the workspace configuration. Accepts a boolean value.
--folder¶
Place the datasource into a folder within the project.
--name¶
Set the name of the datasource as it appears in the workspace.
Authentication options¶
--user¶
Set the database username used for authentication.
--password¶
Set the database password.
--auth-property¶
Add a driver-specific authentication parameter in key=value format. May be specified multiple times.
Example
Network options¶
--network-handler-param¶
Configure a network handler parameter in key=value format. Used for SSH tunnels, proxies, or other network
configurations. May be specified multiple times.
Parameter names must match the properties defined by the selected network handler. Use
network-handlers to see available handler IDs and supported parameters.
Example
dbvr sql \
--driver=postgres-jdbc \
--host=localhost \
--port=5432 \
--database=testdb \
-u=admin \
-p=password \
-net=ssh.host=example.com \
-net=ssh.port=22 \
-net=ssh.user=app \
-net=ssh.authType=PASSWORD \
-net=ssh.password=secret \
"select * from public.orders limit 10;"
dbvr datasource create \
--driver=postgres-jdbc \
--name="PostgreSQL via SSH" \
--host=remote-db \
--database=testdb \
--user=app \
--password=secret \
-net=ssh.host=example.com \
-net=ssh.port=22 \
-net=ssh.user=sshuser \
-net=ssh.authType=password \
-net=ssh.password=sshpass
Each -net defines one property of the network handler configuration.
Tip
Network handler configuration in dbvr follows the same model as in DBeaver. For SSH tunnel setup details, see SSH configuration.
--network-handler-save-password¶
Control whether passwords defined in network handlers - such as SSH tunnels or proxy configurations - are stored in the
workspace configuration. Accepts a boolean value. Default: true.
--network-handler-delete¶
Remove one or more configured network handlers from the datasource.
Example
This removes the configured SSH network handler from the datasource.
Driver-specific parameters¶
--property¶
Add a driver connection property in key=value format. Passed directly to the JDBC driver for this connection. May be
specified multiple times.
Use it to override or set driver-specific settings for the current datasource instead of relying on global driver defaults.
Example
--extended-property¶
Add a driver-specific parameter in key=value format. May be specified multiple times.
Used for additional driver properties that are not part of the authentication model. These parameters may affect authentication or other driver-specific behavior.