store

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package store is the typed data access of a model: CRUD with optimistic locking and soft delete, filtered and paged lists, aggregates, and an owner scope that fences every query to the caller's rows.

posts := store.New[Post](d)
p, err := posts.Get(ctx, store.RID(id))          // 404 when missing or not yours
page, err := posts.List(ctx, where.Eq("status", "draft"), where.Page(1, 20))
err = posts.Update(ctx, store.RID(id), store.Patch(req).Onto(p))

Fields

A field is named by its public name: its JSON name, or its column when the model's JSON has no name for it (json:"-", or a field inside a named struct). id is the RID; the numeric key has no name (store.ID, PluckIDs, ListByIDs).

The store tags say what a client may touch: store:"query" is what a URL filters and orders on (ListFromQuery and chok.List, QueryFields, the OpenAPI filters), store:"update" what Patch writes from a request. id, created_at and updated_at are always queryable. A model with no store tag at all is refused by New: the whitelist is never implicit.

The code is not fenced by the tags: where options, store.Where, aggregates, Pluck, ListIn, Upsert's conflict fields and Set take every column of the model, the managed ones too (Set and Patch never write those). A field name that the code got from a client must be checked against QueryFields first; an unknown name in code is a programming error, a 500 that still matches where.ErrUnknownField. Alias maps a field to another column.

Owner scope

A model embedding db.OwnedModel or db.OwnedSoftDeleteModel is fenced to chok.PrincipalFrom(ctx): reads see only the principal's rows (none without a principal), writes stamp and check the owner, and a write without a principal fails with NoPrincipalError. Principals holding one of the policy's admin roles see every row.

Errors

Every error a handler should answer with implements chok.Coder: NotFoundError (404), VersionConflictError and DuplicateError (409), EmptyChangesError (400), NoPrincipalError (401). Return them as they are.

Example
package main

import (
	"context"
	"errors"
	"fmt"
	"os"
	"path/filepath"

	"github.com/zynthara/chok"
	"github.com/zynthara/chok/db"
	"github.com/zynthara/chok/store"
	"github.com/zynthara/chok/store/where"
)

// Article is an owned model: store tags declare what the API may filter
// on and update.
type Article struct {
	db.OwnedSoftDeleteModel
	Title  string `json:"title" store:"query,update" gorm:"size:200;not null"`
	Status string `json:"status" store:"query,update" gorm:"size:20;not null"`
}

func (Article) RIDPrefix() string { return "art" }

// UpdateArticle is a PATCH body: a nil field was not sent.
type UpdateArticle struct {
	ID      string  `path:"id"`
	Version *int    `json:"version"`
	Title   *string `json:"title"`
	Status  *string `json:"status"`
}

func openExample() (*db.DB, func()) {
	dir, _ := os.MkdirTemp("", "chok-store-example")
	d := db.MustOpen(db.Config{Driver: "sqlite", SQLite: db.SQLiteConfig{Path: filepath.Join(dir, "app.db")}},
		db.Tables(db.Table(&Article{}, db.SoftUnique("uk_article_title_owner", "title", "owner_id"))))
	return d, func() { _ = d.Close(context.Background()); _ = os.RemoveAll(dir) }
}

func main() {
	d, done := openExample()
	defer done()
	articles := store.New[Article](d)
	alice := chok.WithPrincipal(context.Background(), chok.Principal{UserID: "alice"})

	a := &Article{Title: "Hello", Status: "draft"}
	if err := articles.Create(alice, a); err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(a.OwnerID, a.Version)

	// A partial update locked on the version the client saw.
	title := "Hello, store"
	req := &UpdateArticle{ID: a.RID, Version: new(1), Title: &title}
	if err := articles.Update(alice, store.RID(req.ID), store.Patch(req).Onto(a)); err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(a.Title, a.Version)

	// Replaying the stale version is a 409.
	err := articles.Update(alice, store.RID(req.ID), store.Patch(req).Onto(a))
	fmt.Println(errors.Is(err, chok.ErrConflict))

	// Bob's queries never see alice's rows.
	bob := chok.WithPrincipal(context.Background(), chok.Principal{UserID: "bob"})
	_, err = articles.Get(bob, store.RID(a.RID))
	fmt.Println(errors.Is(err, chok.ErrNotFound))

	page, _ := articles.List(alice, where.Eq("status", "draft"), where.Order("created_at", true), where.Count())
	fmt.Println(page.Total, page.Items[0].Title)
}
Output:
alice 1
Hello, store 2
true
true
1 Hello, store

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggValue added in v0.2.0

type AggValue struct {
	// contains filtered or unexported fields
}

AggValue is one aggregate of a Group. Its kind follows from the Aggregate: counts and integer sum, min and max are Int64, avg and float columns Float64, min and max of a time column Time. A group whose values were all NULL is IsNull. It encodes to JSON as a number, a time or null.

func (AggValue) Float64 added in v0.2.0

func (v AggValue) Float64() (float64, bool)

Float64 returns a numeric aggregate, converting an integer one.

func (AggValue) Int64 added in v0.2.0

func (v AggValue) Int64() (int64, bool)

Int64 returns an integer aggregate; false for other kinds, which an int64 would truncate.

func (AggValue) IsNull added in v0.2.0

func (v AggValue) IsNull() bool

IsNull reports whether the aggregate saw no value.

func (AggValue) MarshalJSON added in v0.2.0

func (v AggValue) MarshalJSON() ([]byte, error)

MarshalJSON encodes the value as a number, an RFC 3339 time or null.

func (AggValue) Time added in v0.2.0

func (v AggValue) Time() (time.Time, bool)

Time returns a time aggregate.

type Aggregate added in v0.2.0

type Aggregate struct {
	Func  string
	Field string
}

Aggregate is one value GroupBy computes per group. Func is count (the group's rows; no Field), count_distinct, sum, avg, min or max of Field.

type Changes

type Changes struct {
	// contains filtered or unexported fields
}

Changes is the set of columns an Update writes: from Patch(...).Onto, or from Set.

func Set

func Set(kv map[string]any) *Changes

Set writes the given fields by public name: any column of the model but the managed ones (id, version, the timestamps, the owner, the soft-delete columns). It locks on no version unless the Update adds where.Version. It is the code's own write; a request DTO goes through Patch, which writes only store:"update" fields.

func (*Changes) IsEmpty added in v0.2.0

func (c *Changes) IsEmpty() bool

IsEmpty reports whether the changes write nothing: a patch whose request set no field, or an empty Set.

type DuplicateError

type DuplicateError struct {
	Field      string
	Constraint string
	// contains filtered or unexported fields
}

DuplicateError is a write that a unique constraint refused. Field is the field the constraint guards, when known; Constraint its name.

func (*DuplicateError) APIError added in v0.2.0

func (e *DuplicateError) APIError() *chok.Error

APIError is the 409, with metadata.field.

func (*DuplicateError) Error added in v0.2.0

func (e *DuplicateError) Error() string

func (*DuplicateError) Is added in v0.2.0

func (e *DuplicateError) Is(target error) bool

Is matches chok.ErrConflict.

func (*DuplicateError) Unwrap added in v0.2.0

func (e *DuplicateError) Unwrap() error

type EmptyChangesError added in v0.2.0

type EmptyChangesError struct{}

EmptyChangesError is an update that changes nothing.

func (*EmptyChangesError) APIError added in v0.2.0

func (e *EmptyChangesError) APIError() *chok.Error

APIError is the 400.

func (*EmptyChangesError) Error added in v0.2.0

func (e *EmptyChangesError) Error() string

func (*EmptyChangesError) Is added in v0.2.0

func (e *EmptyChangesError) Is(target error) bool

Is matches chok.ErrBadRequest.

type Group added in v0.2.0

type Group[K comparable] struct {
	Key    K          `json:"key"`
	Values []AggValue `json:"values"`
}

Group is one bucket of GroupBy: the key and the aggregates, in the order they were asked for.

type HookSet added in v0.2.0

type HookSet[T any] struct {
	BeforeCreate func(ctx context.Context, obj *T) error
	BeforeUpdate func(ctx context.Context, loc Locator, changes map[string]any) error
	BeforeDelete func(ctx context.Context, loc Locator) error
}

HookSet holds the functions a store calls before it writes; a hook's error aborts the write. BeforeCreate may still change the object; it runs after the owner is stamped. BeforeUpdate receives a copy of the changes, field name to the value about to be written, after they passed validation. Upsert and BatchUpsert run BeforeCreate.

type Locator

type Locator interface {
	String() string
	// contains filtered or unexported methods
}

Locator picks the row, or rows, an operation targets.

func ID

func ID(id uint) Locator

ID locates by numeric primary key.

func RID

func RID(rid string) Locator

RID locates by public ID.

func Where

func Where(opts ...where.Option) Locator

Where locates by filters; at least one is required, so an update or delete never targets every row by accident (MissingConditionsError).

type MissingConditionsError added in v0.2.0

type MissingConditionsError struct{}

MissingConditionsError is store.Where with no filter: a programming error that would otherwise update or delete every row.

func (*MissingConditionsError) APIError added in v0.2.0

func (e *MissingConditionsError) APIError() *chok.Error

APIError is a 500: the request is fine, the code is not.

func (*MissingConditionsError) Error added in v0.2.0

func (e *MissingConditionsError) Error() string

type NoPrincipalError added in v0.2.0

type NoPrincipalError struct{}

NoPrincipalError is a write to an owner-scoped model without a principal in the context.

func (*NoPrincipalError) APIError added in v0.2.0

func (e *NoPrincipalError) APIError() *chok.Error

APIError is the 401.

func (*NoPrincipalError) Error added in v0.2.0

func (e *NoPrincipalError) Error() string

func (*NoPrincipalError) Is added in v0.2.0

func (e *NoPrincipalError) Is(target error) bool

Is matches chok.ErrUnauthorized.

type NotFoundError

type NotFoundError struct {
	Locator string
}

NotFoundError is a locator that matched no row the caller may see.

func (*NotFoundError) APIError added in v0.2.0

func (e *NotFoundError) APIError() *chok.Error

APIError is the 404.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

Is matches chok.ErrNotFound.

type Number added in v0.2.0

type Number interface{ int64 | float64 }

Number is what Sum reads: int64 from an integer column, or float64 from any numeric column, at float precision.

type Option added in v0.2.0

type Option func(*config)

Option configures New.

func Alias added in v0.2.0

func Alias(field, column string) Option

Alias maps a declared field to another column, for a JSON name that differs from the column gorm derives.

func Constraints added in v0.2.0

func Constraints(m map[string]string) Option

Constraints names the field a unique constraint or index guards, so a duplicate-key error says which field collided. The model's own unique indexes and those its db.Table declares, Unique and SoftUnique, are known without it.

func Hooks added in v0.2.0

func Hooks[T db.Modeler](h HookSet[T]) Option

Hooks sets the functions called before creates, updates and deletes.

func Policy added in v0.2.0

func Policy(p db.StorePolicy) Option

Policy replaces db.store, the handle's default posture, for this store. The policy is copied: changing p afterwards changes nothing.

func Scope added in v0.2.0

func Scope(fn ScopeFunc) Option

Scope adds fn to the conditions of every query, after the owner scope; it panics on a nil fn.

type PatchBuilder added in v0.2.0

type PatchBuilder struct {
	// contains filtered or unexported fields
}

PatchBuilder is a partial update read from a request: Onto turns it into Changes.

func Patch added in v0.2.0

func Patch(req any) *PatchBuilder

Patch reads a request DTO for a partial update. Its non-nil pointer fields that come from the JSON body are the changes, under their JSON names; a nil pointer is a field the client did not send. Fields bound from the path, the query or a header never take part, and neither does a field tagged store:"-". A field with the JSON name "version", an int or *int, is not a change: when set it is the version the client last saw, and the update fails with VersionConflictError if the row has moved on.

Patch panics if req is not a struct or a non-nil pointer to one.

func (*PatchBuilder) Onto added in v0.2.0

func (b *PatchBuilder) Onto(obj any) *Changes

Onto applies the patch to obj, the *T the handler loaded, and locks the update on obj's version (or on the request's version field). On success obj holds the new values and version. Onto(nil) writes without loading and locks only on the request's version field.

type Scalar added in v0.2.0

type Scalar interface{ int64 | float64 | time.Time }

Scalar is what Min and Max read: a Number, or time.Time from a timestamp column.

type ScopeFunc

type ScopeFunc func(ctx context.Context, tx *gorm.DB) (*gorm.DB, error)

ScopeFunc narrows every query of a store: it receives the query and returns it with more conditions. An error fails the operation closed.

type Store

type Store[T db.Modeler] struct {
	// contains filtered or unexported fields
}

Store is the data access of model T on a database handle.

func New

func New[T db.Modeler](d *db.DB, opts ...Option) *Store[T]

New returns the store of T on d. It panics on a declaration mistake, which surfaces at startup: a model without store tags, a store tag value other than query and update, an alias of an undeclared field, a hook for another model, a blank admin role or constraint.

func (*Store[T]) Avg added in v0.2.0

func (s *Store[T]) Avg(ctx context.Context, field string, opts ...where.Option) (float64, bool, error)

Avg returns the average of field, a numeric column, and false when there was nothing to average.

func (*Store[T]) BatchCreate

func (s *Store[T]) BatchCreate(ctx context.Context, objs []*T) error

BatchCreate inserts objs in one transaction, all or none.

func (*Store[T]) BatchUpsert added in v0.2.0

func (s *Store[T]) BatchUpsert(ctx context.Context, objs []*T, conflict ...string) error

BatchUpsert is Upsert of objs in one transaction. Two objects with the same conflict values are an error, as the database would refuse them.

func (*Store[T]) Count added in v0.2.0

func (s *Store[T]) Count(ctx context.Context, opts ...where.Option) (int64, error)

Count returns the number of rows the filters match; order and pagination options are ignored.

func (*Store[T]) CountDistinct added in v0.2.0

func (s *Store[T]) CountDistinct(ctx context.Context, field string, opts ...where.Option) (int64, error)

CountDistinct returns the number of distinct non-NULL values of field. Strings count by the column's collation, which may fold case.

func (*Store[T]) Create

func (s *Store[T]) Create(ctx context.Context, obj *T) error

Create inserts obj and fills in its RID, version and timestamps. On an owned model the principal becomes the owner. A unique violation is a DuplicateError naming the field.

func (*Store[T]) Delete

func (s *Store[T]) Delete(ctx context.Context, loc Locator, opts ...where.Option) error

Delete removes the row loc names. A soft-delete model keeps the row with deleted_at set and a random delete_token, which frees its SoftUnique values; other models lose it. Deleting what is not there is not an error, except under where.Version: then a moved row is a VersionConflictError and a missing one a NotFoundError.

func (*Store[T]) Exists

func (s *Store[T]) Exists(ctx context.Context, loc Locator) (bool, error)

Exists reports whether loc names a row the caller may see.

func (*Store[T]) Get

func (s *Store[T]) Get(ctx context.Context, loc Locator, opts ...where.Option) (*T, error)

Get returns the row loc names, or NotFoundError when there is none the caller may see. Options add filters, WithTrashed and Preload.

func (*Store[T]) GetForUpdate added in v0.2.0

func (s *Store[T]) GetForUpdate(ctx context.Context, loc Locator, opts ...where.Option) (*T, error)

GetForUpdate is Get that also locks the row until the transaction in ctx ends (SELECT ... FOR UPDATE), so no one else writes it in between; it fails outside a transaction. On SQLite the transaction already holds the only write connection, which is the stronger lock.

func (*Store[T]) GroupBy added in v0.2.0

func (s *Store[T]) GroupBy[K comparable](ctx context.Context, field string, aggs []Aggregate, opts ...where.Option) ([]Group[K], error)

GroupBy buckets the rows the filters match by field and computes aggs per bucket, ordered by key:

groups, err := orders.GroupBy[string](ctx, "status",
    []store.Aggregate{{Func: "count"}, {Func: "sum", Field: "amount"}})

K must match the field: string, int64, uint64, float64, bool or time.Time. A NULL key is an error (filter with where.NotNull). Order, pagination and Count are refused: they describe rows, not groups.

Example

Aggregates are generic methods: the type argument says how to read the result, whatever the dialect returns.

package main

import (
	"context"
	"fmt"
	"os"
	"path/filepath"

	"github.com/zynthara/chok"
	"github.com/zynthara/chok/db"
	"github.com/zynthara/chok/store"
)

// Article is an owned model: store tags declare what the API may filter
// on and update.
type Article struct {
	db.OwnedSoftDeleteModel
	Title  string `json:"title" store:"query,update" gorm:"size:200;not null"`
	Status string `json:"status" store:"query,update" gorm:"size:20;not null"`
}

func (Article) RIDPrefix() string { return "art" }

func openExample() (*db.DB, func()) {
	dir, _ := os.MkdirTemp("", "chok-store-example")
	d := db.MustOpen(db.Config{Driver: "sqlite", SQLite: db.SQLiteConfig{Path: filepath.Join(dir, "app.db")}},
		db.Tables(db.Table(&Article{}, db.SoftUnique("uk_article_title_owner", "title", "owner_id"))))
	return d, func() { _ = d.Close(context.Background()); _ = os.RemoveAll(dir) }
}

func main() {
	d, done := openExample()
	defer done()
	articles := store.New[Article](d)
	alice := chok.WithPrincipal(context.Background(), chok.Principal{UserID: "alice"})
	for _, title := range []string{"a", "b", "c"} {
		_ = articles.Create(alice, &Article{Title: title, Status: "draft"})
	}
	n, _ := articles.CountDistinct(alice, "title")
	groups, _ := articles.GroupBy[string](alice, "status", []store.Aggregate{{Func: "count"}})
	count, _ := groups[0].Values[0].Int64()
	fmt.Println(n, groups[0].Key, count)
}
Output:
3 draft 3

func (*Store[T]) List

func (s *Store[T]) List(ctx context.Context, opts ...where.Option) (*chok.Page[T], error)

List returns the rows the filters match, sorted by where.Order with the row ID breaking ties so pages never overlap. Without pagination options it returns every row, as one page. where.Page, or Limit and Offset, pick a page of the size they name, the policy's default page size when they name none; the policy's max bounds only the pagination of where.FromQuery, a client's request (ListFromQuery). Page is the page number — 1 without pagination options, 0 for Offset and Limit, which have none. HasMore says whether rows follow; Total is filled only with where.Count. With where.Cursor, List is ListWithCursor.

func (*Store[T]) ListByIDs

func (s *Store[T]) ListByIDs(ctx context.Context, ids []uint, opts ...where.Option) ([]T, error)

ListByIDs is ListIn on the numeric primary key, which has no field name: the rows whose key is in ids, as PluckIDs or a foreign key column gives them, in key order.

func (*Store[T]) ListFromQuery

func (s *Store[T]) ListFromQuery(ctx context.Context, q url.Values) (*chok.Page[T], error)

ListFromQuery serves chok.List: page, size, order=field:asc|desc and cursor from the query string, and every query field as an equality filter (a repeated parameter matches any of its values). A filter on a boolean, numeric or time field is read as that type first: true or false (1 and 0 too), a number, an RFC 3339 time. An unknown parameter, or a value that does not parse, is a 400. The page is always one page: the policy's default page size when the query names none, and never more than its max. It always carries Total.

func (*Store[T]) ListIn added in v0.2.0

func (s *Store[T]) ListIn[V comparable](ctx context.Context, field string, values []V, opts ...where.Option) ([]T, error)

ListIn returns the rows whose field is one of values, querying 500 values at a time so any number fits; options may only filter.

func (*Store[T]) ListWithCursor

func (s *Store[T]) ListWithCursor(ctx context.Context, opts ...where.Option) (*chok.Page[T], error)

ListWithCursor returns a keyset page: the rows after where.Cursor's cursor (none for the first page), ordered by the one where.Order given, or by ID. The page's Cursor continues it and is empty on the last page; clients pass it back untouched. Unlike offset pages, rows added or removed meanwhile never shift a cursor page. The page has the size where.Cursor names, the policy's default page size without one, and a cursor from where.FromQuery stays within the policy's max. The order field must be a NOT NULL scalar; Total is filled only with where.Count.

func (*Store[T]) Max added in v0.2.0

func (s *Store[T]) Max[N Scalar](ctx context.Context, field string, opts ...where.Option) (N, bool, error)

Max returns the largest value of field, as Min.

func (*Store[T]) Min added in v0.2.0

func (s *Store[T]) Min[N Scalar](ctx context.Context, field string, opts ...where.Option) (N, bool, error)

Min returns the smallest value of field, a numeric or time column, and false when there was none. Compare times with Equal: the zone differs by dialect.

func (*Store[T]) Pluck added in v0.2.0

func (s *Store[T]) Pluck[F any](ctx context.Context, field string, opts ...where.Option) ([]F, error)

Pluck returns field of the rows the filters match, in where.Order's order. Unlike List it takes every row unless where.Limit or where.Page says otherwise.

func (*Store[T]) PluckIDs added in v0.2.0

func (s *Store[T]) PluckIDs(ctx context.Context, opts ...where.Option) ([]uint, error)

PluckIDs returns the numeric primary keys of the rows the filters match, for server-side work; they never leave the server.

func (*Store[T]) QueryFields added in v0.2.0

func (s *Store[T]) QueryFields() []string

QueryFields lists the fields a URL filters and orders on: those ListFromQuery and chok.List accept, and the OpenAPI document lists.

func (*Store[T]) Restore added in v0.2.0

func (s *Store[T]) Restore(ctx context.Context, loc Locator) error

Restore brings back the soft-deleted row loc names. If a live row took one of its SoftUnique values meanwhile, Restore is a DuplicateError and the row stays deleted. Restoring a live row does nothing; a row the caller may not see is a NotFoundError.

func (*Store[T]) Sum added in v0.2.0

func (s *Store[T]) Sum[N Number](ctx context.Context, field string, opts ...where.Option) (N, bool, error)

Sum returns the sum of field over the rows the filters match, and false when there was nothing to sum (no rows, or only NULLs).

func (*Store[T]) Tx

func (s *Store[T]) Tx(ctx context.Context, fn func(txCtx context.Context) error) error

Tx runs fn in a transaction; the store's methods called with txCtx, and those of any store on the same handle, join it.

func (*Store[T]) Unsafe added in v0.2.0

func (s *Store[T]) Unsafe(ctx context.Context) *gorm.DB

Unsafe returns the *gorm.DB of the store's model with the owner scope and the custom scopes applied, joined to the transaction in ctx. A scope that fails leaves the error on the returned *gorm.DB, so whatever runs on it fails: the escape hatch is fenced like the rest. To get past the fences, use (*db.DB).Unsafe on the handle the store was built on.

func (*Store[T]) Update

func (s *Store[T]) Update(ctx context.Context, loc Locator, ch *Changes, opts ...where.Option) error

Update writes ch to the row loc names and advances its version. The lock is where.Version, else the version Patch(...).Onto carried: when the row has moved past it, Update fails with VersionConflictError, and on success the object given to Onto holds the new values, version and updated_at, ready to return. A row the caller may not see is a NotFoundError.

func (*Store[T]) Upsert

func (s *Store[T]) Upsert(ctx context.Context, obj *T, conflict ...string) error

Upsert inserts obj or, when a row with the same conflict fields exists, overwrites that row's update fields and advances its version. conflict names the fields of a unique index, the RID when empty. On a soft-delete model a SoftUnique index counts only live rows; any other index, a Unique or the RID's, counts deleted rows too, and a deleted row holding obj's values is the DuplicateError Create gets, with nothing written. The check runs before the write: on PostgreSQL and MySQL a row deleted in between is still the one updated, and stays deleted; SQLite's single writer leaves no such gap. MySQL updates on any unique key whatever conflict says. obj is not reloaded: after an update it does not hold the stored row's RID or version. An owner-scoped or custom-scoped store refuses Upsert, whose update cannot be fenced: use Create, and Update on a DuplicateError.

type VersionConflictError

type VersionConflictError struct {
	Locator string
	Version int
}

VersionConflictError is an update or delete whose version no longer matches the row: someone changed it since it was read.

func (*VersionConflictError) APIError added in v0.2.0

func (e *VersionConflictError) APIError() *chok.Error

APIError is the 409, with metadata.version.

func (*VersionConflictError) Error

func (e *VersionConflictError) Error() string

func (*VersionConflictError) Is

func (e *VersionConflictError) Is(target error) bool

Is matches chok.ErrConflict.

Directories

Path Synopsis
internal
q
Package q holds what store and store/where share without exporting it: resolving a public field name to a column, safely.
Package q holds what store and store/where share without exporting it: resolving a public field name to a column, safely.
Package where is the query vocabulary of store: filters, ordering, pagination and the query modifiers, each an Option that a store applies to its query.
Package where is the query vocabulary of store: filters, ordering, pagination and the query modifiers, each an Option that a store applies to its query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL