-
Notifications
You must be signed in to change notification settings - Fork 3
meta table ddl
meta table ddl - get the DDL statement for a table in dbvr.
dbvr meta table ddl [-hV]
[-db=<databaseName>]
[--full]
[-p=<dbPassword>]
[--project=<projectIdOrName>]
[-sn=<schemaName>]
[-tn=<tableName>]
[-u=<dbUser>]
[-auth=<authParams>]...
[-ext=<providerParams>]...
[-prop=<connectionParams>]...
[[-net=<handlerParams>]...
[-net-save-pwd=<savePassword>]]
(-ds=<existDataSourceIdOrName> |
-con=<connectionSpec> |
[--driver=<driver>
[[--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.
Get the DDL statement for a table.
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.
-db, --database-name=<databaseName>
Database (catalog) that contains the table.
-sn, --schema-name=<schemaName>
Schema that contains the table.
-tn, --table-name=<tableName>
Table to retrieve the DDL for.
--full
Include extended properties in the DDL output.
--project=<projectIdOrName>
Use a datasource from the specified project.
Tip: Run
project listto see available projects.
dbvr meta table ddl -ds=pg-local -db=testdb -sn=public -tn=orders
Sample output:
-- Drop table
-- DROP TABLE public.orders;
CREATE TABLE public.orders (
id integer NOT NULL,
customer_id integer,
created_at timestamp without time zone,
total numeric(10,2),
CONSTRAINT orders_pkey PRIMARY KEY (id)
);Get full DDL including indexes:
dbvr meta table ddl -ds=pg-local -db=testdb -sn=public -tn=orders --full
Tip: On databases with a catalog hierarchy (PostgreSQL, SQL Server, etc.), both
-dband-snare required. On Oracle, only-snis needed. On flat databases like SQLite, both can be omitted.
- Getting started
- Reference
- Commands
- Connection options
- Databases support
- Administration
- About dbvr