Skip to content

datasource update

Synopsis

dbvr datasource update [-hV] [--auth-model=<authModel>]
                             [--database=<dbName>]
                             [--folder=<folder>]
                             [--host=<host>]
                             [--name=<dataSourceName>]
                             [-p=<dbPassword> | --password=<dbPassword>]
                             [--port=<port>]
                             [--project=<projectIdOrName>]
                             [--save-password=<savePassword>]
                             [--server=<server>]
                             [-u=<dbUser> | --user=<dbUser>]
                             [--url=<url>]
                             [-auth=<authParams> | --auth-property=<authParams>]...
                             [-ext=<providerParams> | --extended-property=<providerParams>]...
                             [-prop=<connectionParams> | --property=<connectionParams>]...
                             [-net-delete=<handlersToDelete> | --network-handler-delete=<handlersToDelete>]...
                             [[-net=<handlerParams> | --network-handler-param=<handlerParams>]...
                              [-net-save-pwd=<savePassword> | --network-handler-save-password=<savePassword>]]
                             <datasourceIdOrName>

Tip

You can also use global options with this command.

Description

Update an existing datasource.

Use this command to change connection settings, authentication details, network handlers, project placement, or the datasource name.

Info

Only the parameters you specify are modified. All other configuration values remain unchanged.

The command doesn’t validate connectivity by default. If you change connection properties such as --host, --port, --database, or --url, test the connection separately using sql.

Tip

Run datasource view <id> before and after the update to verify what changed.

Required argument

<datasourceIdOrName>

Specify the datasource ID or name. The value must match an existing datasource in the active workspace.

Tip

Run datasource list to see available datasources. You can use either the value from the ID column or the NAME column.

Options

--password

-p, --password=<dbPassword>

Set the database password.

--project

--project=<projectIdOrName>

Store the datasource in the specified project.

Tip

Run project list to see available projects.

--user

-u, --user=<dbUser>

Set the database username used for authentication.

--auth-property

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

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

Example

dbvr datasource update <datasourceIdOrName> \
  --auth-model=ssl \
  -auth=ssl=true \
  -auth=sslmode=require

--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 datasource update <datasourceIdOrName> \
  --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 (Snowflake warehouse)

dbvr datasource update <datasourceIdOrName> \
  --extended-property=warehouse=COMPUTE_WH

--host

--host=<host>

Set the database host name or IP address.

Info

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.

Info

Ignored if --url is specified.

--server

--server=<server>

Set the logical server name required by certain drivers.

Info

Ignored if --url is specified.

--url

--url=<url>

Provide the full JDBC connection URL.

Note

If you use this option, dbvr ignores --host, --port, --database, and --server for this datasource configuration

--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.

--port

--port=<port>

Set the database port number. Must be a valid integer. Ignored if --url is specified.

--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.

--save-password

--save-password=<savePassword>

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

--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 dbvr network-handlers to see available handler IDs and supported parameters.

Example

dbvr datasource update <datasourceIdOrName> \
  -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.

--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.