Type Alias JsonSchemaToDrizzleColumns<TObjectType, TSchema, TPrimaryKey>
Type Parameters
- TObjectType extends {
[K in keyof TSchema["properties"]]?: any
} - TSchema extends JSONSchema7Object
- TPrimaryKey extends keyof TSchema["properties"] | undefined = undefined
Convert a JSONSchema Object Schema to a Drizzle Columns map (e.g. parameter for
sqliteTable()). All top-level properties map to SQLite columns, withrequiredproperties 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.