Snowflake provider for zod-dbs
npm install zod-dbs-snowflakeSnowflake provider for zod-dbs.
- Requires snowflake-sdk as a peer dependency.
- You must provide both database and schemaName.
- Enum types are not yet supported.
``bash`
npm install zod-dbs-snowflake
> Note: 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):
`bash`
npm install snowflake-sdk
`bash`
npx zod-dbs --provider snowflake \
--host
--user
--account
--warehouse
--database
| Option | Description | Required |
| ------------------------ | ----------------------------------------------------------------- | -------- |
| --host | Snowflake account URL host (e.g., xy12345.snowflakecomputing.com) | |--account
| | Snowflake account identifier (required) | true |--user
| | Username for authentication | |--password
| | Password for authentication | |--database
| | Database name to connect to (required) | true |--schema-name
| | Schema name to introspect (required) | true |--token
| | JWT token for authentication | |--role
| | Role to assume after connecting | |--warehouse
| | Virtual warehouse to use | |
`ts
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: '
token: '
warehouse: '
role: '
};
export default config;
`
`ts
import { generateZodSchemas } from 'zod-dbs';
import { createProvider } from 'zod-dbs-snowflake';
await generateZodSchemas({
provider: createProvider(),
config: {
account: '
host: '
user: '
password: '
token: '
database: '
schemaName: '
// optionally: warehouse, role
},
});
``