-
Notifications
You must be signed in to change notification settings - Fork 1
datasource create
dbvr datasource create [-hV] --driver=<driver>
[-p=<dbPassword>] [--project=<projectIdOrName>]
[-secret=<secretName>] [-sm=<secretManagerId>]
[-u=<dbUser>]
[-auth=<authParams> | --auth-property=<authParams>]...
[-ext=<providerParams> | --extended-property=<providerParams>]...
[-prop=<connectionParams> | --property=<connectionParams>]...
[[-net=<handlerParams> | --network-handler-param=<handlerParams>]...
[-net-save-pwd=<savePassword> | --network-handler-save-password=<savePassword>]]
[[--auth-model=<authModel>]
[--folder=<folder>]
[--name=<dataSourceName>]
[--save-password=<savePassword>]
[--url=<url> |
[[--host=<host>]
[--database=<dbName>]
[--server=<server>]
[--port=<port>]]]]
Tip: You can also use global options with this command.
Tip: You can create a connection in the DBeaver UI and then use it in dbvr. Both tools use the same workspace format. For step-by-step instructions, see Create connection.
Create a new datasource.
The datasource definition is written to the active workspace configuration, making it available for other dbvr commands
such as sql, datasource list, or datasource update.
--driver=<driver>
Important: The
--drivervalue must match a registered driver. Usedriver listto see available Driver IDs.
Use connection settings to specify which database this command runs against.
Connect 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 properties if required.
For details on all connection settings, see Connection options.
--project=<projectIdOrName>
Store the datasource in the specified project. If not set, the datasource is created in the General project.
Tip: Run
project listto see available projects.
Create a basic PostgreSQL datasource:
dbvr datasource create \
--driver=postgres-jdbc \
--name=pg-local \
--host=localhost \
--port=5432 \
--database=testdb \
--user=app \
--password=secret
Create a datasource in a specific project and folder:
dbvr datasource create \
--driver=postgres-jdbc \
--name=pg-prod \
--project=Prod \
--folder=Finance \
--host=prod-db \
--database=maindb \
--user=app \
--password=secret
Create a datasource using a full JDBC URL:
dbvr datasource create \
--driver=postgres-jdbc \
--name=pg-url \
--url=jdbc:postgresql://localhost:5432/testdb \
--user=app \
--password=secret
Create a datasource with an SSH tunnel:
dbvr datasource create \
--driver=postgres-jdbc \
--name=pg-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
- Getting started
- Reference
- Commands
- Connection options
- Databases support
- Administration
- About dbvr