Tables
Table DDL Aides
SQLa
uses Zod to declare type-safe tables and generate SQL DDL that can be
used directly in template literals.
Type-safe declarations
Assuming ctx
and stsOptions
are setup as in the examples above, you can
import z
from Zod, prepare a table definition and then use it:
syntheticTable1Defn
is a custom-prepared (not type-safe) but typeSafeTable1
is type-safe because it’s defined using a Zod schema.