Skip to content

Connection Options

dbeaver-devops edited this page Dec 2, 2026 · 2 revisions

Table of contents

Use connection options to tell dbvr which datasource a command should use.

Ways to connect

Connect to a database in one of these ways:

Include credentials, network handlers, and driver-specific parameters if required.

--datasource

--datasource, -ds=<existDataSourceIdOrName>

Use an existing datasource by ID or name.

Use datasource list to see available datasources.

Example:

dbvr sql \
  -ds=pg-local \
  "select current_database();"

--datasource-specification

-con, -connect, -ds-spec, --datasource-specification=<connectionSpec>

Provide a full datasource specification string. The specification is a list of key=value pairs separated by |.

Example:

Quote the connection specification so the shell passes its | separators as one argument.

dbvr sql \
  -con='driver=postgres-jdbc|host=localhost|port=5432|database=postgres' \
  "SELECT id, name FROM (VALUES (101, 'John Doe'), (102, 'Maya Chen')) AS c(id, name) WHERE name = 'John Doe';"

--driver

--driver=<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:

dbvr sql \
  --driver=postgres-jdbc \
  --host=localhost \
  --port=5432 \
  --database=postgres \
  "SELECT id, name FROM (VALUES (101, 'John Doe'), (102, 'Maya Chen')) AS c(id, name) WHERE name = 'John Doe';"

--host

--host=<host>

Set the database host name or IP address.

Ignored if --url is specified.

--port

--port=<port>

Set the database port number. Must be a valid integer.

Ignored if --url is specified.

--database

--database=<dbName>

Set the database name. For some drivers, this may represent a schema, service name, or logical database.

Ignored if --url is specified.

--server

--server=<server>

Set the logical server name required by certain drivers.

Ignored if --url is specified.

--url

--url=<url>

Provide the full JDBC connection URL.

Note: When specified, it overrides --host, --port, --database, and --server.

--auth-model

--auth-model=<authModel>

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

--save-password=<savePassword>

Control whether the database password is stored in the workspace configuration. Accepts a boolean value.

--folder

--folder=<folder>

Place the datasource into a folder within the project.

--name

--name=<dataSourceName>

Set the name of the datasource as it appears in the workspace.

Authentication options

--user

-u, --user=<dbUser>

Set the database username used for authentication.

--password

-p, --password=<dbPassword>

Set the database password.

--auth-property

-auth, --auth-property=<authParams>

Add a driver-specific authentication parameter in key=value format. May be specified multiple times.

Example:

dbvr sql \
  --driver=postgres-jdbc \
  --host=localhost \
  --database=testdb \
  --auth-model=ssl \
  -auth=ssl=true \
  -auth=sslmode=require \
  "select 1;"

Example:

dbvr datasource create \
  --driver=postgres-jdbc \
  --name="PostgreSQL SSL" \
  --host=localhost \
  --database=testdb \
  --auth-model=ssl \
  -auth=ssl=true \
  -auth=sslmode=require

Network options

--network-handler-param

-net, --network-handler-param=<handlerParams>

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:

Run a query through SSH with an encrypted private key. Create a private argument file at /absolute/path/ssh-query.args. On POSIX systems, set its permissions to 0600 before adding secrets. Replace the placeholders below and keep one argument per line:

--driver=postgres-jdbc
--host=db.example.com
--port=5432
--database=testdb
--user=db_user
--password
"<database password>"
-net=ssh.host=ssh.example.com
-net=ssh.port=22
-net=ssh.user=ssh_user
-net=ssh.authType=PUBLIC_KEY
-net=ssh.keyPath=/absolute/path/id_ed25519
-net
"ssh.password=<private key passphrase>"
-net-save-pwd=false
"SELECT 1 AS ssh_ok"

For PUBLIC_KEY, ssh.password supplies the private key passphrase. Run the query with the argument file so the database password and key passphrase aren't passed as command-line arguments:

dbvr sql @/absolute/path/ssh-query.args

The file contains plaintext secrets. Remove it after use.

Example:

Create a datasource configuration with key-based SSH authentication. This command stores the configuration; it doesn't test the connection or supply a database password or private key passphrase.

dbvr datasource create \
  --driver=postgres-jdbc \
  --name="PostgreSQL via SSH" \
  --host=db.example.com \
  --database=testdb \
  --user=db_user \
  -net=ssh.host=ssh.example.com \
  -net=ssh.port=22 \
  -net=ssh.user=ssh_user \
  -net=ssh.authType=PUBLIC_KEY \
  -net=ssh.keyPath=/absolute/path/id_ed25519 \
  -net-save-pwd=false

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

-net-save-pwd, --network-handler-save-password=<savePassword>

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

-net-delete, --network-handler-delete=<handlersToDelete>

Remove one or more configured network handlers from the datasource.

Example:

dbvr datasource update <datasourceIdOrName> \
  --network-handler-delete=ssh

This removes the configured SSH network handler from the datasource.

Driver-specific parameters

--property

-prop, --property=<connectionParams>

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:

dbvr sql \
  --driver=postgres-jdbc \
  --host=localhost \
  --database=testdb \
  -u=admin \
  -p=password \
  --property=ssl=true \
  --property=applicationName=dbvr-cli \
  "select current_user;"

Example:

dbvr datasource create \
  --driver=postgres-jdbc \
  --name="PostgreSQL local" \
  --host=localhost \
  --database=testdb \
  -u=admin \
  -p=password \
  --property=ssl=true \
  --property=applicationName=dbvr-cli

--extended-property

-ext, --extended-property=<providerParams>

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.

Example:

dbvr sql \
  --driver=snowflake-jdbc \
  --host=account.snowflakecomputing.com \
  --database=TESTDB \
  -u=app \
  -p=secret \
  --extended-property=warehouse=COMPUTE_WH \
  "select current_warehouse();"

Example:

dbvr datasource create \
  --driver=snowflake-jdbc \
  --name="Snowflake prod" \
  --host=account.snowflakecomputing.com \
  --database=TESTDB \
  -u=app \
  -p=secret \
  --extended-property=warehouse=COMPUTE_WH

Clone this wiki locally