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
requiredproperties marked asNOT NULL, and JSONSchemadefaultwill map to SQLite defaults.Any properties that are of type
objectorarrayin the JSONSchema will be mapped to a text field, which drizzle will parse and stringify. Types forobjectandarrayproperties will be derived fromTObjectType.