github.com/dal-go/record
defines the small, persistence-neutral vocabulary for identifying records,
carrying record data, and describing changes to records.
It exists so API, rendering, command, and facade layers can depend on a stable
record model without importing database sessions, queries, transactions, or an
adapter. Database access belongs to
DALgo: DALgo accepts these values at its
boundary and executes a record.Changes
envelope through dal.ApplyChanges.
The module contains two packages:
recordfor identity, data, envelopes, and change batches.record/updatefor declarative field-update commands.
Every exported type and function is listed below. Links lead to its API documentation.
- Variables:
ErrNoError,ErrRecordNotFound. - Function:
IsNotFound.
- Types:
Key,KeyOption, andFieldVal. - Key constructors:
NewKeyWithID,NewKeyWithParentAndID,NewIncompleteKey,NewKeyWithFields, andNewKeyWithOptions. - Key options:
WithKeyID,WithStringID,WithIntID,WithFields, andWithParentKey. - Key helpers:
EscapeIDandEqualKeys. - Methods:
Key.String,Key.CollectionPath,Key.Level,Key.Parent,Key.Collection,Key.Validate,Key.Equal, andFieldVal.Validate.
- Types:
Record,WithID, andDataWithID. - Constructors:
NewRecord,NewRecordWithData,NewRecordWithIncompleteKey,NewRecordWithoutKey,NewWithID, andNewDataWithID. - Helper:
AnyRecordWithError. - Method:
WithID.String.
- Types:
UpdatesandChanges. Changesmethods:RecordsToInsert,QueueForInsert, andReset.- Mapping functions:
DataToMapandMapToData.
- Types:
FieldPathandUpdate. - Functions:
ByFieldName,ByFieldPath,DeleteByFieldName, andDeleteByFieldPath. - Values:
DeleteFieldandServerTimestamp.