Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WidgetModel = model.Definition{ Name: "conformance_widget", Fields: model.Fields{ {Name: "id", Type: model.Text(), DB: &model.FieldDB{PK: true}}, {Name: "name", Type: model.Text(), NotNull: true}, {Name: "qty", Type: model.Int(), NotNull: true}, {Name: "active", Type: model.Bool(), NotNull: true}, }, }
Widget is the canonical record every backend is driven with. Its schema carries real DB metadata (types + PK) so SQL backends can CREATE TABLE it; mem ignores the metadata and stores by column name. Hand-written (conformance depends only on model, not ormc).
Functions ¶
Types ¶
type Factory ¶
Factory builds, for ONE clause, a fresh storage.Conn whose Widget table already exists and is EMPTY. Schema setup is the backend's job, done OUTSIDE this DML contract (this suite never builds a CreateTable Query):
- mem: auto-creates the table on first Create — New just returns mem.New().
- sqlite/postgres: New runs ddlc.ExportDDL(models) (or ddl.CreateTable) before returning.
- indexdb: New declares `models` as IndexedDB object stores up front.
models are the record types the suite will exercise. Called once per clause → no cross-clause bleed.
type Widget ¶
func (*Widget) DecodeFields ¶
func (w *Widget) DecodeFields(r model.FieldReader)
func (*Widget) EncodeFields ¶
func (w *Widget) EncodeFields(wr model.FieldWriter)
Click to show internal directories.
Click to hide internal directories.