Type Alias JsonSchemaToDrizzleSqliteTable<TObjectType, TSchema, TTableName, TColumnsMap, TPrimaryKey>
Type Parameters
- TObjectType extends {
[K in keyof TSchema["properties"]]?: any
} - TSchema extends JSONSchema7Object
- TTableName extends string
- TColumnsMap extends Record<string, ColumnBuilderBase> = {}
- TPrimaryKey extends keyof TSchema["properties"] | undefined = undefined
Create a Drizzle SQLite table definition from a JSONSchema object. All top-level properties map to SQLite columns, with
required
properties marked asNOT NULL
, and JSONSchemadefault
will map to SQLite defaults.Any properties that are of type
object
orarray
in the JSONSchema will be mapped to a text field, which drizzle will parse and stringify. Types forobject
andarray
properties will be derived fromTObjectType
.