Skip to main content

Schema generation

Depot platform tools have the capability to generate Basestar schemas from existing snowflake databases.

To run the tool, run Depot platform tools jar with argument describe-database and provide connection details as parameters. Objects schemas will be generated for tables and view schemas will be generated for views.

info

The JAR file can be downloaded from from s3 by adding the latest version to this link https://stage-ws-repo-public.s3.eu-west-1.amazonaws.com/deploy/stage-depot-platform/depot-tools/depot-tools-{version}.jar

Example:

java -jar depot-tools-20210819.155741.c780ebd.jar describe-database --databaseType=SNOWFLAKE --address=ab12345.eu-west-1 --username=${snowlakeuser} --password=${snowflakepass} --database=DEV_TEST

where:

  • depot-tools-20210813.155741.c780ebd.jar is the jar name
  • describe-database is the tooling command name to call
  • --databaseType should be equal to SNOWFLAKE
  • --address should be account number and region e.g. ab12345.eu-west-1
  • --username --password is user connection details. If 2 factor authentification is enabled on the account, it will require you to confirm each time you execute the command.
  • --database is the database name which needs to be exported

Optional parameters:

  • --fileLocation file name to which schema will be written e.g. dev-test.yaml, if not provided result is printed to console
  • --filter takes regex and filters which tables need to be described. it takes regex i.e. "^(POC_EXAMPLE_ITEM.MODEL).*$". naming pattern is databaseName.schemaName.tableName