Documentation ¶
Index ¶
Constants ¶
View Source
const AfterInsert = "aINSERT"
View Source
const AfterSelect = "aSELECT"
View Source
const BeforeInsert = "bINSERT"
View Source
const BeforeSelect = "bSELECT"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
Collection holds a table scoped database connection
func NewCollection ¶ added in v0.1.4
func NewCollection(db *sqlx.DB, tableName string) *Collection
func (*Collection) AddCallback ¶ added in v0.1.4
func (c *Collection) AddCallback(key string, cb func(q *Query))
func (*Collection) Find ¶
func (c *Collection) Find(Criteria M) *Query
func (*Collection) FindOne ¶
func (c *Collection) FindOne(Criteria M) *Query
func (*Collection) Insert ¶
func (c *Collection) Insert(from M) *Query
func (*Collection) Truncate ¶
func (c *Collection) Truncate() error
type Query ¶
type Query struct { C *Collection Criteria M LastID int Err error // contains filtered or unexported fields }
type Store ¶
type Store struct { DB *sqlx.DB Collections map[string]*Collection }
Store holds all database collections
func NewConnection ¶
NewConnection creates a sql database connection and contentful client
func (*Store) AddCollection ¶
func (s *Store) AddCollection(tableName string) *Collection
Click to show internal directories.
Click to hide internal directories.