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.jaris the jar namedescribe-databaseis the tooling command name to call--databaseTypeshould be equal toSNOWFLAKE--addressshould be account number and region e.g.ab12345.eu-west-1--username --passwordis user connection details. If 2 factor authentification is enabled on the account, it will require you to confirm each time you execute the command.--databaseis the database name which needs to be exported
Optional parameters:
--fileLocationfile name to which schema will be written e.g.dev-test.yaml, if not provided result is printed to console--filtertakes regex and filters which tables need to be described. it takes regex i.e."^(POC_EXAMPLE_ITEM.MODEL).*$". naming pattern isdatabaseName.schemaName.tableName