Documentation
¶
Overview ¶
Package store runs CRUD statements against the exposed tables and views.
Index ¶
- Variables
- type AllowFunc
- type Options
- type Row
- type SQLStore
- func (s *SQLStore) Delete(ctx context.Context, table, pk string) error
- func (s *SQLStore) Get(ctx context.Context, table, pk string) (Row, error)
- func (s *SQLStore) Insert(ctx context.Context, table string, row Row) (Row, error)
- func (s *SQLStore) List(ctx context.Context, table string, req query.ListRequest) ([]Row, error)
- func (s *SQLStore) Tables(ctx context.Context) ([]schema.Table, error)
- func (s *SQLStore) Update(ctx context.Context, table, pk string, row Row) (Row, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRowNotFound = errors.New("row not found") ErrNoRowKey = errors.New("no single-column primary key") ErrReadOnly = errors.New("views are read-only") // ErrConflict is a UNIQUE, PRIMARY KEY, or FOREIGN KEY violation. ErrConflict = errors.New("conflict") // ErrConstraint is a NOT NULL or CHECK violation, or a value of the wrong // type for an INTEGER PRIMARY KEY. ErrConstraint = errors.New("constraint violation") )
Functions ¶
This section is empty.
Types ¶
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
func NewSQLStore ¶
type Store ¶
type Store interface {
Tables(ctx context.Context) ([]schema.Table, error)
List(ctx context.Context, table string, req query.ListRequest) ([]Row, error)
Get(ctx context.Context, table, pk string) (Row, error)
Insert(ctx context.Context, table string, row Row) (Row, error)
Update(ctx context.Context, table, pk string, row Row) (Row, error)
Delete(ctx context.Context, table, pk string) error
}
Click to show internal directories.
Click to hide internal directories.