zod-dbs-snowflake
v1.0.2
Published
Snowflake provider for zod-dbs
Maintainers
Readme
zod-dbs-snowflake
Snowflake provider for zod-dbs.
Notes
- Requires
snowflake-sdkas a peer dependency. - You must provide both
databaseandschemaName. - Enum types are not yet supported.
Installation
npm install zod-dbs-snowflakeNote: This package has a peer dependency on
snowflake-sdk. If you don't already have it, you might need to install it (depending on your environment, package manager, etc):
npm install snowflake-sdkCLI Usage
npx zod-dbs --provider snowflake \
--host <account>.snowflakecomputing.com \
--user <user> --password <password> \
--account <account> --token <token> \
--warehouse <warehouse> --role <role> \ # optional
--database <db> --schema-name <schema>Provider Specific CLI Options
| Option | Description | Required |
| ------------------------ | ----------------------------------------------------------------- | -------- |
| --host <host> | Snowflake account URL host (e.g., xy12345.snowflakecomputing.com) | |
| --account <account> | Snowflake account identifier (required) | true |
| --user <user> | Username for authentication | |
| --password <password> | Password for authentication | |
| --database <db> | Database name to connect to (required) | true |
| --schema-name <schema> | Schema name to introspect (required) | true |
| --token <token> | JWT token for authentication | |
| --role <role> | Role to assume after connecting | |
| --warehouse <name> | Virtual warehouse to use | |
Configuration File Example
import { ZodDbsCliConfig } from 'zod-dbs-cli';
// Import needed to load the provider specific configuration types.
import 'zod-dbs-snowflake';
const config: ZodDbsCliConfig = {
provider: createProvider(),
account: '<account>',
token: '<token>',
warehouse: '<warehouse>', // optional
role: '<role>', // optional
};
export default config;Programmatic Usage
import { generateZodSchemas } from 'zod-dbs';
import { createProvider } from 'zod-dbs-snowflake';
await generateZodSchemas({
provider: createProvider(),
config: {
account: '<account>',
host: '<account>.snowflakecomputing.com',
user: '<user>',
password: '<password>',
token: '<token>',
database: '<db>',
schemaName: '<schema>',
// optionally: warehouse, role
},
});