Skip to main content

Module new

Module new 

Source
Expand description

Interactive schema builder (drizzle new)

Walks the user through an interactive wizard to define tables, columns, indexes, and foreign keys, then generates Rust schema code using the existing codegen pipeline (the same one drizzle introspect uses).

Supports JSON import/export for CI-friendly, reproducible schema generation:

  • drizzle new --json reads a JSON schema definition from stdin
  • drizzle new --json --from file.json reads from a file
  • drizzle new --export-json out.json exports the schema as JSON
  • drizzle new --schema-help prints the expected JSON shape

Structs§

ColumnDef
A column definition.
EnumDef
An enum type: name and labels.
ForeignKeyDef
A foreign-key definition.
IndexDef
An index definition.
NewOptions
SchemaDefinition
The JSON document drizzle new --json reads and --export-json writes.
TableDef
A table definition.

Enums§

AutoGenKind
Auto-generation strategy for a column value.
FieldCasing
Casing of generated Rust field names.

Functions§

run
Runs drizzle new: builds a SchemaDefinition from prompts or JSON, validates it, and writes the generated Rust schema file (--schema, else the definition’s output_path).