Documentation ¶
Overview ¶
Code generated by https://github.com/src-d/go-kallax. DO NOT EDIT. Please, do not touch the code below, and if you do, do it under your own risk. Take into account that all the code you write here will be completely erased from earth the next time you generate the kallax models.
Index ¶
- Variables
- type A
- type AQuery
- func (q *AQuery) BatchSize(size uint64) *AQuery
- func (q *AQuery) Copy() *AQuery
- func (q *AQuery) FindByID(v ...int64) *AQuery
- func (q *AQuery) FindByName(v string) *AQuery
- func (q *AQuery) Limit(n uint64) *AQuery
- func (q *AQuery) Offset(n uint64) *AQuery
- func (q *AQuery) Order(cols ...kallax.ColumnOrder) *AQuery
- func (q *AQuery) Select(columns ...kallax.SchemaField) *AQuery
- func (q *AQuery) SelectNot(columns ...kallax.SchemaField) *AQuery
- func (q *AQuery) Where(cond kallax.Condition) *AQuery
- func (q *AQuery) WithB() *AQuery
- type AResultSet
- type AStore
- func (s *AStore) Count(q *AQuery) (int64, error)
- func (s *AStore) Debug() *AStore
- func (s *AStore) DebugWith(logger kallax.LoggerFunc) *AStore
- func (s *AStore) Delete(record *A) error
- func (s *AStore) DisableCacher() *AStore
- func (s *AStore) Find(q *AQuery) (*AResultSet, error)
- func (s *AStore) FindAll(q *AQuery) ([]*A, error)
- func (s *AStore) FindOne(q *AQuery) (*A, error)
- func (s *AStore) GenericStore() *kallax.Store
- func (s *AStore) Insert(record *A) error
- func (s *AStore) MustCount(q *AQuery) int64
- func (s *AStore) MustFind(q *AQuery) *AResultSet
- func (s *AStore) MustFindOne(q *AQuery) *A
- func (s *AStore) Reload(record *A) error
- func (s *AStore) RemoveB(record *A) error
- func (s *AStore) Save(record *A) (updated bool, err error)
- func (s *AStore) SetGenericStore(store *kallax.Store)
- func (s *AStore) Transaction(callback func(*AStore) error) error
- func (s *AStore) Update(record *A, cols ...kallax.SchemaField) (updated int64, err error)
- type AliasHereArray
- type AliasHereString
- type AliasID
- type AliasSliceString
- type B
- type BQuery
- func (q *BQuery) BatchSize(size uint64) *BQuery
- func (q *BQuery) Copy() *BQuery
- func (q *BQuery) FindByA(v int64) *BQuery
- func (q *BQuery) FindByID(v ...int64) *BQuery
- func (q *BQuery) FindByName(v string) *BQuery
- func (q *BQuery) Limit(n uint64) *BQuery
- func (q *BQuery) Offset(n uint64) *BQuery
- func (q *BQuery) Order(cols ...kallax.ColumnOrder) *BQuery
- func (q *BQuery) Select(columns ...kallax.SchemaField) *BQuery
- func (q *BQuery) SelectNot(columns ...kallax.SchemaField) *BQuery
- func (q *BQuery) Where(cond kallax.Condition) *BQuery
- func (q *BQuery) WithA() *BQuery
- func (q *BQuery) WithC() *BQuery
- type BResultSet
- type BStore
- func (s *BStore) Count(q *BQuery) (int64, error)
- func (s *BStore) Debug() *BStore
- func (s *BStore) DebugWith(logger kallax.LoggerFunc) *BStore
- func (s *BStore) Delete(record *B) error
- func (s *BStore) DisableCacher() *BStore
- func (s *BStore) Find(q *BQuery) (*BResultSet, error)
- func (s *BStore) FindAll(q *BQuery) ([]*B, error)
- func (s *BStore) FindOne(q *BQuery) (*B, error)
- func (s *BStore) GenericStore() *kallax.Store
- func (s *BStore) Insert(record *B) error
- func (s *BStore) MustCount(q *BQuery) int64
- func (s *BStore) MustFind(q *BQuery) *BResultSet
- func (s *BStore) MustFindOne(q *BQuery) *B
- func (s *BStore) Reload(record *B) error
- func (s *BStore) RemoveC(record *B) error
- func (s *BStore) Save(record *B) (updated bool, err error)
- func (s *BStore) SetGenericStore(store *kallax.Store)
- func (s *BStore) Transaction(callback func(*BStore) error) error
- func (s *BStore) Update(record *B, cols ...kallax.SchemaField) (updated int64, err error)
- type Bar
- type Baz
- type Brand
- func (r *Brand) ColumnAddress(col string) (interface{}, error)
- func (r *Brand) GetID() kallax.Identifier
- func (r *Brand) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Brand) SetRelationship(field string, rel interface{}) error
- func (r *Brand) Value(col string) (interface{}, error)
- type BrandQuery
- func (q *BrandQuery) BatchSize(size uint64) *BrandQuery
- func (q *BrandQuery) Copy() *BrandQuery
- func (q *BrandQuery) FindByID(v ...kallax.ULID) *BrandQuery
- func (q *BrandQuery) FindByName(v string) *BrandQuery
- func (q *BrandQuery) Limit(n uint64) *BrandQuery
- func (q *BrandQuery) Offset(n uint64) *BrandQuery
- func (q *BrandQuery) Order(cols ...kallax.ColumnOrder) *BrandQuery
- func (q *BrandQuery) Select(columns ...kallax.SchemaField) *BrandQuery
- func (q *BrandQuery) SelectNot(columns ...kallax.SchemaField) *BrandQuery
- func (q *BrandQuery) Where(cond kallax.Condition) *BrandQuery
- type BrandResultSet
- func (rs *BrandResultSet) All() ([]*Brand, error)
- func (rs *BrandResultSet) Close() error
- func (rs *BrandResultSet) Err() error
- func (rs *BrandResultSet) ForEach(fn func(*Brand) error) error
- func (rs *BrandResultSet) Get() (*Brand, error)
- func (rs *BrandResultSet) Next() bool
- func (rs *BrandResultSet) One() (*Brand, error)
- type BrandStore
- func (s *BrandStore) Count(q *BrandQuery) (int64, error)
- func (s *BrandStore) Debug() *BrandStore
- func (s *BrandStore) DebugWith(logger kallax.LoggerFunc) *BrandStore
- func (s *BrandStore) Delete(record *Brand) error
- func (s *BrandStore) DisableCacher() *BrandStore
- func (s *BrandStore) Find(q *BrandQuery) (*BrandResultSet, error)
- func (s *BrandStore) FindAll(q *BrandQuery) ([]*Brand, error)
- func (s *BrandStore) FindOne(q *BrandQuery) (*Brand, error)
- func (s *BrandStore) GenericStore() *kallax.Store
- func (s *BrandStore) Insert(record *Brand) error
- func (s *BrandStore) MustCount(q *BrandQuery) int64
- func (s *BrandStore) MustFind(q *BrandQuery) *BrandResultSet
- func (s *BrandStore) MustFindOne(q *BrandQuery) *Brand
- func (s *BrandStore) Reload(record *Brand) error
- func (s *BrandStore) Save(record *Brand) (updated bool, err error)
- func (s *BrandStore) SetGenericStore(store *kallax.Store)
- func (s *BrandStore) Transaction(callback func(*BrandStore) error) error
- func (s *BrandStore) Update(record *Brand, cols ...kallax.SchemaField) (updated int64, err error)
- type C
- type CQuery
- func (q *CQuery) BatchSize(size uint64) *CQuery
- func (q *CQuery) Copy() *CQuery
- func (q *CQuery) FindByB(v int64) *CQuery
- func (q *CQuery) FindByID(v ...int64) *CQuery
- func (q *CQuery) FindByName(v string) *CQuery
- func (q *CQuery) Limit(n uint64) *CQuery
- func (q *CQuery) Offset(n uint64) *CQuery
- func (q *CQuery) Order(cols ...kallax.ColumnOrder) *CQuery
- func (q *CQuery) Select(columns ...kallax.SchemaField) *CQuery
- func (q *CQuery) SelectNot(columns ...kallax.SchemaField) *CQuery
- func (q *CQuery) Where(cond kallax.Condition) *CQuery
- func (q *CQuery) WithB() *CQuery
- type CResultSet
- type CStore
- func (s *CStore) Count(q *CQuery) (int64, error)
- func (s *CStore) Debug() *CStore
- func (s *CStore) DebugWith(logger kallax.LoggerFunc) *CStore
- func (s *CStore) Delete(record *C) error
- func (s *CStore) DisableCacher() *CStore
- func (s *CStore) Find(q *CQuery) (*CResultSet, error)
- func (s *CStore) FindAll(q *CQuery) ([]*C, error)
- func (s *CStore) FindOne(q *CQuery) (*C, error)
- func (s *CStore) GenericStore() *kallax.Store
- func (s *CStore) Insert(record *C) error
- func (s *CStore) MustCount(q *CQuery) int64
- func (s *CStore) MustFind(q *CQuery) *CResultSet
- func (s *CStore) MustFindOne(q *CQuery) *C
- func (s *CStore) Reload(record *C) error
- func (s *CStore) Save(record *C) (updated bool, err error)
- func (s *CStore) SetGenericStore(store *kallax.Store)
- func (s *CStore) Transaction(callback func(*CStore) error) error
- func (s *CStore) Update(record *C, cols ...kallax.SchemaField) (updated int64, err error)
- type Car
- func (c *Car) AfterDelete() error
- func (c *Car) AfterSave() error
- func (c *Car) BeforeDelete() error
- func (c *Car) BeforeSave() error
- func (r *Car) ColumnAddress(col string) (interface{}, error)
- func (r *Car) GetID() kallax.Identifier
- func (r *Car) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Car) SetRelationship(field string, rel interface{}) error
- func (r *Car) Value(col string) (interface{}, error)
- type CarQuery
- func (q *CarQuery) BatchSize(size uint64) *CarQuery
- func (q *CarQuery) Copy() *CarQuery
- func (q *CarQuery) FindByBrand(v kallax.ULID) *CarQuery
- func (q *CarQuery) FindByID(v ...kallax.ULID) *CarQuery
- func (q *CarQuery) FindByModelName(v string) *CarQuery
- func (q *CarQuery) FindByOwner(v int64) *CarQuery
- func (q *CarQuery) Limit(n uint64) *CarQuery
- func (q *CarQuery) Offset(n uint64) *CarQuery
- func (q *CarQuery) Order(cols ...kallax.ColumnOrder) *CarQuery
- func (q *CarQuery) Select(columns ...kallax.SchemaField) *CarQuery
- func (q *CarQuery) SelectNot(columns ...kallax.SchemaField) *CarQuery
- func (q *CarQuery) Where(cond kallax.Condition) *CarQuery
- func (q *CarQuery) WithBrand() *CarQuery
- func (q *CarQuery) WithOwner() *CarQuery
- type CarResultSet
- func (rs *CarResultSet) All() ([]*Car, error)
- func (rs *CarResultSet) Close() error
- func (rs *CarResultSet) Err() error
- func (rs *CarResultSet) ForEach(fn func(*Car) error) error
- func (rs *CarResultSet) Get() (*Car, error)
- func (rs *CarResultSet) Next() bool
- func (rs *CarResultSet) One() (*Car, error)
- type CarStore
- func (s *CarStore) Count(q *CarQuery) (int64, error)
- func (s *CarStore) Debug() *CarStore
- func (s *CarStore) DebugWith(logger kallax.LoggerFunc) *CarStore
- func (s *CarStore) Delete(record *Car) error
- func (s *CarStore) DisableCacher() *CarStore
- func (s *CarStore) Find(q *CarQuery) (*CarResultSet, error)
- func (s *CarStore) FindAll(q *CarQuery) ([]*Car, error)
- func (s *CarStore) FindOne(q *CarQuery) (*Car, error)
- func (s *CarStore) GenericStore() *kallax.Store
- func (s *CarStore) Insert(record *Car) error
- func (s *CarStore) MustCount(q *CarQuery) int64
- func (s *CarStore) MustFind(q *CarQuery) *CarResultSet
- func (s *CarStore) MustFindOne(q *CarQuery) *Car
- func (s *CarStore) Reload(record *Car) error
- func (s *CarStore) Save(record *Car) (updated bool, err error)
- func (s *CarStore) SetGenericStore(store *kallax.Store)
- func (s *CarStore) Transaction(callback func(*CarStore) error) error
- func (s *CarStore) Update(record *Car, cols ...kallax.SchemaField) (updated int64, err error)
- type Child
- func (r *Child) ColumnAddress(col string) (interface{}, error)
- func (r *Child) GetID() kallax.Identifier
- func (r *Child) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Child) SetRelationship(field string, rel interface{}) error
- func (r *Child) Value(col string) (interface{}, error)
- type ChildQuery
- func (q *ChildQuery) BatchSize(size uint64) *ChildQuery
- func (q *ChildQuery) Copy() *ChildQuery
- func (q *ChildQuery) FindByID(v ...int64) *ChildQuery
- func (q *ChildQuery) FindByName(v string) *ChildQuery
- func (q *ChildQuery) Limit(n uint64) *ChildQuery
- func (q *ChildQuery) Offset(n uint64) *ChildQuery
- func (q *ChildQuery) Order(cols ...kallax.ColumnOrder) *ChildQuery
- func (q *ChildQuery) Select(columns ...kallax.SchemaField) *ChildQuery
- func (q *ChildQuery) SelectNot(columns ...kallax.SchemaField) *ChildQuery
- func (q *ChildQuery) Where(cond kallax.Condition) *ChildQuery
- type ChildResultSet
- func (rs *ChildResultSet) All() ([]*Child, error)
- func (rs *ChildResultSet) Close() error
- func (rs *ChildResultSet) Err() error
- func (rs *ChildResultSet) ForEach(fn func(*Child) error) error
- func (rs *ChildResultSet) Get() (*Child, error)
- func (rs *ChildResultSet) Next() bool
- func (rs *ChildResultSet) One() (*Child, error)
- type ChildStore
- func (s *ChildStore) Count(q *ChildQuery) (int64, error)
- func (s *ChildStore) Debug() *ChildStore
- func (s *ChildStore) DebugWith(logger kallax.LoggerFunc) *ChildStore
- func (s *ChildStore) Delete(record *Child) error
- func (s *ChildStore) DisableCacher() *ChildStore
- func (s *ChildStore) Find(q *ChildQuery) (*ChildResultSet, error)
- func (s *ChildStore) FindAll(q *ChildQuery) ([]*Child, error)
- func (s *ChildStore) FindOne(q *ChildQuery) (*Child, error)
- func (s *ChildStore) GenericStore() *kallax.Store
- func (s *ChildStore) Insert(record *Child) error
- func (s *ChildStore) MustCount(q *ChildQuery) int64
- func (s *ChildStore) MustFind(q *ChildQuery) *ChildResultSet
- func (s *ChildStore) MustFindOne(q *ChildQuery) *Child
- func (s *ChildStore) Reload(record *Child) error
- func (s *ChildStore) Save(record *Child) (updated bool, err error)
- func (s *ChildStore) SetGenericStore(store *kallax.Store)
- func (s *ChildStore) Transaction(callback func(*ChildStore) error) error
- func (s *ChildStore) Update(record *Child, cols ...kallax.SchemaField) (updated int64, err error)
- type EventsAllFixture
- func (s *EventsAllFixture) AfterInsert() error
- func (s *EventsAllFixture) AfterSave() error
- func (s *EventsAllFixture) AfterUpdate() error
- func (s *EventsAllFixture) BeforeInsert() error
- func (s *EventsAllFixture) BeforeSave() error
- func (s *EventsAllFixture) BeforeUpdate() error
- func (r *EventsAllFixture) ColumnAddress(col string) (interface{}, error)
- func (r *EventsAllFixture) GetID() kallax.Identifier
- func (r *EventsAllFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *EventsAllFixture) SetRelationship(field string, rel interface{}) error
- func (r *EventsAllFixture) Value(col string) (interface{}, error)
- type EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) BatchSize(size uint64) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Copy() *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) FindByID(v ...kallax.ULID) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Limit(n uint64) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Offset(n uint64) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Select(columns ...kallax.SchemaField) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsAllFixtureQuery
- func (q *EventsAllFixtureQuery) Where(cond kallax.Condition) *EventsAllFixtureQuery
- type EventsAllFixtureResultSet
- func (rs *EventsAllFixtureResultSet) All() ([]*EventsAllFixture, error)
- func (rs *EventsAllFixtureResultSet) Close() error
- func (rs *EventsAllFixtureResultSet) Err() error
- func (rs *EventsAllFixtureResultSet) ForEach(fn func(*EventsAllFixture) error) error
- func (rs *EventsAllFixtureResultSet) Get() (*EventsAllFixture, error)
- func (rs *EventsAllFixtureResultSet) Next() bool
- func (rs *EventsAllFixtureResultSet) One() (*EventsAllFixture, error)
- type EventsAllFixtureStore
- func (s *EventsAllFixtureStore) Count(q *EventsAllFixtureQuery) (int64, error)
- func (s *EventsAllFixtureStore) Debug() *EventsAllFixtureStore
- func (s *EventsAllFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsAllFixtureStore
- func (s *EventsAllFixtureStore) Delete(record *EventsAllFixture) error
- func (s *EventsAllFixtureStore) DisableCacher() *EventsAllFixtureStore
- func (s *EventsAllFixtureStore) Find(q *EventsAllFixtureQuery) (*EventsAllFixtureResultSet, error)
- func (s *EventsAllFixtureStore) FindAll(q *EventsAllFixtureQuery) ([]*EventsAllFixture, error)
- func (s *EventsAllFixtureStore) FindOne(q *EventsAllFixtureQuery) (*EventsAllFixture, error)
- func (s *EventsAllFixtureStore) GenericStore() *kallax.Store
- func (s *EventsAllFixtureStore) Insert(record *EventsAllFixture) error
- func (s *EventsAllFixtureStore) MustCount(q *EventsAllFixtureQuery) int64
- func (s *EventsAllFixtureStore) MustFind(q *EventsAllFixtureQuery) *EventsAllFixtureResultSet
- func (s *EventsAllFixtureStore) MustFindOne(q *EventsAllFixtureQuery) *EventsAllFixture
- func (s *EventsAllFixtureStore) Reload(record *EventsAllFixture) error
- func (s *EventsAllFixtureStore) Save(record *EventsAllFixture) (updated bool, err error)
- func (s *EventsAllFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *EventsAllFixtureStore) Transaction(callback func(*EventsAllFixtureStore) error) error
- func (s *EventsAllFixtureStore) Update(record *EventsAllFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type EventsFixture
- func (s *EventsFixture) AfterInsert() error
- func (s *EventsFixture) AfterUpdate() error
- func (s *EventsFixture) BeforeInsert() error
- func (s *EventsFixture) BeforeUpdate() error
- func (r *EventsFixture) ColumnAddress(col string) (interface{}, error)
- func (r *EventsFixture) GetID() kallax.Identifier
- func (r *EventsFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *EventsFixture) SetRelationship(field string, rel interface{}) error
- func (r *EventsFixture) Value(col string) (interface{}, error)
- type EventsFixtureQuery
- func (q *EventsFixtureQuery) BatchSize(size uint64) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Copy() *EventsFixtureQuery
- func (q *EventsFixtureQuery) FindByID(v ...kallax.ULID) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Limit(n uint64) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Offset(n uint64) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Select(columns ...kallax.SchemaField) *EventsFixtureQuery
- func (q *EventsFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsFixtureQuery
- func (q *EventsFixtureQuery) Where(cond kallax.Condition) *EventsFixtureQuery
- type EventsFixtureResultSet
- func (rs *EventsFixtureResultSet) All() ([]*EventsFixture, error)
- func (rs *EventsFixtureResultSet) Close() error
- func (rs *EventsFixtureResultSet) Err() error
- func (rs *EventsFixtureResultSet) ForEach(fn func(*EventsFixture) error) error
- func (rs *EventsFixtureResultSet) Get() (*EventsFixture, error)
- func (rs *EventsFixtureResultSet) Next() bool
- func (rs *EventsFixtureResultSet) One() (*EventsFixture, error)
- type EventsFixtureStore
- func (s *EventsFixtureStore) Count(q *EventsFixtureQuery) (int64, error)
- func (s *EventsFixtureStore) Debug() *EventsFixtureStore
- func (s *EventsFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsFixtureStore
- func (s *EventsFixtureStore) Delete(record *EventsFixture) error
- func (s *EventsFixtureStore) DisableCacher() *EventsFixtureStore
- func (s *EventsFixtureStore) Find(q *EventsFixtureQuery) (*EventsFixtureResultSet, error)
- func (s *EventsFixtureStore) FindAll(q *EventsFixtureQuery) ([]*EventsFixture, error)
- func (s *EventsFixtureStore) FindOne(q *EventsFixtureQuery) (*EventsFixture, error)
- func (s *EventsFixtureStore) GenericStore() *kallax.Store
- func (s *EventsFixtureStore) Insert(record *EventsFixture) error
- func (s *EventsFixtureStore) MustCount(q *EventsFixtureQuery) int64
- func (s *EventsFixtureStore) MustFind(q *EventsFixtureQuery) *EventsFixtureResultSet
- func (s *EventsFixtureStore) MustFindOne(q *EventsFixtureQuery) *EventsFixture
- func (s *EventsFixtureStore) Reload(record *EventsFixture) error
- func (s *EventsFixtureStore) Save(record *EventsFixture) (updated bool, err error)
- func (s *EventsFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *EventsFixtureStore) Transaction(callback func(*EventsFixtureStore) error) error
- func (s *EventsFixtureStore) Update(record *EventsFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type EventsSaveFixture
- func (s *EventsSaveFixture) AfterSave() error
- func (s *EventsSaveFixture) BeforeSave() error
- func (r *EventsSaveFixture) ColumnAddress(col string) (interface{}, error)
- func (r *EventsSaveFixture) GetID() kallax.Identifier
- func (r *EventsSaveFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *EventsSaveFixture) SetRelationship(field string, rel interface{}) error
- func (r *EventsSaveFixture) Value(col string) (interface{}, error)
- type EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) BatchSize(size uint64) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Copy() *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) FindByID(v ...kallax.ULID) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Limit(n uint64) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Offset(n uint64) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Select(columns ...kallax.SchemaField) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsSaveFixtureQuery
- func (q *EventsSaveFixtureQuery) Where(cond kallax.Condition) *EventsSaveFixtureQuery
- type EventsSaveFixtureResultSet
- func (rs *EventsSaveFixtureResultSet) All() ([]*EventsSaveFixture, error)
- func (rs *EventsSaveFixtureResultSet) Close() error
- func (rs *EventsSaveFixtureResultSet) Err() error
- func (rs *EventsSaveFixtureResultSet) ForEach(fn func(*EventsSaveFixture) error) error
- func (rs *EventsSaveFixtureResultSet) Get() (*EventsSaveFixture, error)
- func (rs *EventsSaveFixtureResultSet) Next() bool
- func (rs *EventsSaveFixtureResultSet) One() (*EventsSaveFixture, error)
- type EventsSaveFixtureStore
- func (s *EventsSaveFixtureStore) Count(q *EventsSaveFixtureQuery) (int64, error)
- func (s *EventsSaveFixtureStore) Debug() *EventsSaveFixtureStore
- func (s *EventsSaveFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsSaveFixtureStore
- func (s *EventsSaveFixtureStore) Delete(record *EventsSaveFixture) error
- func (s *EventsSaveFixtureStore) DisableCacher() *EventsSaveFixtureStore
- func (s *EventsSaveFixtureStore) Find(q *EventsSaveFixtureQuery) (*EventsSaveFixtureResultSet, error)
- func (s *EventsSaveFixtureStore) FindAll(q *EventsSaveFixtureQuery) ([]*EventsSaveFixture, error)
- func (s *EventsSaveFixtureStore) FindOne(q *EventsSaveFixtureQuery) (*EventsSaveFixture, error)
- func (s *EventsSaveFixtureStore) GenericStore() *kallax.Store
- func (s *EventsSaveFixtureStore) Insert(record *EventsSaveFixture) error
- func (s *EventsSaveFixtureStore) MustCount(q *EventsSaveFixtureQuery) int64
- func (s *EventsSaveFixtureStore) MustFind(q *EventsSaveFixtureQuery) *EventsSaveFixtureResultSet
- func (s *EventsSaveFixtureStore) MustFindOne(q *EventsSaveFixtureQuery) *EventsSaveFixture
- func (s *EventsSaveFixtureStore) Reload(record *EventsSaveFixture) error
- func (s *EventsSaveFixtureStore) Save(record *EventsSaveFixture) (updated bool, err error)
- func (s *EventsSaveFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *EventsSaveFixtureStore) Transaction(callback func(*EventsSaveFixtureStore) error) error
- func (s *EventsSaveFixtureStore) Update(record *EventsSaveFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type JSONModel
- func (r *JSONModel) ColumnAddress(col string) (interface{}, error)
- func (r *JSONModel) GetID() kallax.Identifier
- func (r *JSONModel) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *JSONModel) SetRelationship(field string, rel interface{}) error
- func (r *JSONModel) Value(col string) (interface{}, error)
- type JSONModelQuery
- func (q *JSONModelQuery) BatchSize(size uint64) *JSONModelQuery
- func (q *JSONModelQuery) Copy() *JSONModelQuery
- func (q *JSONModelQuery) FindByFoo(v string) *JSONModelQuery
- func (q *JSONModelQuery) FindByID(v ...kallax.ULID) *JSONModelQuery
- func (q *JSONModelQuery) Limit(n uint64) *JSONModelQuery
- func (q *JSONModelQuery) Offset(n uint64) *JSONModelQuery
- func (q *JSONModelQuery) Order(cols ...kallax.ColumnOrder) *JSONModelQuery
- func (q *JSONModelQuery) Select(columns ...kallax.SchemaField) *JSONModelQuery
- func (q *JSONModelQuery) SelectNot(columns ...kallax.SchemaField) *JSONModelQuery
- func (q *JSONModelQuery) Where(cond kallax.Condition) *JSONModelQuery
- type JSONModelResultSet
- func (rs *JSONModelResultSet) All() ([]*JSONModel, error)
- func (rs *JSONModelResultSet) Close() error
- func (rs *JSONModelResultSet) Err() error
- func (rs *JSONModelResultSet) ForEach(fn func(*JSONModel) error) error
- func (rs *JSONModelResultSet) Get() (*JSONModel, error)
- func (rs *JSONModelResultSet) Next() bool
- func (rs *JSONModelResultSet) One() (*JSONModel, error)
- type JSONModelStore
- func (s *JSONModelStore) Count(q *JSONModelQuery) (int64, error)
- func (s *JSONModelStore) Debug() *JSONModelStore
- func (s *JSONModelStore) DebugWith(logger kallax.LoggerFunc) *JSONModelStore
- func (s *JSONModelStore) Delete(record *JSONModel) error
- func (s *JSONModelStore) DisableCacher() *JSONModelStore
- func (s *JSONModelStore) Find(q *JSONModelQuery) (*JSONModelResultSet, error)
- func (s *JSONModelStore) FindAll(q *JSONModelQuery) ([]*JSONModel, error)
- func (s *JSONModelStore) FindOne(q *JSONModelQuery) (*JSONModel, error)
- func (s *JSONModelStore) GenericStore() *kallax.Store
- func (s *JSONModelStore) Insert(record *JSONModel) error
- func (s *JSONModelStore) MustCount(q *JSONModelQuery) int64
- func (s *JSONModelStore) MustFind(q *JSONModelQuery) *JSONModelResultSet
- func (s *JSONModelStore) MustFindOne(q *JSONModelQuery) *JSONModel
- func (s *JSONModelStore) Reload(record *JSONModel) error
- func (s *JSONModelStore) Save(record *JSONModel) (updated bool, err error)
- func (s *JSONModelStore) SetGenericStore(store *kallax.Store)
- func (s *JSONModelStore) Transaction(callback func(*JSONModelStore) error) error
- func (s *JSONModelStore) Update(record *JSONModel, cols ...kallax.SchemaField) (updated int64, err error)
- type MultiKeySortFixture
- func (r *MultiKeySortFixture) ColumnAddress(col string) (interface{}, error)
- func (r *MultiKeySortFixture) GetID() kallax.Identifier
- func (r *MultiKeySortFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *MultiKeySortFixture) SetRelationship(field string, rel interface{}) error
- func (r *MultiKeySortFixture) Value(col string) (interface{}, error)
- type MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) BatchSize(size uint64) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Copy() *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) FindByEnd(cond kallax.ScalarCond, v time.Time) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) FindByID(v ...kallax.ULID) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) FindByName(v string) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) FindByStart(cond kallax.ScalarCond, v time.Time) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Limit(n uint64) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Offset(n uint64) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Order(cols ...kallax.ColumnOrder) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Select(columns ...kallax.SchemaField) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) SelectNot(columns ...kallax.SchemaField) *MultiKeySortFixtureQuery
- func (q *MultiKeySortFixtureQuery) Where(cond kallax.Condition) *MultiKeySortFixtureQuery
- type MultiKeySortFixtureResultSet
- func (rs *MultiKeySortFixtureResultSet) All() ([]*MultiKeySortFixture, error)
- func (rs *MultiKeySortFixtureResultSet) Close() error
- func (rs *MultiKeySortFixtureResultSet) Err() error
- func (rs *MultiKeySortFixtureResultSet) ForEach(fn func(*MultiKeySortFixture) error) error
- func (rs *MultiKeySortFixtureResultSet) Get() (*MultiKeySortFixture, error)
- func (rs *MultiKeySortFixtureResultSet) Next() bool
- func (rs *MultiKeySortFixtureResultSet) One() (*MultiKeySortFixture, error)
- type MultiKeySortFixtureStore
- func (s *MultiKeySortFixtureStore) Count(q *MultiKeySortFixtureQuery) (int64, error)
- func (s *MultiKeySortFixtureStore) Debug() *MultiKeySortFixtureStore
- func (s *MultiKeySortFixtureStore) DebugWith(logger kallax.LoggerFunc) *MultiKeySortFixtureStore
- func (s *MultiKeySortFixtureStore) Delete(record *MultiKeySortFixture) error
- func (s *MultiKeySortFixtureStore) DisableCacher() *MultiKeySortFixtureStore
- func (s *MultiKeySortFixtureStore) Find(q *MultiKeySortFixtureQuery) (*MultiKeySortFixtureResultSet, error)
- func (s *MultiKeySortFixtureStore) FindAll(q *MultiKeySortFixtureQuery) ([]*MultiKeySortFixture, error)
- func (s *MultiKeySortFixtureStore) FindOne(q *MultiKeySortFixtureQuery) (*MultiKeySortFixture, error)
- func (s *MultiKeySortFixtureStore) GenericStore() *kallax.Store
- func (s *MultiKeySortFixtureStore) Insert(record *MultiKeySortFixture) error
- func (s *MultiKeySortFixtureStore) MustCount(q *MultiKeySortFixtureQuery) int64
- func (s *MultiKeySortFixtureStore) MustFind(q *MultiKeySortFixtureQuery) *MultiKeySortFixtureResultSet
- func (s *MultiKeySortFixtureStore) MustFindOne(q *MultiKeySortFixtureQuery) *MultiKeySortFixture
- func (s *MultiKeySortFixtureStore) Reload(record *MultiKeySortFixture) error
- func (s *MultiKeySortFixtureStore) Save(record *MultiKeySortFixture) (updated bool, err error)
- func (s *MultiKeySortFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *MultiKeySortFixtureStore) Transaction(callback func(*MultiKeySortFixtureStore) error) error
- func (s *MultiKeySortFixtureStore) Update(record *MultiKeySortFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type Nullable
- func (r *Nullable) ColumnAddress(col string) (interface{}, error)
- func (r *Nullable) GetID() kallax.Identifier
- func (r *Nullable) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Nullable) SetRelationship(field string, rel interface{}) error
- func (r *Nullable) Value(col string) (interface{}, error)
- type NullableQuery
- func (q *NullableQuery) BatchSize(size uint64) *NullableQuery
- func (q *NullableQuery) Copy() *NullableQuery
- func (q *NullableQuery) FindByID(v ...int64) *NullableQuery
- func (q *NullableQuery) FindByScanner(v kallax.ULID) *NullableQuery
- func (q *NullableQuery) FindByT(cond kallax.ScalarCond, v time.Time) *NullableQuery
- func (q *NullableQuery) Limit(n uint64) *NullableQuery
- func (q *NullableQuery) Offset(n uint64) *NullableQuery
- func (q *NullableQuery) Order(cols ...kallax.ColumnOrder) *NullableQuery
- func (q *NullableQuery) Select(columns ...kallax.SchemaField) *NullableQuery
- func (q *NullableQuery) SelectNot(columns ...kallax.SchemaField) *NullableQuery
- func (q *NullableQuery) Where(cond kallax.Condition) *NullableQuery
- type NullableResultSet
- func (rs *NullableResultSet) All() ([]*Nullable, error)
- func (rs *NullableResultSet) Close() error
- func (rs *NullableResultSet) Err() error
- func (rs *NullableResultSet) ForEach(fn func(*Nullable) error) error
- func (rs *NullableResultSet) Get() (*Nullable, error)
- func (rs *NullableResultSet) Next() bool
- func (rs *NullableResultSet) One() (*Nullable, error)
- type NullableStore
- func (s *NullableStore) Count(q *NullableQuery) (int64, error)
- func (s *NullableStore) Debug() *NullableStore
- func (s *NullableStore) DebugWith(logger kallax.LoggerFunc) *NullableStore
- func (s *NullableStore) Delete(record *Nullable) error
- func (s *NullableStore) DisableCacher() *NullableStore
- func (s *NullableStore) Find(q *NullableQuery) (*NullableResultSet, error)
- func (s *NullableStore) FindAll(q *NullableQuery) ([]*Nullable, error)
- func (s *NullableStore) FindOne(q *NullableQuery) (*Nullable, error)
- func (s *NullableStore) GenericStore() *kallax.Store
- func (s *NullableStore) Insert(record *Nullable) error
- func (s *NullableStore) MustCount(q *NullableQuery) int64
- func (s *NullableStore) MustFind(q *NullableQuery) *NullableResultSet
- func (s *NullableStore) MustFindOne(q *NullableQuery) *Nullable
- func (s *NullableStore) Reload(record *Nullable) error
- func (s *NullableStore) Save(record *Nullable) (updated bool, err error)
- func (s *NullableStore) SetGenericStore(store *kallax.Store)
- func (s *NullableStore) Transaction(callback func(*NullableStore) error) error
- func (s *NullableStore) Update(record *Nullable, cols ...kallax.SchemaField) (updated int64, err error)
- type Parent
- func (r *Parent) ColumnAddress(col string) (interface{}, error)
- func (r *Parent) GetID() kallax.Identifier
- func (r *Parent) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Parent) SetRelationship(field string, rel interface{}) error
- func (r *Parent) Value(col string) (interface{}, error)
- type ParentNoPtr
- func (r *ParentNoPtr) ColumnAddress(col string) (interface{}, error)
- func (r *ParentNoPtr) GetID() kallax.Identifier
- func (r *ParentNoPtr) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *ParentNoPtr) SetRelationship(field string, rel interface{}) error
- func (r *ParentNoPtr) Value(col string) (interface{}, error)
- type ParentNoPtrQuery
- func (q *ParentNoPtrQuery) BatchSize(size uint64) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Copy() *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) FindByID(v ...int64) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) FindByName(v string) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Limit(n uint64) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Offset(n uint64) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Order(cols ...kallax.ColumnOrder) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Select(columns ...kallax.SchemaField) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) SelectNot(columns ...kallax.SchemaField) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) Where(cond kallax.Condition) *ParentNoPtrQuery
- func (q *ParentNoPtrQuery) WithChildren(cond kallax.Condition) *ParentNoPtrQuery
- type ParentNoPtrResultSet
- func (rs *ParentNoPtrResultSet) All() ([]*ParentNoPtr, error)
- func (rs *ParentNoPtrResultSet) Close() error
- func (rs *ParentNoPtrResultSet) Err() error
- func (rs *ParentNoPtrResultSet) ForEach(fn func(*ParentNoPtr) error) error
- func (rs *ParentNoPtrResultSet) Get() (*ParentNoPtr, error)
- func (rs *ParentNoPtrResultSet) Next() bool
- func (rs *ParentNoPtrResultSet) One() (*ParentNoPtr, error)
- type ParentNoPtrStore
- func (s *ParentNoPtrStore) Count(q *ParentNoPtrQuery) (int64, error)
- func (s *ParentNoPtrStore) Debug() *ParentNoPtrStore
- func (s *ParentNoPtrStore) DebugWith(logger kallax.LoggerFunc) *ParentNoPtrStore
- func (s *ParentNoPtrStore) Delete(record *ParentNoPtr) error
- func (s *ParentNoPtrStore) DisableCacher() *ParentNoPtrStore
- func (s *ParentNoPtrStore) Find(q *ParentNoPtrQuery) (*ParentNoPtrResultSet, error)
- func (s *ParentNoPtrStore) FindAll(q *ParentNoPtrQuery) ([]*ParentNoPtr, error)
- func (s *ParentNoPtrStore) FindOne(q *ParentNoPtrQuery) (*ParentNoPtr, error)
- func (s *ParentNoPtrStore) GenericStore() *kallax.Store
- func (s *ParentNoPtrStore) Insert(record *ParentNoPtr) error
- func (s *ParentNoPtrStore) MustCount(q *ParentNoPtrQuery) int64
- func (s *ParentNoPtrStore) MustFind(q *ParentNoPtrQuery) *ParentNoPtrResultSet
- func (s *ParentNoPtrStore) MustFindOne(q *ParentNoPtrQuery) *ParentNoPtr
- func (s *ParentNoPtrStore) Reload(record *ParentNoPtr) error
- func (s *ParentNoPtrStore) RemoveChildren(record *ParentNoPtr, deleted ...Child) error
- func (s *ParentNoPtrStore) Save(record *ParentNoPtr) (updated bool, err error)
- func (s *ParentNoPtrStore) SetGenericStore(store *kallax.Store)
- func (s *ParentNoPtrStore) Transaction(callback func(*ParentNoPtrStore) error) error
- func (s *ParentNoPtrStore) Update(record *ParentNoPtr, cols ...kallax.SchemaField) (updated int64, err error)
- type ParentQuery
- func (q *ParentQuery) BatchSize(size uint64) *ParentQuery
- func (q *ParentQuery) Copy() *ParentQuery
- func (q *ParentQuery) FindByID(v ...int64) *ParentQuery
- func (q *ParentQuery) FindByName(v string) *ParentQuery
- func (q *ParentQuery) Limit(n uint64) *ParentQuery
- func (q *ParentQuery) Offset(n uint64) *ParentQuery
- func (q *ParentQuery) Order(cols ...kallax.ColumnOrder) *ParentQuery
- func (q *ParentQuery) Select(columns ...kallax.SchemaField) *ParentQuery
- func (q *ParentQuery) SelectNot(columns ...kallax.SchemaField) *ParentQuery
- func (q *ParentQuery) Where(cond kallax.Condition) *ParentQuery
- func (q *ParentQuery) WithChildren(cond kallax.Condition) *ParentQuery
- type ParentResultSet
- func (rs *ParentResultSet) All() ([]*Parent, error)
- func (rs *ParentResultSet) Close() error
- func (rs *ParentResultSet) Err() error
- func (rs *ParentResultSet) ForEach(fn func(*Parent) error) error
- func (rs *ParentResultSet) Get() (*Parent, error)
- func (rs *ParentResultSet) Next() bool
- func (rs *ParentResultSet) One() (*Parent, error)
- type ParentStore
- func (s *ParentStore) Count(q *ParentQuery) (int64, error)
- func (s *ParentStore) Debug() *ParentStore
- func (s *ParentStore) DebugWith(logger kallax.LoggerFunc) *ParentStore
- func (s *ParentStore) Delete(record *Parent) error
- func (s *ParentStore) DisableCacher() *ParentStore
- func (s *ParentStore) Find(q *ParentQuery) (*ParentResultSet, error)
- func (s *ParentStore) FindAll(q *ParentQuery) ([]*Parent, error)
- func (s *ParentStore) FindOne(q *ParentQuery) (*Parent, error)
- func (s *ParentStore) GenericStore() *kallax.Store
- func (s *ParentStore) Insert(record *Parent) error
- func (s *ParentStore) MustCount(q *ParentQuery) int64
- func (s *ParentStore) MustFind(q *ParentQuery) *ParentResultSet
- func (s *ParentStore) MustFindOne(q *ParentQuery) *Parent
- func (s *ParentStore) Reload(record *Parent) error
- func (s *ParentStore) RemoveChildren(record *Parent, deleted ...*Child) error
- func (s *ParentStore) Save(record *Parent) (updated bool, err error)
- func (s *ParentStore) SetGenericStore(store *kallax.Store)
- func (s *ParentStore) Transaction(callback func(*ParentStore) error) error
- func (s *ParentStore) Update(record *Parent, cols ...kallax.SchemaField) (updated int64, err error)
- type Person
- func (c *Person) AfterDelete() error
- func (c *Person) AfterSave() error
- func (c *Person) BeforeDelete() error
- func (c *Person) BeforeSave() error
- func (r *Person) ColumnAddress(col string) (interface{}, error)
- func (r *Person) GetID() kallax.Identifier
- func (r *Person) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Person) SetRelationship(field string, rel interface{}) error
- func (r *Person) Value(col string) (interface{}, error)
- type PersonQuery
- func (q *PersonQuery) BatchSize(size uint64) *PersonQuery
- func (q *PersonQuery) Copy() *PersonQuery
- func (q *PersonQuery) FindByID(v ...int64) *PersonQuery
- func (q *PersonQuery) FindByName(v string) *PersonQuery
- func (q *PersonQuery) Limit(n uint64) *PersonQuery
- func (q *PersonQuery) Offset(n uint64) *PersonQuery
- func (q *PersonQuery) Order(cols ...kallax.ColumnOrder) *PersonQuery
- func (q *PersonQuery) Select(columns ...kallax.SchemaField) *PersonQuery
- func (q *PersonQuery) SelectNot(columns ...kallax.SchemaField) *PersonQuery
- func (q *PersonQuery) Where(cond kallax.Condition) *PersonQuery
- func (q *PersonQuery) WithCar() *PersonQuery
- func (q *PersonQuery) WithPets(cond kallax.Condition) *PersonQuery
- type PersonResultSet
- func (rs *PersonResultSet) All() ([]*Person, error)
- func (rs *PersonResultSet) Close() error
- func (rs *PersonResultSet) Err() error
- func (rs *PersonResultSet) ForEach(fn func(*Person) error) error
- func (rs *PersonResultSet) Get() (*Person, error)
- func (rs *PersonResultSet) Next() bool
- func (rs *PersonResultSet) One() (*Person, error)
- type PersonStore
- func (s *PersonStore) Count(q *PersonQuery) (int64, error)
- func (s *PersonStore) Debug() *PersonStore
- func (s *PersonStore) DebugWith(logger kallax.LoggerFunc) *PersonStore
- func (s *PersonStore) Delete(record *Person) error
- func (s *PersonStore) DisableCacher() *PersonStore
- func (s *PersonStore) Find(q *PersonQuery) (*PersonResultSet, error)
- func (s *PersonStore) FindAll(q *PersonQuery) ([]*Person, error)
- func (s *PersonStore) FindOne(q *PersonQuery) (*Person, error)
- func (s *PersonStore) GenericStore() *kallax.Store
- func (s *PersonStore) Insert(record *Person) error
- func (s *PersonStore) MustCount(q *PersonQuery) int64
- func (s *PersonStore) MustFind(q *PersonQuery) *PersonResultSet
- func (s *PersonStore) MustFindOne(q *PersonQuery) *Person
- func (s *PersonStore) Reload(record *Person) error
- func (s *PersonStore) RemoveCar(record *Person) error
- func (s *PersonStore) RemovePets(record *Person, deleted ...*Pet) error
- func (s *PersonStore) Save(record *Person) (updated bool, err error)
- func (s *PersonStore) SetGenericStore(store *kallax.Store)
- func (s *PersonStore) Transaction(callback func(*PersonStore) error) error
- func (s *PersonStore) Update(record *Person, cols ...kallax.SchemaField) (updated int64, err error)
- type Pet
- func (c *Pet) AfterDelete() error
- func (c *Pet) AfterSave() error
- func (c *Pet) BeforeDelete() error
- func (c *Pet) BeforeSave() error
- func (r *Pet) ColumnAddress(col string) (interface{}, error)
- func (r *Pet) GetID() kallax.Identifier
- func (r *Pet) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *Pet) SetRelationship(field string, rel interface{}) error
- func (r *Pet) Value(col string) (interface{}, error)
- type PetQuery
- func (q *PetQuery) BatchSize(size uint64) *PetQuery
- func (q *PetQuery) Copy() *PetQuery
- func (q *PetQuery) FindByID(v ...kallax.ULID) *PetQuery
- func (q *PetQuery) FindByKind(v string) *PetQuery
- func (q *PetQuery) FindByName(v string) *PetQuery
- func (q *PetQuery) FindByOwner(v int64) *PetQuery
- func (q *PetQuery) Limit(n uint64) *PetQuery
- func (q *PetQuery) Offset(n uint64) *PetQuery
- func (q *PetQuery) Order(cols ...kallax.ColumnOrder) *PetQuery
- func (q *PetQuery) Select(columns ...kallax.SchemaField) *PetQuery
- func (q *PetQuery) SelectNot(columns ...kallax.SchemaField) *PetQuery
- func (q *PetQuery) Where(cond kallax.Condition) *PetQuery
- func (q *PetQuery) WithOwner() *PetQuery
- type PetResultSet
- func (rs *PetResultSet) All() ([]*Pet, error)
- func (rs *PetResultSet) Close() error
- func (rs *PetResultSet) Err() error
- func (rs *PetResultSet) ForEach(fn func(*Pet) error) error
- func (rs *PetResultSet) Get() (*Pet, error)
- func (rs *PetResultSet) Next() bool
- func (rs *PetResultSet) One() (*Pet, error)
- type PetStore
- func (s *PetStore) Count(q *PetQuery) (int64, error)
- func (s *PetStore) Debug() *PetStore
- func (s *PetStore) DebugWith(logger kallax.LoggerFunc) *PetStore
- func (s *PetStore) Delete(record *Pet) error
- func (s *PetStore) DisableCacher() *PetStore
- func (s *PetStore) Find(q *PetQuery) (*PetResultSet, error)
- func (s *PetStore) FindAll(q *PetQuery) ([]*Pet, error)
- func (s *PetStore) FindOne(q *PetQuery) (*Pet, error)
- func (s *PetStore) GenericStore() *kallax.Store
- func (s *PetStore) Insert(record *Pet) error
- func (s *PetStore) MustCount(q *PetQuery) int64
- func (s *PetStore) MustFind(q *PetQuery) *PetResultSet
- func (s *PetStore) MustFindOne(q *PetQuery) *Pet
- func (s *PetStore) Reload(record *Pet) error
- func (s *PetStore) Save(record *Pet) (updated bool, err error)
- func (s *PetStore) SetGenericStore(store *kallax.Store)
- func (s *PetStore) Transaction(callback func(*PetStore) error) error
- func (s *PetStore) Update(record *Pet, cols ...kallax.SchemaField) (updated int64, err error)
- type QueryFixture
- func (r *QueryFixture) ColumnAddress(col string) (interface{}, error)
- func (q *QueryFixture) Eq(v *QueryFixture) bool
- func (r *QueryFixture) GetID() kallax.Identifier
- func (r *QueryFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *QueryFixture) SetRelationship(field string, rel interface{}) error
- func (r *QueryFixture) Value(col string) (interface{}, error)
- type QueryFixtureQuery
- func (q *QueryFixtureQuery) BatchSize(size uint64) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Copy() *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasArrAliasStringParam(v ...fixtures.AliasString) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasArrayParam(v ...string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasHereArrayParam(v ...string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasIntParam(cond kallax.ScalarCond, v fixtures.AliasInt) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasSliceParam(v ...string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByAliasStringParam(v fixtures.AliasString) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByArrayAliasHereStringParam(v ...AliasHereString) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByArrayParam(v ...string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByBoolean(v bool) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByFloat32(cond kallax.ScalarCond, v float32) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByFoo(v string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByID(v ...kallax.ULID) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByIDPropertyParam(v kallax.ULID) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByInline(v string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByInteger(cond kallax.ScalarCond, v int) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByInteger64(cond kallax.ScalarCond, v int64) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByInterfacePropParam(v fixtures.InterfaceImplementation) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByInverse(v kallax.ULID) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByScannerValuerParam(v ScannerValuer) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindBySliceParam(v ...string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByStringProperty(v string) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByTimeParam(cond kallax.ScalarCond, v time.Time) *QueryFixtureQuery
- func (q *QueryFixtureQuery) FindByURLParam(v url.URL) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Limit(n uint64) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Offset(n uint64) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Order(cols ...kallax.ColumnOrder) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Select(columns ...kallax.SchemaField) *QueryFixtureQuery
- func (q *QueryFixtureQuery) SelectNot(columns ...kallax.SchemaField) *QueryFixtureQuery
- func (q *QueryFixtureQuery) Where(cond kallax.Condition) *QueryFixtureQuery
- func (q *QueryFixtureQuery) WithInverse() *QueryFixtureQuery
- func (q *QueryFixtureQuery) WithNRelation(cond kallax.Condition) *QueryFixtureQuery
- func (q *QueryFixtureQuery) WithRelation() *QueryFixtureQuery
- type QueryFixtureResultSet
- func (rs *QueryFixtureResultSet) All() ([]*QueryFixture, error)
- func (rs *QueryFixtureResultSet) Close() error
- func (rs *QueryFixtureResultSet) Err() error
- func (rs *QueryFixtureResultSet) ForEach(fn func(*QueryFixture) error) error
- func (rs *QueryFixtureResultSet) Get() (*QueryFixture, error)
- func (rs *QueryFixtureResultSet) Next() bool
- func (rs *QueryFixtureResultSet) One() (*QueryFixture, error)
- type QueryFixtureStore
- func (s *QueryFixtureStore) Count(q *QueryFixtureQuery) (int64, error)
- func (s *QueryFixtureStore) Debug() *QueryFixtureStore
- func (s *QueryFixtureStore) DebugWith(logger kallax.LoggerFunc) *QueryFixtureStore
- func (s *QueryFixtureStore) Delete(record *QueryFixture) error
- func (s *QueryFixtureStore) DisableCacher() *QueryFixtureStore
- func (s *QueryFixtureStore) Find(q *QueryFixtureQuery) (*QueryFixtureResultSet, error)
- func (s *QueryFixtureStore) FindAll(q *QueryFixtureQuery) ([]*QueryFixture, error)
- func (s *QueryFixtureStore) FindOne(q *QueryFixtureQuery) (*QueryFixture, error)
- func (s *QueryFixtureStore) GenericStore() *kallax.Store
- func (s *QueryFixtureStore) Insert(record *QueryFixture) error
- func (s *QueryFixtureStore) MustCount(q *QueryFixtureQuery) int64
- func (s *QueryFixtureStore) MustFind(q *QueryFixtureQuery) *QueryFixtureResultSet
- func (s *QueryFixtureStore) MustFindOne(q *QueryFixtureQuery) *QueryFixture
- func (s *QueryFixtureStore) Reload(record *QueryFixture) error
- func (s *QueryFixtureStore) RemoveNRelation(record *QueryFixture, deleted ...*QueryRelationFixture) error
- func (s *QueryFixtureStore) RemoveRelation(record *QueryFixture) error
- func (s *QueryFixtureStore) Save(record *QueryFixture) (updated bool, err error)
- func (s *QueryFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *QueryFixtureStore) Transaction(callback func(*QueryFixtureStore) error) error
- func (s *QueryFixtureStore) Update(record *QueryFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type QueryRelationFixture
- func (r *QueryRelationFixture) ColumnAddress(col string) (interface{}, error)
- func (r *QueryRelationFixture) GetID() kallax.Identifier
- func (r *QueryRelationFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *QueryRelationFixture) SetRelationship(field string, rel interface{}) error
- func (r *QueryRelationFixture) Value(col string) (interface{}, error)
- type QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) BatchSize(size uint64) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Copy() *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) FindByID(v ...kallax.ULID) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) FindByName(v string) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) FindByOwner(v kallax.ULID) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Limit(n uint64) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Offset(n uint64) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Order(cols ...kallax.ColumnOrder) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Select(columns ...kallax.SchemaField) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) SelectNot(columns ...kallax.SchemaField) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) Where(cond kallax.Condition) *QueryRelationFixtureQuery
- func (q *QueryRelationFixtureQuery) WithOwner() *QueryRelationFixtureQuery
- type QueryRelationFixtureResultSet
- func (rs *QueryRelationFixtureResultSet) All() ([]*QueryRelationFixture, error)
- func (rs *QueryRelationFixtureResultSet) Close() error
- func (rs *QueryRelationFixtureResultSet) Err() error
- func (rs *QueryRelationFixtureResultSet) ForEach(fn func(*QueryRelationFixture) error) error
- func (rs *QueryRelationFixtureResultSet) Get() (*QueryRelationFixture, error)
- func (rs *QueryRelationFixtureResultSet) Next() bool
- func (rs *QueryRelationFixtureResultSet) One() (*QueryRelationFixture, error)
- type QueryRelationFixtureStore
- func (s *QueryRelationFixtureStore) Count(q *QueryRelationFixtureQuery) (int64, error)
- func (s *QueryRelationFixtureStore) Debug() *QueryRelationFixtureStore
- func (s *QueryRelationFixtureStore) DebugWith(logger kallax.LoggerFunc) *QueryRelationFixtureStore
- func (s *QueryRelationFixtureStore) Delete(record *QueryRelationFixture) error
- func (s *QueryRelationFixtureStore) DisableCacher() *QueryRelationFixtureStore
- func (s *QueryRelationFixtureStore) Find(q *QueryRelationFixtureQuery) (*QueryRelationFixtureResultSet, error)
- func (s *QueryRelationFixtureStore) FindAll(q *QueryRelationFixtureQuery) ([]*QueryRelationFixture, error)
- func (s *QueryRelationFixtureStore) FindOne(q *QueryRelationFixtureQuery) (*QueryRelationFixture, error)
- func (s *QueryRelationFixtureStore) GenericStore() *kallax.Store
- func (s *QueryRelationFixtureStore) Insert(record *QueryRelationFixture) error
- func (s *QueryRelationFixtureStore) MustCount(q *QueryRelationFixtureQuery) int64
- func (s *QueryRelationFixtureStore) MustFind(q *QueryRelationFixtureQuery) *QueryRelationFixtureResultSet
- func (s *QueryRelationFixtureStore) MustFindOne(q *QueryRelationFixtureQuery) *QueryRelationFixture
- func (s *QueryRelationFixtureStore) Reload(record *QueryRelationFixture) error
- func (s *QueryRelationFixtureStore) Save(record *QueryRelationFixture) (updated bool, err error)
- func (s *QueryRelationFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *QueryRelationFixtureStore) Transaction(callback func(*QueryRelationFixtureStore) error) error
- func (s *QueryRelationFixtureStore) Update(record *QueryRelationFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type Qux
- type ResultSetFixture
- func (r *ResultSetFixture) ColumnAddress(col string) (interface{}, error)
- func (r *ResultSetFixture) GetID() kallax.Identifier
- func (r *ResultSetFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *ResultSetFixture) SetRelationship(field string, rel interface{}) error
- func (r *ResultSetFixture) Value(col string) (interface{}, error)
- type ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) BatchSize(size uint64) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Copy() *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) FindByFoo(v string) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) FindByID(v ...kallax.ULID) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Limit(n uint64) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Offset(n uint64) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Order(cols ...kallax.ColumnOrder) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Select(columns ...kallax.SchemaField) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) SelectNot(columns ...kallax.SchemaField) *ResultSetFixtureQuery
- func (q *ResultSetFixtureQuery) Where(cond kallax.Condition) *ResultSetFixtureQuery
- type ResultSetFixtureResultSet
- func (rs *ResultSetFixtureResultSet) All() ([]*ResultSetFixture, error)
- func (rs *ResultSetFixtureResultSet) Close() error
- func (rs *ResultSetFixtureResultSet) Err() error
- func (rs *ResultSetFixtureResultSet) ForEach(fn func(*ResultSetFixture) error) error
- func (rs *ResultSetFixtureResultSet) Get() (*ResultSetFixture, error)
- func (rs *ResultSetFixtureResultSet) Next() bool
- func (rs *ResultSetFixtureResultSet) One() (*ResultSetFixture, error)
- type ResultSetFixtureStore
- func (s *ResultSetFixtureStore) Count(q *ResultSetFixtureQuery) (int64, error)
- func (s *ResultSetFixtureStore) Debug() *ResultSetFixtureStore
- func (s *ResultSetFixtureStore) DebugWith(logger kallax.LoggerFunc) *ResultSetFixtureStore
- func (s *ResultSetFixtureStore) Delete(record *ResultSetFixture) error
- func (s *ResultSetFixtureStore) DisableCacher() *ResultSetFixtureStore
- func (s *ResultSetFixtureStore) Find(q *ResultSetFixtureQuery) (*ResultSetFixtureResultSet, error)
- func (s *ResultSetFixtureStore) FindAll(q *ResultSetFixtureQuery) ([]*ResultSetFixture, error)
- func (s *ResultSetFixtureStore) FindOne(q *ResultSetFixtureQuery) (*ResultSetFixture, error)
- func (s *ResultSetFixtureStore) GenericStore() *kallax.Store
- func (s *ResultSetFixtureStore) Insert(record *ResultSetFixture) error
- func (s *ResultSetFixtureStore) MustCount(q *ResultSetFixtureQuery) int64
- func (s *ResultSetFixtureStore) MustFind(q *ResultSetFixtureQuery) *ResultSetFixtureResultSet
- func (s *ResultSetFixtureStore) MustFindOne(q *ResultSetFixtureQuery) *ResultSetFixture
- func (s *ResultSetFixtureStore) Reload(record *ResultSetFixture) error
- func (s *ResultSetFixtureStore) Save(record *ResultSetFixture) (updated bool, err error)
- func (s *ResultSetFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *ResultSetFixtureStore) Transaction(callback func(*ResultSetFixtureStore) error) error
- func (s *ResultSetFixtureStore) Update(record *ResultSetFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type ScannerValuer
- type SchemaFixture
- func (r *SchemaFixture) ColumnAddress(col string) (interface{}, error)
- func (r *SchemaFixture) GetID() kallax.Identifier
- func (r *SchemaFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *SchemaFixture) SetRelationship(field string, rel interface{}) error
- func (r *SchemaFixture) Value(col string) (interface{}, error)
- type SchemaFixtureQuery
- func (q *SchemaFixtureQuery) BatchSize(size uint64) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Copy() *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) FindByID(v ...kallax.ULID) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) FindByInline(v string) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) FindByInt(cond kallax.ScalarCond, v int) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) FindByInverse(v kallax.ULID) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) FindByString(v string) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Limit(n uint64) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Offset(n uint64) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Order(cols ...kallax.ColumnOrder) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Select(columns ...kallax.SchemaField) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) SelectNot(columns ...kallax.SchemaField) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) Where(cond kallax.Condition) *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) WithInverse() *SchemaFixtureQuery
- func (q *SchemaFixtureQuery) WithNested() *SchemaFixtureQuery
- type SchemaFixtureResultSet
- func (rs *SchemaFixtureResultSet) All() ([]*SchemaFixture, error)
- func (rs *SchemaFixtureResultSet) Close() error
- func (rs *SchemaFixtureResultSet) Err() error
- func (rs *SchemaFixtureResultSet) ForEach(fn func(*SchemaFixture) error) error
- func (rs *SchemaFixtureResultSet) Get() (*SchemaFixture, error)
- func (rs *SchemaFixtureResultSet) Next() bool
- func (rs *SchemaFixtureResultSet) One() (*SchemaFixture, error)
- type SchemaFixtureStore
- func (s *SchemaFixtureStore) Count(q *SchemaFixtureQuery) (int64, error)
- func (s *SchemaFixtureStore) Debug() *SchemaFixtureStore
- func (s *SchemaFixtureStore) DebugWith(logger kallax.LoggerFunc) *SchemaFixtureStore
- func (s *SchemaFixtureStore) Delete(record *SchemaFixture) error
- func (s *SchemaFixtureStore) DisableCacher() *SchemaFixtureStore
- func (s *SchemaFixtureStore) Find(q *SchemaFixtureQuery) (*SchemaFixtureResultSet, error)
- func (s *SchemaFixtureStore) FindAll(q *SchemaFixtureQuery) ([]*SchemaFixture, error)
- func (s *SchemaFixtureStore) FindOne(q *SchemaFixtureQuery) (*SchemaFixture, error)
- func (s *SchemaFixtureStore) GenericStore() *kallax.Store
- func (s *SchemaFixtureStore) Insert(record *SchemaFixture) error
- func (s *SchemaFixtureStore) MustCount(q *SchemaFixtureQuery) int64
- func (s *SchemaFixtureStore) MustFind(q *SchemaFixtureQuery) *SchemaFixtureResultSet
- func (s *SchemaFixtureStore) MustFindOne(q *SchemaFixtureQuery) *SchemaFixture
- func (s *SchemaFixtureStore) Reload(record *SchemaFixture) error
- func (s *SchemaFixtureStore) RemoveNested(record *SchemaFixture) error
- func (s *SchemaFixtureStore) Save(record *SchemaFixture) (updated bool, err error)
- func (s *SchemaFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *SchemaFixtureStore) Transaction(callback func(*SchemaFixtureStore) error) error
- func (s *SchemaFixtureStore) Update(record *SchemaFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type SchemaRelationshipFixture
- func (r *SchemaRelationshipFixture) ColumnAddress(col string) (interface{}, error)
- func (r *SchemaRelationshipFixture) GetID() kallax.Identifier
- func (r *SchemaRelationshipFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *SchemaRelationshipFixture) SetRelationship(field string, rel interface{}) error
- func (r *SchemaRelationshipFixture) Value(col string) (interface{}, error)
- type SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) BatchSize(size uint64) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Copy() *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) FindByID(v ...kallax.ULID) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Limit(n uint64) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Offset(n uint64) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Order(cols ...kallax.ColumnOrder) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Select(columns ...kallax.SchemaField) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) SelectNot(columns ...kallax.SchemaField) *SchemaRelationshipFixtureQuery
- func (q *SchemaRelationshipFixtureQuery) Where(cond kallax.Condition) *SchemaRelationshipFixtureQuery
- type SchemaRelationshipFixtureResultSet
- func (rs *SchemaRelationshipFixtureResultSet) All() ([]*SchemaRelationshipFixture, error)
- func (rs *SchemaRelationshipFixtureResultSet) Close() error
- func (rs *SchemaRelationshipFixtureResultSet) Err() error
- func (rs *SchemaRelationshipFixtureResultSet) ForEach(fn func(*SchemaRelationshipFixture) error) error
- func (rs *SchemaRelationshipFixtureResultSet) Get() (*SchemaRelationshipFixture, error)
- func (rs *SchemaRelationshipFixtureResultSet) Next() bool
- func (rs *SchemaRelationshipFixtureResultSet) One() (*SchemaRelationshipFixture, error)
- type SchemaRelationshipFixtureStore
- func (s *SchemaRelationshipFixtureStore) Count(q *SchemaRelationshipFixtureQuery) (int64, error)
- func (s *SchemaRelationshipFixtureStore) Debug() *SchemaRelationshipFixtureStore
- func (s *SchemaRelationshipFixtureStore) DebugWith(logger kallax.LoggerFunc) *SchemaRelationshipFixtureStore
- func (s *SchemaRelationshipFixtureStore) Delete(record *SchemaRelationshipFixture) error
- func (s *SchemaRelationshipFixtureStore) DisableCacher() *SchemaRelationshipFixtureStore
- func (s *SchemaRelationshipFixtureStore) Find(q *SchemaRelationshipFixtureQuery) (*SchemaRelationshipFixtureResultSet, error)
- func (s *SchemaRelationshipFixtureStore) FindAll(q *SchemaRelationshipFixtureQuery) ([]*SchemaRelationshipFixture, error)
- func (s *SchemaRelationshipFixtureStore) FindOne(q *SchemaRelationshipFixtureQuery) (*SchemaRelationshipFixture, error)
- func (s *SchemaRelationshipFixtureStore) GenericStore() *kallax.Store
- func (s *SchemaRelationshipFixtureStore) Insert(record *SchemaRelationshipFixture) error
- func (s *SchemaRelationshipFixtureStore) MustCount(q *SchemaRelationshipFixtureQuery) int64
- func (s *SchemaRelationshipFixtureStore) MustFind(q *SchemaRelationshipFixtureQuery) *SchemaRelationshipFixtureResultSet
- func (s *SchemaRelationshipFixtureStore) MustFindOne(q *SchemaRelationshipFixtureQuery) *SchemaRelationshipFixture
- func (s *SchemaRelationshipFixtureStore) Reload(record *SchemaRelationshipFixture) error
- func (s *SchemaRelationshipFixtureStore) Save(record *SchemaRelationshipFixture) (updated bool, err error)
- func (s *SchemaRelationshipFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *SchemaRelationshipFixtureStore) Transaction(callback func(*SchemaRelationshipFixtureStore) error) error
- func (s *SchemaRelationshipFixtureStore) Update(record *SchemaRelationshipFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type SomeJSON
- type StoreFixture
- func (r *StoreFixture) ColumnAddress(col string) (interface{}, error)
- func (r *StoreFixture) GetID() kallax.Identifier
- func (r *StoreFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *StoreFixture) SetRelationship(field string, rel interface{}) error
- func (r *StoreFixture) Value(col string) (interface{}, error)
- type StoreFixtureQuery
- func (q *StoreFixtureQuery) BatchSize(size uint64) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Copy() *StoreFixtureQuery
- func (q *StoreFixtureQuery) FindByAliasSliceProp(v ...string) *StoreFixtureQuery
- func (q *StoreFixtureQuery) FindByFoo(v string) *StoreFixtureQuery
- func (q *StoreFixtureQuery) FindByID(v ...kallax.ULID) *StoreFixtureQuery
- func (q *StoreFixtureQuery) FindBySliceProp(v ...string) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Limit(n uint64) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Offset(n uint64) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Select(columns ...kallax.SchemaField) *StoreFixtureQuery
- func (q *StoreFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreFixtureQuery
- func (q *StoreFixtureQuery) Where(cond kallax.Condition) *StoreFixtureQuery
- type StoreFixtureResultSet
- func (rs *StoreFixtureResultSet) All() ([]*StoreFixture, error)
- func (rs *StoreFixtureResultSet) Close() error
- func (rs *StoreFixtureResultSet) Err() error
- func (rs *StoreFixtureResultSet) ForEach(fn func(*StoreFixture) error) error
- func (rs *StoreFixtureResultSet) Get() (*StoreFixture, error)
- func (rs *StoreFixtureResultSet) Next() bool
- func (rs *StoreFixtureResultSet) One() (*StoreFixture, error)
- type StoreFixtureStore
- func (s *StoreFixtureStore) Count(q *StoreFixtureQuery) (int64, error)
- func (s *StoreFixtureStore) Debug() *StoreFixtureStore
- func (s *StoreFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreFixtureStore
- func (s *StoreFixtureStore) Delete(record *StoreFixture) error
- func (s *StoreFixtureStore) DisableCacher() *StoreFixtureStore
- func (s *StoreFixtureStore) Find(q *StoreFixtureQuery) (*StoreFixtureResultSet, error)
- func (s *StoreFixtureStore) FindAll(q *StoreFixtureQuery) ([]*StoreFixture, error)
- func (s *StoreFixtureStore) FindOne(q *StoreFixtureQuery) (*StoreFixture, error)
- func (s *StoreFixtureStore) GenericStore() *kallax.Store
- func (s *StoreFixtureStore) Insert(record *StoreFixture) error
- func (s *StoreFixtureStore) MustCount(q *StoreFixtureQuery) int64
- func (s *StoreFixtureStore) MustFind(q *StoreFixtureQuery) *StoreFixtureResultSet
- func (s *StoreFixtureStore) MustFindOne(q *StoreFixtureQuery) *StoreFixture
- func (s *StoreFixtureStore) Reload(record *StoreFixture) error
- func (s *StoreFixtureStore) Save(record *StoreFixture) (updated bool, err error)
- func (s *StoreFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *StoreFixtureStore) Transaction(callback func(*StoreFixtureStore) error) error
- func (s *StoreFixtureStore) Update(record *StoreFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type StoreWithConstructFixture
- func (r *StoreWithConstructFixture) ColumnAddress(col string) (interface{}, error)
- func (r *StoreWithConstructFixture) GetID() kallax.Identifier
- func (r *StoreWithConstructFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *StoreWithConstructFixture) SetRelationship(field string, rel interface{}) error
- func (r *StoreWithConstructFixture) Value(col string) (interface{}, error)
- type StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) BatchSize(size uint64) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Copy() *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) FindByFoo(v string) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) FindByID(v ...kallax.ULID) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Limit(n uint64) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Offset(n uint64) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Select(columns ...kallax.SchemaField) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreWithConstructFixtureQuery
- func (q *StoreWithConstructFixtureQuery) Where(cond kallax.Condition) *StoreWithConstructFixtureQuery
- type StoreWithConstructFixtureResultSet
- func (rs *StoreWithConstructFixtureResultSet) All() ([]*StoreWithConstructFixture, error)
- func (rs *StoreWithConstructFixtureResultSet) Close() error
- func (rs *StoreWithConstructFixtureResultSet) Err() error
- func (rs *StoreWithConstructFixtureResultSet) ForEach(fn func(*StoreWithConstructFixture) error) error
- func (rs *StoreWithConstructFixtureResultSet) Get() (*StoreWithConstructFixture, error)
- func (rs *StoreWithConstructFixtureResultSet) Next() bool
- func (rs *StoreWithConstructFixtureResultSet) One() (*StoreWithConstructFixture, error)
- type StoreWithConstructFixtureStore
- func (s *StoreWithConstructFixtureStore) Count(q *StoreWithConstructFixtureQuery) (int64, error)
- func (s *StoreWithConstructFixtureStore) Debug() *StoreWithConstructFixtureStore
- func (s *StoreWithConstructFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreWithConstructFixtureStore
- func (s *StoreWithConstructFixtureStore) Delete(record *StoreWithConstructFixture) error
- func (s *StoreWithConstructFixtureStore) DisableCacher() *StoreWithConstructFixtureStore
- func (s *StoreWithConstructFixtureStore) Find(q *StoreWithConstructFixtureQuery) (*StoreWithConstructFixtureResultSet, error)
- func (s *StoreWithConstructFixtureStore) FindAll(q *StoreWithConstructFixtureQuery) ([]*StoreWithConstructFixture, error)
- func (s *StoreWithConstructFixtureStore) FindOne(q *StoreWithConstructFixtureQuery) (*StoreWithConstructFixture, error)
- func (s *StoreWithConstructFixtureStore) GenericStore() *kallax.Store
- func (s *StoreWithConstructFixtureStore) Insert(record *StoreWithConstructFixture) error
- func (s *StoreWithConstructFixtureStore) MustCount(q *StoreWithConstructFixtureQuery) int64
- func (s *StoreWithConstructFixtureStore) MustFind(q *StoreWithConstructFixtureQuery) *StoreWithConstructFixtureResultSet
- func (s *StoreWithConstructFixtureStore) MustFindOne(q *StoreWithConstructFixtureQuery) *StoreWithConstructFixture
- func (s *StoreWithConstructFixtureStore) Reload(record *StoreWithConstructFixture) error
- func (s *StoreWithConstructFixtureStore) Save(record *StoreWithConstructFixture) (updated bool, err error)
- func (s *StoreWithConstructFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *StoreWithConstructFixtureStore) Transaction(callback func(*StoreWithConstructFixtureStore) error) error
- func (s *StoreWithConstructFixtureStore) Update(record *StoreWithConstructFixture, cols ...kallax.SchemaField) (updated int64, err error)
- type StoreWithNewFixture
- func (r *StoreWithNewFixture) ColumnAddress(col string) (interface{}, error)
- func (r *StoreWithNewFixture) GetID() kallax.Identifier
- func (r *StoreWithNewFixture) NewRelationshipRecord(field string) (kallax.Record, error)
- func (r *StoreWithNewFixture) SetRelationship(field string, rel interface{}) error
- func (r *StoreWithNewFixture) Value(col string) (interface{}, error)
- type StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) BatchSize(size uint64) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Copy() *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) FindByBar(v string) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) FindByFoo(v string) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) FindByID(v ...kallax.ULID) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Limit(n uint64) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Offset(n uint64) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Select(columns ...kallax.SchemaField) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreWithNewFixtureQuery
- func (q *StoreWithNewFixtureQuery) Where(cond kallax.Condition) *StoreWithNewFixtureQuery
- type StoreWithNewFixtureResultSet
- func (rs *StoreWithNewFixtureResultSet) All() ([]*StoreWithNewFixture, error)
- func (rs *StoreWithNewFixtureResultSet) Close() error
- func (rs *StoreWithNewFixtureResultSet) Err() error
- func (rs *StoreWithNewFixtureResultSet) ForEach(fn func(*StoreWithNewFixture) error) error
- func (rs *StoreWithNewFixtureResultSet) Get() (*StoreWithNewFixture, error)
- func (rs *StoreWithNewFixtureResultSet) Next() bool
- func (rs *StoreWithNewFixtureResultSet) One() (*StoreWithNewFixture, error)
- type StoreWithNewFixtureStore
- func (s *StoreWithNewFixtureStore) Count(q *StoreWithNewFixtureQuery) (int64, error)
- func (s *StoreWithNewFixtureStore) Debug() *StoreWithNewFixtureStore
- func (s *StoreWithNewFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreWithNewFixtureStore
- func (s *StoreWithNewFixtureStore) Delete(record *StoreWithNewFixture) error
- func (s *StoreWithNewFixtureStore) DisableCacher() *StoreWithNewFixtureStore
- func (s *StoreWithNewFixtureStore) Find(q *StoreWithNewFixtureQuery) (*StoreWithNewFixtureResultSet, error)
- func (s *StoreWithNewFixtureStore) FindAll(q *StoreWithNewFixtureQuery) ([]*StoreWithNewFixture, error)
- func (s *StoreWithNewFixtureStore) FindOne(q *StoreWithNewFixtureQuery) (*StoreWithNewFixture, error)
- func (s *StoreWithNewFixtureStore) GenericStore() *kallax.Store
- func (s *StoreWithNewFixtureStore) Insert(record *StoreWithNewFixture) error
- func (s *StoreWithNewFixtureStore) MustCount(q *StoreWithNewFixtureQuery) int64
- func (s *StoreWithNewFixtureStore) MustFind(q *StoreWithNewFixtureQuery) *StoreWithNewFixtureResultSet
- func (s *StoreWithNewFixtureStore) MustFindOne(q *StoreWithNewFixtureQuery) *StoreWithNewFixture
- func (s *StoreWithNewFixtureStore) Reload(record *StoreWithNewFixture) error
- func (s *StoreWithNewFixtureStore) Save(record *StoreWithNewFixture) (updated bool, err error)
- func (s *StoreWithNewFixtureStore) SetGenericStore(store *kallax.Store)
- func (s *StoreWithNewFixtureStore) Transaction(callback func(*StoreWithNewFixtureStore) error) error
- func (s *StoreWithNewFixtureStore) Update(record *StoreWithNewFixture, cols ...kallax.SchemaField) (updated int64, err error)
Constants ¶
This section is empty.
Variables ¶
var Schema = &schema{ A: &schemaA{ BaseSchema: kallax.NewBaseSchema( "a", "__a", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "B": kallax.NewForeignKey("a_id", false), }, func() kallax.Record { return new(A) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, B: &schemaB{ BaseSchema: kallax.NewBaseSchema( "b", "__b", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "A": kallax.NewForeignKey("a_id", true), "C": kallax.NewForeignKey("b_id", false), }, func() kallax.Record { return new(B) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("a_id"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), AFK: kallax.NewSchemaField("a_id"), }, Brand: &schemaBrand{ BaseSchema: kallax.NewBaseSchema( "brands", "__brand", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(Brand) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, C: &schemaC{ BaseSchema: kallax.NewBaseSchema( "c", "__c", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "B": kallax.NewForeignKey("b_id", true), }, func() kallax.Record { return new(C) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("b_id"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), BFK: kallax.NewSchemaField("b_id"), }, Car: &schemaCar{ BaseSchema: kallax.NewBaseSchema( "cars", "__car", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Owner": kallax.NewForeignKey("owner_id", true), "Brand": kallax.NewForeignKey("brand_id", true), }, func() kallax.Record { return new(Car) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("owner_id"), kallax.NewSchemaField("model_name"), kallax.NewSchemaField("brand_id"), ), ID: kallax.NewSchemaField("id"), OwnerFK: kallax.NewSchemaField("owner_id"), ModelName: kallax.NewSchemaField("model_name"), BrandFK: kallax.NewSchemaField("brand_id"), }, Child: &schemaChild{ BaseSchema: kallax.NewBaseSchema( "children", "__child", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(Child) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("parent_id"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, EventsAllFixture: &schemaEventsAllFixture{ BaseSchema: kallax.NewBaseSchema( "event", "__eventsallfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(EventsAllFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("checks"), kallax.NewSchemaField("must_fail_before"), kallax.NewSchemaField("must_fail_after"), ), ID: kallax.NewSchemaField("id"), Checks: kallax.NewSchemaField("checks"), MustFailBefore: kallax.NewSchemaField("must_fail_before"), MustFailAfter: kallax.NewSchemaField("must_fail_after"), }, EventsFixture: &schemaEventsFixture{ BaseSchema: kallax.NewBaseSchema( "event", "__eventsfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(EventsFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("checks"), kallax.NewSchemaField("must_fail_before"), kallax.NewSchemaField("must_fail_after"), ), ID: kallax.NewSchemaField("id"), Checks: kallax.NewSchemaField("checks"), MustFailBefore: kallax.NewSchemaField("must_fail_before"), MustFailAfter: kallax.NewSchemaField("must_fail_after"), }, EventsSaveFixture: &schemaEventsSaveFixture{ BaseSchema: kallax.NewBaseSchema( "event", "__eventssavefixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(EventsSaveFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("checks"), kallax.NewSchemaField("must_fail_before"), kallax.NewSchemaField("must_fail_after"), ), ID: kallax.NewSchemaField("id"), Checks: kallax.NewSchemaField("checks"), MustFailBefore: kallax.NewSchemaField("must_fail_before"), MustFailAfter: kallax.NewSchemaField("must_fail_after"), }, JSONModel: &schemaJSONModel{ BaseSchema: kallax.NewBaseSchema( "jsons", "__jsonmodel", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(JSONModel) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("foo"), kallax.NewSchemaField("bar"), kallax.NewSchemaField("baz_slice"), kallax.NewSchemaField("baz"), ), ID: kallax.NewSchemaField("id"), Foo: kallax.NewSchemaField("foo"), Bar: &schemaJSONModelBar{ BaseSchemaField: kallax.NewSchemaField("bar").(*kallax.BaseSchemaField), Qux: &schemaJSONModelBarQux{ JSONSchemaArray: kallax.NewJSONSchemaArray("bar", "Qux"), Schnooga: kallax.NewJSONSchemaKey(kallax.JSONText, "bar", "Qux", "Schnooga"), Balooga: kallax.NewJSONSchemaKey(kallax.JSONInt, "bar", "Qux", "Balooga"), Boo: kallax.NewJSONSchemaKey(kallax.JSONFloat, "bar", "Qux", "Boo"), }, Mux: kallax.NewJSONSchemaKey(kallax.JSONText, "bar", "Mux"), }, BazSlice: &schemaJSONModelBazSlice{ BaseSchemaField: kallax.NewSchemaField("baz_slice").(*kallax.BaseSchemaField), Mux: kallax.NewJSONSchemaKey(kallax.JSONText, "baz_slice", "Mux"), }, Baz: kallax.NewSchemaField("baz"), }, MultiKeySortFixture: &schemaMultiKeySortFixture{ BaseSchema: kallax.NewBaseSchema( "query", "__multikeysortfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(MultiKeySortFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("start"), kallax.NewSchemaField("_end"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), Start: kallax.NewSchemaField("start"), End: kallax.NewSchemaField("_end"), }, Nullable: &schemaNullable{ BaseSchema: kallax.NewBaseSchema( "nullable", "__nullable", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(Nullable) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("t"), kallax.NewSchemaField("some_json"), kallax.NewSchemaField("scanner"), ), ID: kallax.NewSchemaField("id"), T: kallax.NewSchemaField("t"), SomeJSON: &schemaNullableSomeJSON{ BaseSchemaField: kallax.NewSchemaField("some_json").(*kallax.BaseSchemaField), Foo: kallax.NewJSONSchemaKey(kallax.JSONInt, "some_json", "Foo"), }, Scanner: kallax.NewSchemaField("scanner"), }, Parent: &schemaParent{ BaseSchema: kallax.NewBaseSchema( "parents", "__parent", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Children": kallax.NewForeignKey("parent_id", false), }, func() kallax.Record { return new(Parent) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, ParentNoPtr: &schemaParentNoPtr{ BaseSchema: kallax.NewBaseSchema( "parents", "__parentnoptr", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Children": kallax.NewForeignKey("parent_id", false), }, func() kallax.Record { return new(ParentNoPtr) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, Person: &schemaPerson{ BaseSchema: kallax.NewBaseSchema( "persons", "__person", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Pets": kallax.NewForeignKey("owner_id", false), "Car": kallax.NewForeignKey("owner_id", false), }, func() kallax.Record { return new(Person) }, true, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), }, Pet: &schemaPet{ BaseSchema: kallax.NewBaseSchema( "pets", "__pet", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Owner": kallax.NewForeignKey("owner_id", true), }, func() kallax.Record { return new(Pet) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("kind"), kallax.NewSchemaField("owner_id"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), Kind: kallax.NewSchemaField("kind"), OwnerFK: kallax.NewSchemaField("owner_id"), }, QueryFixture: &schemaQueryFixture{ BaseSchema: kallax.NewBaseSchema( "query", "__queryfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Relation": kallax.NewForeignKey("owner_id", false), "Inverse": kallax.NewForeignKey("inverse_id", true), "NRelation": kallax.NewForeignKey("owner_id", false), }, func() kallax.Record { return new(QueryFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("inverse_id"), kallax.NewSchemaField("embedded"), kallax.NewSchemaField("inline"), kallax.NewSchemaField("map_of_string"), kallax.NewSchemaField("map_of_interface"), kallax.NewSchemaField("map_of_some_type"), kallax.NewSchemaField("foo"), kallax.NewSchemaField("string_property"), kallax.NewSchemaField("integer"), kallax.NewSchemaField("integer64"), kallax.NewSchemaField("float32"), kallax.NewSchemaField("boolean"), kallax.NewSchemaField("array_param"), kallax.NewSchemaField("slice_param"), kallax.NewSchemaField("alias_array_param"), kallax.NewSchemaField("alias_slice_param"), kallax.NewSchemaField("alias_string_param"), kallax.NewSchemaField("alias_int_param"), kallax.NewSchemaField("dummy_param"), kallax.NewSchemaField("alias_dummy_param"), kallax.NewSchemaField("slice_dummy_param"), kallax.NewSchemaField("idproperty_param"), kallax.NewSchemaField("interface_prop_param"), kallax.NewSchemaField("urlparam"), kallax.NewSchemaField("time_param"), kallax.NewSchemaField("alias_arr_alias_string_param"), kallax.NewSchemaField("alias_here_array_param"), kallax.NewSchemaField("array_alias_here_string_param"), kallax.NewSchemaField("scanner_valuer_param"), ), ID: kallax.NewSchemaField("id"), InverseFK: kallax.NewSchemaField("inverse_id"), Embedded: kallax.NewSchemaField("embedded"), Inline: kallax.NewSchemaField("inline"), MapOfString: kallax.NewSchemaField("map_of_string"), MapOfInterface: kallax.NewSchemaField("map_of_interface"), MapOfSomeType: kallax.NewSchemaField("map_of_some_type"), Foo: kallax.NewSchemaField("foo"), StringProperty: kallax.NewSchemaField("string_property"), Integer: kallax.NewSchemaField("integer"), Integer64: kallax.NewSchemaField("integer64"), Float32: kallax.NewSchemaField("float32"), Boolean: kallax.NewSchemaField("boolean"), ArrayParam: kallax.NewSchemaField("array_param"), SliceParam: kallax.NewSchemaField("slice_param"), AliasArrayParam: kallax.NewSchemaField("alias_array_param"), AliasSliceParam: kallax.NewSchemaField("alias_slice_param"), AliasStringParam: kallax.NewSchemaField("alias_string_param"), AliasIntParam: kallax.NewSchemaField("alias_int_param"), DummyParam: kallax.NewSchemaField("dummy_param"), AliasDummyParam: kallax.NewSchemaField("alias_dummy_param"), SliceDummyParam: kallax.NewSchemaField("slice_dummy_param"), IDPropertyParam: kallax.NewSchemaField("idproperty_param"), InterfacePropParam: kallax.NewSchemaField("interface_prop_param"), URLParam: kallax.NewSchemaField("urlparam"), TimeParam: kallax.NewSchemaField("time_param"), AliasArrAliasStringParam: kallax.NewSchemaField("alias_arr_alias_string_param"), AliasHereArrayParam: kallax.NewSchemaField("alias_here_array_param"), ArrayAliasHereStringParam: kallax.NewSchemaField("array_alias_here_string_param"), ScannerValuerParam: kallax.NewSchemaField("scanner_valuer_param"), }, QueryRelationFixture: &schemaQueryRelationFixture{ BaseSchema: kallax.NewBaseSchema( "query_relation", "__queryrelationfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Owner": kallax.NewForeignKey("owner_id", true), }, func() kallax.Record { return new(QueryRelationFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("name"), kallax.NewSchemaField("owner_id"), ), ID: kallax.NewSchemaField("id"), Name: kallax.NewSchemaField("name"), OwnerFK: kallax.NewSchemaField("owner_id"), }, ResultSetFixture: &schemaResultSetFixture{ BaseSchema: kallax.NewBaseSchema( "resultset", "__resultsetfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(ResultSetFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("foo"), ), ID: kallax.NewSchemaField("id"), Foo: kallax.NewSchemaField("foo"), }, SchemaFixture: &schemaSchemaFixture{ BaseSchema: kallax.NewBaseSchema( "schema", "__schemafixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{ "Nested": kallax.NewForeignKey("schema_fixture_id", false), "Inverse": kallax.NewForeignKey("rel_id", true), }, func() kallax.Record { return new(SchemaFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("string"), kallax.NewSchemaField("int"), kallax.NewSchemaField("inline"), kallax.NewSchemaField("map_of_string"), kallax.NewSchemaField("map_of_interface"), kallax.NewSchemaField("map_of_some_type"), kallax.NewSchemaField("rel_id"), ), ID: kallax.NewSchemaField("id"), String: kallax.NewSchemaField("string"), Int: kallax.NewSchemaField("int"), Inline: kallax.NewSchemaField("inline"), MapOfString: kallax.NewSchemaField("map_of_string"), MapOfInterface: kallax.NewSchemaField("map_of_interface"), MapOfSomeType: kallax.NewSchemaField("map_of_some_type"), InverseFK: kallax.NewSchemaField("rel_id"), }, SchemaRelationshipFixture: &schemaSchemaRelationshipFixture{ BaseSchema: kallax.NewBaseSchema( "relationship", "__schemarelationshipfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(SchemaRelationshipFixture) }, false, kallax.NewSchemaField("id"), ), ID: kallax.NewSchemaField("id"), }, StoreFixture: &schemaStoreFixture{ BaseSchema: kallax.NewBaseSchema( "store", "__storefixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(StoreFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("foo"), kallax.NewSchemaField("slice_prop"), kallax.NewSchemaField("alias_slice_prop"), ), ID: kallax.NewSchemaField("id"), Foo: kallax.NewSchemaField("foo"), SliceProp: kallax.NewSchemaField("slice_prop"), AliasSliceProp: kallax.NewSchemaField("alias_slice_prop"), }, StoreWithConstructFixture: &schemaStoreWithConstructFixture{ BaseSchema: kallax.NewBaseSchema( "store_construct", "__storewithconstructfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(StoreWithConstructFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("foo"), ), ID: kallax.NewSchemaField("id"), Foo: kallax.NewSchemaField("foo"), }, StoreWithNewFixture: &schemaStoreWithNewFixture{ BaseSchema: kallax.NewBaseSchema( "store_new", "__storewithnewfixture", kallax.NewSchemaField("id"), kallax.ForeignKeys{}, func() kallax.Record { return new(StoreWithNewFixture) }, false, kallax.NewSchemaField("id"), kallax.NewSchemaField("foo"), kallax.NewSchemaField("bar"), ), ID: kallax.NewSchemaField("id"), Foo: kallax.NewSchemaField("foo"), Bar: kallax.NewSchemaField("bar"), }, }
Functions ¶
This section is empty.
Types ¶
type A ¶ added in v1.3.0
func (*A) ColumnAddress ¶ added in v1.3.0
ColumnAddress returns the pointer to the value of the given column.
func (*A) GetID ¶ added in v1.3.0
func (r *A) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*A) NewRelationshipRecord ¶ added in v1.3.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*A) SetRelationship ¶ added in v1.3.0
SetRelationship sets the given relationship in the given field.
type AQuery ¶ added in v1.3.0
type AQuery struct {
*kallax.BaseQuery
}
AQuery is the object used to create queries for the A entity.
func NewAQuery ¶ added in v1.3.0
func NewAQuery() *AQuery
NewAQuery returns a new instance of AQuery.
func (*AQuery) BatchSize ¶ added in v1.3.0
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*AQuery) Copy ¶ added in v1.3.0
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*AQuery) FindByID ¶ added in v1.3.0
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*AQuery) FindByName ¶ added in v1.3.0
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*AQuery) Offset ¶ added in v1.3.0
Offset sets the number of items to skip from the result set of items.
func (*AQuery) SelectNot ¶ added in v1.3.0
SelectNot excludes columns from being selected in the query.
type AResultSet ¶ added in v1.3.0
type AResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
AResultSet is the set of results returned by a query to the database.
func NewAResultSet ¶ added in v1.3.0
func NewAResultSet(rs kallax.ResultSet) *AResultSet
NewAResultSet creates a new result set for rows of the type A.
func (*AResultSet) All ¶ added in v1.3.0
func (rs *AResultSet) All() ([]*A, error)
All returns all records on the result set and closes the result set.
func (*AResultSet) Close ¶ added in v1.3.0
func (rs *AResultSet) Close() error
Close closes the result set.
func (*AResultSet) Err ¶ added in v1.3.0
func (rs *AResultSet) Err() error
Err returns the last error occurred.
func (*AResultSet) ForEach ¶ added in v1.3.0
func (rs *AResultSet) ForEach(fn func(*A) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*AResultSet) Get ¶ added in v1.3.0
func (rs *AResultSet) Get() (*A, error)
Get retrieves the last fetched item from the result set and the last error.
func (*AResultSet) Next ¶ added in v1.3.0
func (rs *AResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*AResultSet) One ¶ added in v1.3.0
func (rs *AResultSet) One() (*A, error)
One returns the first record on the result set and closes the result set.
type AStore ¶ added in v1.3.0
type AStore struct {
*kallax.Store
}
AStore is the entity to access the records of the type A in the database.
func (*AStore) Count ¶ added in v1.3.0
Count returns the number of rows that would be retrieved with the given query.
func (*AStore) Debug ¶ added in v1.3.0
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*AStore) DebugWith ¶ added in v1.3.0
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*AStore) DisableCacher ¶ added in v1.3.4
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*AStore) Find ¶ added in v1.3.0
func (s *AStore) Find(q *AQuery) (*AResultSet, error)
Find returns the set of results for the given query.
func (*AStore) FindAll ¶ added in v1.3.0
FindAll returns a list of all the rows returned by the given query.
func (*AStore) FindOne ¶ added in v1.3.0
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*AStore) GenericStore ¶ added in v1.3.0
func (s *AStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*AStore) Insert ¶ added in v1.3.0
Insert inserts a A in the database. A non-persisted object is required for this operation.
func (*AStore) MustCount ¶ added in v1.3.0
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*AStore) MustFind ¶ added in v1.3.0
func (s *AStore) MustFind(q *AQuery) *AResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*AStore) MustFindOne ¶ added in v1.3.0
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*AStore) Reload ¶ added in v1.3.0
Reload refreshes the A with the data in the database and makes it writable.
func (*AStore) RemoveB ¶ added in v1.3.0
RemoveB removes from the database the given relationship of the model. It also resets the field B of the model.
func (*AStore) Save ¶ added in v1.3.0
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*AStore) SetGenericStore ¶ added in v1.3.0
func (s *AStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*AStore) Transaction ¶ added in v1.3.0
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*AStore) Update ¶ added in v1.3.0
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type AliasHereArray ¶ added in v1.0.0
type AliasHereArray [3]string
type AliasHereString ¶ added in v1.0.0
type AliasHereString string
type AliasSliceString ¶ added in v1.0.0
type AliasSliceString []string
type B ¶ added in v1.3.0
type B struct { kallax.Model `table:"b" pk:"id,autoincr"` ID int64 Name string A *A `fk:",inverse"` C *C }
func (*B) ColumnAddress ¶ added in v1.3.0
ColumnAddress returns the pointer to the value of the given column.
func (*B) GetID ¶ added in v1.3.0
func (r *B) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*B) NewRelationshipRecord ¶ added in v1.3.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*B) SetRelationship ¶ added in v1.3.0
SetRelationship sets the given relationship in the given field.
type BQuery ¶ added in v1.3.0
type BQuery struct {
*kallax.BaseQuery
}
BQuery is the object used to create queries for the B entity.
func NewBQuery ¶ added in v1.3.0
func NewBQuery() *BQuery
NewBQuery returns a new instance of BQuery.
func (*BQuery) BatchSize ¶ added in v1.3.0
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*BQuery) Copy ¶ added in v1.3.0
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*BQuery) FindByA ¶ added in v1.3.0
FindByA adds a new filter to the query that will require that the foreign key of A is equal to the passed value.
func (*BQuery) FindByID ¶ added in v1.3.0
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*BQuery) FindByName ¶ added in v1.3.0
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*BQuery) Offset ¶ added in v1.3.0
Offset sets the number of items to skip from the result set of items.
func (*BQuery) SelectNot ¶ added in v1.3.0
SelectNot excludes columns from being selected in the query.
type BResultSet ¶ added in v1.3.0
type BResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
BResultSet is the set of results returned by a query to the database.
func NewBResultSet ¶ added in v1.3.0
func NewBResultSet(rs kallax.ResultSet) *BResultSet
NewBResultSet creates a new result set for rows of the type B.
func (*BResultSet) All ¶ added in v1.3.0
func (rs *BResultSet) All() ([]*B, error)
All returns all records on the result set and closes the result set.
func (*BResultSet) Close ¶ added in v1.3.0
func (rs *BResultSet) Close() error
Close closes the result set.
func (*BResultSet) Err ¶ added in v1.3.0
func (rs *BResultSet) Err() error
Err returns the last error occurred.
func (*BResultSet) ForEach ¶ added in v1.3.0
func (rs *BResultSet) ForEach(fn func(*B) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*BResultSet) Get ¶ added in v1.3.0
func (rs *BResultSet) Get() (*B, error)
Get retrieves the last fetched item from the result set and the last error.
func (*BResultSet) Next ¶ added in v1.3.0
func (rs *BResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*BResultSet) One ¶ added in v1.3.0
func (rs *BResultSet) One() (*B, error)
One returns the first record on the result set and closes the result set.
type BStore ¶ added in v1.3.0
type BStore struct {
*kallax.Store
}
BStore is the entity to access the records of the type B in the database.
func (*BStore) Count ¶ added in v1.3.0
Count returns the number of rows that would be retrieved with the given query.
func (*BStore) Debug ¶ added in v1.3.0
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*BStore) DebugWith ¶ added in v1.3.0
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*BStore) DisableCacher ¶ added in v1.3.4
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*BStore) Find ¶ added in v1.3.0
func (s *BStore) Find(q *BQuery) (*BResultSet, error)
Find returns the set of results for the given query.
func (*BStore) FindAll ¶ added in v1.3.0
FindAll returns a list of all the rows returned by the given query.
func (*BStore) FindOne ¶ added in v1.3.0
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*BStore) GenericStore ¶ added in v1.3.0
func (s *BStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*BStore) Insert ¶ added in v1.3.0
Insert inserts a B in the database. A non-persisted object is required for this operation.
func (*BStore) MustCount ¶ added in v1.3.0
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*BStore) MustFind ¶ added in v1.3.0
func (s *BStore) MustFind(q *BQuery) *BResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*BStore) MustFindOne ¶ added in v1.3.0
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*BStore) Reload ¶ added in v1.3.0
Reload refreshes the B with the data in the database and makes it writable.
func (*BStore) RemoveC ¶ added in v1.3.0
RemoveC removes from the database the given relationship of the model. It also resets the field C of the model.
func (*BStore) Save ¶ added in v1.3.0
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*BStore) SetGenericStore ¶ added in v1.3.0
func (s *BStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*BStore) Transaction ¶ added in v1.3.0
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*BStore) Update ¶ added in v1.3.0
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Brand ¶ added in v1.3.0
func (*Brand) ColumnAddress ¶ added in v1.3.0
ColumnAddress returns the pointer to the value of the given column.
func (*Brand) GetID ¶ added in v1.3.0
func (r *Brand) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Brand) NewRelationshipRecord ¶ added in v1.3.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Brand) SetRelationship ¶ added in v1.3.0
SetRelationship sets the given relationship in the given field.
type BrandQuery ¶ added in v1.3.0
type BrandQuery struct {
*kallax.BaseQuery
}
BrandQuery is the object used to create queries for the Brand entity.
func NewBrandQuery ¶ added in v1.3.0
func NewBrandQuery() *BrandQuery
NewBrandQuery returns a new instance of BrandQuery.
func (*BrandQuery) BatchSize ¶ added in v1.3.0
func (q *BrandQuery) BatchSize(size uint64) *BrandQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*BrandQuery) Copy ¶ added in v1.3.0
func (q *BrandQuery) Copy() *BrandQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*BrandQuery) FindByID ¶ added in v1.3.0
func (q *BrandQuery) FindByID(v ...kallax.ULID) *BrandQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*BrandQuery) FindByName ¶ added in v1.3.0
func (q *BrandQuery) FindByName(v string) *BrandQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*BrandQuery) Limit ¶ added in v1.3.0
func (q *BrandQuery) Limit(n uint64) *BrandQuery
Limit sets the max number of items to retrieve.
func (*BrandQuery) Offset ¶ added in v1.3.0
func (q *BrandQuery) Offset(n uint64) *BrandQuery
Offset sets the number of items to skip from the result set of items.
func (*BrandQuery) Order ¶ added in v1.3.0
func (q *BrandQuery) Order(cols ...kallax.ColumnOrder) *BrandQuery
Order adds order clauses to the query for the given columns.
func (*BrandQuery) Select ¶ added in v1.3.0
func (q *BrandQuery) Select(columns ...kallax.SchemaField) *BrandQuery
Select adds columns to select in the query.
func (*BrandQuery) SelectNot ¶ added in v1.3.0
func (q *BrandQuery) SelectNot(columns ...kallax.SchemaField) *BrandQuery
SelectNot excludes columns from being selected in the query.
func (*BrandQuery) Where ¶ added in v1.3.0
func (q *BrandQuery) Where(cond kallax.Condition) *BrandQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type BrandResultSet ¶ added in v1.3.0
type BrandResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
BrandResultSet is the set of results returned by a query to the database.
func NewBrandResultSet ¶ added in v1.3.0
func NewBrandResultSet(rs kallax.ResultSet) *BrandResultSet
NewBrandResultSet creates a new result set for rows of the type Brand.
func (*BrandResultSet) All ¶ added in v1.3.0
func (rs *BrandResultSet) All() ([]*Brand, error)
All returns all records on the result set and closes the result set.
func (*BrandResultSet) Close ¶ added in v1.3.0
func (rs *BrandResultSet) Close() error
Close closes the result set.
func (*BrandResultSet) Err ¶ added in v1.3.0
func (rs *BrandResultSet) Err() error
Err returns the last error occurred.
func (*BrandResultSet) ForEach ¶ added in v1.3.0
func (rs *BrandResultSet) ForEach(fn func(*Brand) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*BrandResultSet) Get ¶ added in v1.3.0
func (rs *BrandResultSet) Get() (*Brand, error)
Get retrieves the last fetched item from the result set and the last error.
func (*BrandResultSet) Next ¶ added in v1.3.0
func (rs *BrandResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*BrandResultSet) One ¶ added in v1.3.0
func (rs *BrandResultSet) One() (*Brand, error)
One returns the first record on the result set and closes the result set.
type BrandStore ¶ added in v1.3.0
type BrandStore struct {
*kallax.Store
}
BrandStore is the entity to access the records of the type Brand in the database.
func NewBrandStore ¶ added in v1.3.0
func NewBrandStore(db *sql.DB) *BrandStore
NewBrandStore creates a new instance of BrandStore using a SQL database.
func (*BrandStore) Count ¶ added in v1.3.0
func (s *BrandStore) Count(q *BrandQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*BrandStore) Debug ¶ added in v1.3.0
func (s *BrandStore) Debug() *BrandStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*BrandStore) DebugWith ¶ added in v1.3.0
func (s *BrandStore) DebugWith(logger kallax.LoggerFunc) *BrandStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*BrandStore) Delete ¶ added in v1.3.0
func (s *BrandStore) Delete(record *Brand) error
Delete removes the given record from the database.
func (*BrandStore) DisableCacher ¶ added in v1.3.4
func (s *BrandStore) DisableCacher() *BrandStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*BrandStore) Find ¶ added in v1.3.0
func (s *BrandStore) Find(q *BrandQuery) (*BrandResultSet, error)
Find returns the set of results for the given query.
func (*BrandStore) FindAll ¶ added in v1.3.0
func (s *BrandStore) FindAll(q *BrandQuery) ([]*Brand, error)
FindAll returns a list of all the rows returned by the given query.
func (*BrandStore) FindOne ¶ added in v1.3.0
func (s *BrandStore) FindOne(q *BrandQuery) (*Brand, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*BrandStore) GenericStore ¶ added in v1.3.0
func (s *BrandStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*BrandStore) Insert ¶ added in v1.3.0
func (s *BrandStore) Insert(record *Brand) error
Insert inserts a Brand in the database. A non-persisted object is required for this operation.
func (*BrandStore) MustCount ¶ added in v1.3.0
func (s *BrandStore) MustCount(q *BrandQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*BrandStore) MustFind ¶ added in v1.3.0
func (s *BrandStore) MustFind(q *BrandQuery) *BrandResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*BrandStore) MustFindOne ¶ added in v1.3.0
func (s *BrandStore) MustFindOne(q *BrandQuery) *Brand
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*BrandStore) Reload ¶ added in v1.3.0
func (s *BrandStore) Reload(record *Brand) error
Reload refreshes the Brand with the data in the database and makes it writable.
func (*BrandStore) Save ¶ added in v1.3.0
func (s *BrandStore) Save(record *Brand) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*BrandStore) SetGenericStore ¶ added in v1.3.0
func (s *BrandStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*BrandStore) Transaction ¶ added in v1.3.0
func (s *BrandStore) Transaction(callback func(*BrandStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*BrandStore) Update ¶ added in v1.3.0
func (s *BrandStore) Update(record *Brand, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type C ¶ added in v1.3.0
type C struct { kallax.Model `table:"c" pk:"id,autoincr"` ID int64 Name string B *B `fk:",inverse"` }
func (*C) ColumnAddress ¶ added in v1.3.0
ColumnAddress returns the pointer to the value of the given column.
func (*C) GetID ¶ added in v1.3.0
func (r *C) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*C) NewRelationshipRecord ¶ added in v1.3.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*C) SetRelationship ¶ added in v1.3.0
SetRelationship sets the given relationship in the given field.
type CQuery ¶ added in v1.3.0
type CQuery struct {
*kallax.BaseQuery
}
CQuery is the object used to create queries for the C entity.
func NewCQuery ¶ added in v1.3.0
func NewCQuery() *CQuery
NewCQuery returns a new instance of CQuery.
func (*CQuery) BatchSize ¶ added in v1.3.0
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*CQuery) Copy ¶ added in v1.3.0
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*CQuery) FindByB ¶ added in v1.3.0
FindByB adds a new filter to the query that will require that the foreign key of B is equal to the passed value.
func (*CQuery) FindByID ¶ added in v1.3.0
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*CQuery) FindByName ¶ added in v1.3.0
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*CQuery) Offset ¶ added in v1.3.0
Offset sets the number of items to skip from the result set of items.
func (*CQuery) SelectNot ¶ added in v1.3.0
SelectNot excludes columns from being selected in the query.
type CResultSet ¶ added in v1.3.0
type CResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
CResultSet is the set of results returned by a query to the database.
func NewCResultSet ¶ added in v1.3.0
func NewCResultSet(rs kallax.ResultSet) *CResultSet
NewCResultSet creates a new result set for rows of the type C.
func (*CResultSet) All ¶ added in v1.3.0
func (rs *CResultSet) All() ([]*C, error)
All returns all records on the result set and closes the result set.
func (*CResultSet) Close ¶ added in v1.3.0
func (rs *CResultSet) Close() error
Close closes the result set.
func (*CResultSet) Err ¶ added in v1.3.0
func (rs *CResultSet) Err() error
Err returns the last error occurred.
func (*CResultSet) ForEach ¶ added in v1.3.0
func (rs *CResultSet) ForEach(fn func(*C) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*CResultSet) Get ¶ added in v1.3.0
func (rs *CResultSet) Get() (*C, error)
Get retrieves the last fetched item from the result set and the last error.
func (*CResultSet) Next ¶ added in v1.3.0
func (rs *CResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*CResultSet) One ¶ added in v1.3.0
func (rs *CResultSet) One() (*C, error)
One returns the first record on the result set and closes the result set.
type CStore ¶ added in v1.3.0
type CStore struct {
*kallax.Store
}
CStore is the entity to access the records of the type C in the database.
func (*CStore) Count ¶ added in v1.3.0
Count returns the number of rows that would be retrieved with the given query.
func (*CStore) Debug ¶ added in v1.3.0
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*CStore) DebugWith ¶ added in v1.3.0
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*CStore) DisableCacher ¶ added in v1.3.4
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*CStore) Find ¶ added in v1.3.0
func (s *CStore) Find(q *CQuery) (*CResultSet, error)
Find returns the set of results for the given query.
func (*CStore) FindAll ¶ added in v1.3.0
FindAll returns a list of all the rows returned by the given query.
func (*CStore) FindOne ¶ added in v1.3.0
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*CStore) GenericStore ¶ added in v1.3.0
func (s *CStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*CStore) Insert ¶ added in v1.3.0
Insert inserts a C in the database. A non-persisted object is required for this operation.
func (*CStore) MustCount ¶ added in v1.3.0
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*CStore) MustFind ¶ added in v1.3.0
func (s *CStore) MustFind(q *CQuery) *CResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*CStore) MustFindOne ¶ added in v1.3.0
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*CStore) Reload ¶ added in v1.3.0
Reload refreshes the C with the data in the database and makes it writable.
func (*CStore) Save ¶ added in v1.3.0
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*CStore) SetGenericStore ¶ added in v1.3.0
func (s *CStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*CStore) Transaction ¶ added in v1.3.0
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*CStore) Update ¶ added in v1.3.0
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Car ¶ added in v0.12.0
type Car struct { kallax.Model `table:"cars"` ID kallax.ULID `pk:""` Owner *Person `fk:"owner_id,inverse"` ModelName string Brand Brand `fk:"brand_id,inverse"` // contains filtered or unexported fields }
func (*Car) AfterDelete ¶ added in v0.13.0
func (*Car) BeforeDelete ¶ added in v0.13.0
func (*Car) BeforeSave ¶ added in v0.13.0
func (*Car) ColumnAddress ¶ added in v0.12.0
ColumnAddress returns the pointer to the value of the given column.
func (*Car) GetID ¶ added in v0.13.0
func (r *Car) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Car) NewRelationshipRecord ¶ added in v0.12.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Car) SetRelationship ¶ added in v0.12.0
SetRelationship sets the given relationship in the given field.
type CarQuery ¶ added in v0.12.0
type CarQuery struct {
*kallax.BaseQuery
}
CarQuery is the object used to create queries for the Car entity.
func NewCarQuery ¶ added in v0.12.0
func NewCarQuery() *CarQuery
NewCarQuery returns a new instance of CarQuery.
func (*CarQuery) BatchSize ¶ added in v0.12.0
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*CarQuery) Copy ¶ added in v0.12.0
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*CarQuery) FindByBrand ¶ added in v1.3.0
FindByBrand adds a new filter to the query that will require that the foreign key of Brand is equal to the passed value.
func (*CarQuery) FindByID ¶ added in v1.0.0
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*CarQuery) FindByModelName ¶ added in v1.0.0
FindByModelName adds a new filter to the query that will require that the ModelName property is equal to the passed value.
func (*CarQuery) FindByOwner ¶ added in v1.1.0
FindByOwner adds a new filter to the query that will require that the foreign key of Owner is equal to the passed value.
func (*CarQuery) Offset ¶ added in v0.12.0
Offset sets the number of items to skip from the result set of items.
func (*CarQuery) Order ¶ added in v0.12.0
Order adds order clauses to the query for the given columns.
func (*CarQuery) SelectNot ¶ added in v0.12.0
SelectNot excludes columns from being selected in the query.
type CarResultSet ¶ added in v0.12.0
type CarResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
CarResultSet is the set of results returned by a query to the database.
func NewCarResultSet ¶ added in v0.12.0
func NewCarResultSet(rs kallax.ResultSet) *CarResultSet
NewCarResultSet creates a new result set for rows of the type Car.
func (*CarResultSet) All ¶ added in v0.12.0
func (rs *CarResultSet) All() ([]*Car, error)
All returns all records on the result set and closes the result set.
func (*CarResultSet) Close ¶ added in v0.12.0
func (rs *CarResultSet) Close() error
Close closes the result set.
func (*CarResultSet) Err ¶ added in v0.12.0
func (rs *CarResultSet) Err() error
Err returns the last error occurred.
func (*CarResultSet) ForEach ¶ added in v0.12.0
func (rs *CarResultSet) ForEach(fn func(*Car) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*CarResultSet) Get ¶ added in v0.12.0
func (rs *CarResultSet) Get() (*Car, error)
Get retrieves the last fetched item from the result set and the last error.
func (*CarResultSet) Next ¶ added in v0.12.0
func (rs *CarResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*CarResultSet) One ¶ added in v0.12.0
func (rs *CarResultSet) One() (*Car, error)
One returns the first record on the result set and closes the result set.
type CarStore ¶ added in v0.12.0
type CarStore struct {
*kallax.Store
}
CarStore is the entity to access the records of the type Car in the database.
func NewCarStore ¶ added in v0.12.0
NewCarStore creates a new instance of CarStore using a SQL database.
func (*CarStore) Count ¶ added in v0.12.0
Count returns the number of rows that would be retrieved with the given query.
func (*CarStore) Debug ¶ added in v1.1.4
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*CarStore) DebugWith ¶ added in v1.1.4
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*CarStore) DisableCacher ¶ added in v1.3.4
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*CarStore) Find ¶ added in v0.12.0
func (s *CarStore) Find(q *CarQuery) (*CarResultSet, error)
Find returns the set of results for the given query.
func (*CarStore) FindAll ¶ added in v1.2.1
FindAll returns a list of all the rows returned by the given query.
func (*CarStore) FindOne ¶ added in v0.12.0
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*CarStore) GenericStore ¶ added in v1.1.0
func (s *CarStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*CarStore) Insert ¶ added in v0.12.0
Insert inserts a Car in the database. A non-persisted object is required for this operation.
func (*CarStore) MustCount ¶ added in v0.12.0
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*CarStore) MustFind ¶ added in v0.12.0
func (s *CarStore) MustFind(q *CarQuery) *CarResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*CarStore) MustFindOne ¶ added in v0.12.0
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*CarStore) Reload ¶ added in v0.12.0
Reload refreshes the Car with the data in the database and makes it writable.
func (*CarStore) Save ¶ added in v0.12.0
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*CarStore) SetGenericStore ¶ added in v1.1.0
func (s *CarStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*CarStore) Transaction ¶ added in v0.12.0
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*CarStore) Update ¶ added in v0.12.0
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Child ¶ added in v1.2.8
func NewChild ¶ added in v1.2.8
func NewChild() (record *Child)
NewChild returns a new instance of Child.
func (*Child) ColumnAddress ¶ added in v1.2.8
ColumnAddress returns the pointer to the value of the given column.
func (*Child) GetID ¶ added in v1.2.8
func (r *Child) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Child) NewRelationshipRecord ¶ added in v1.2.8
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Child) SetRelationship ¶ added in v1.2.8
SetRelationship sets the given relationship in the given field.
type ChildQuery ¶ added in v1.2.8
type ChildQuery struct {
*kallax.BaseQuery
}
ChildQuery is the object used to create queries for the Child entity.
func NewChildQuery ¶ added in v1.2.8
func NewChildQuery() *ChildQuery
NewChildQuery returns a new instance of ChildQuery.
func (*ChildQuery) BatchSize ¶ added in v1.2.8
func (q *ChildQuery) BatchSize(size uint64) *ChildQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*ChildQuery) Copy ¶ added in v1.2.8
func (q *ChildQuery) Copy() *ChildQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*ChildQuery) FindByID ¶ added in v1.2.8
func (q *ChildQuery) FindByID(v ...int64) *ChildQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*ChildQuery) FindByName ¶ added in v1.2.8
func (q *ChildQuery) FindByName(v string) *ChildQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*ChildQuery) Limit ¶ added in v1.2.8
func (q *ChildQuery) Limit(n uint64) *ChildQuery
Limit sets the max number of items to retrieve.
func (*ChildQuery) Offset ¶ added in v1.2.8
func (q *ChildQuery) Offset(n uint64) *ChildQuery
Offset sets the number of items to skip from the result set of items.
func (*ChildQuery) Order ¶ added in v1.2.8
func (q *ChildQuery) Order(cols ...kallax.ColumnOrder) *ChildQuery
Order adds order clauses to the query for the given columns.
func (*ChildQuery) Select ¶ added in v1.2.8
func (q *ChildQuery) Select(columns ...kallax.SchemaField) *ChildQuery
Select adds columns to select in the query.
func (*ChildQuery) SelectNot ¶ added in v1.2.8
func (q *ChildQuery) SelectNot(columns ...kallax.SchemaField) *ChildQuery
SelectNot excludes columns from being selected in the query.
func (*ChildQuery) Where ¶ added in v1.2.8
func (q *ChildQuery) Where(cond kallax.Condition) *ChildQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type ChildResultSet ¶ added in v1.2.8
type ChildResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
ChildResultSet is the set of results returned by a query to the database.
func NewChildResultSet ¶ added in v1.2.8
func NewChildResultSet(rs kallax.ResultSet) *ChildResultSet
NewChildResultSet creates a new result set for rows of the type Child.
func (*ChildResultSet) All ¶ added in v1.2.8
func (rs *ChildResultSet) All() ([]*Child, error)
All returns all records on the result set and closes the result set.
func (*ChildResultSet) Close ¶ added in v1.2.8
func (rs *ChildResultSet) Close() error
Close closes the result set.
func (*ChildResultSet) Err ¶ added in v1.2.8
func (rs *ChildResultSet) Err() error
Err returns the last error occurred.
func (*ChildResultSet) ForEach ¶ added in v1.2.8
func (rs *ChildResultSet) ForEach(fn func(*Child) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*ChildResultSet) Get ¶ added in v1.2.8
func (rs *ChildResultSet) Get() (*Child, error)
Get retrieves the last fetched item from the result set and the last error.
func (*ChildResultSet) Next ¶ added in v1.2.8
func (rs *ChildResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*ChildResultSet) One ¶ added in v1.2.8
func (rs *ChildResultSet) One() (*Child, error)
One returns the first record on the result set and closes the result set.
type ChildStore ¶ added in v1.2.8
type ChildStore struct {
*kallax.Store
}
ChildStore is the entity to access the records of the type Child in the database.
func NewChildStore ¶ added in v1.2.8
func NewChildStore(db *sql.DB) *ChildStore
NewChildStore creates a new instance of ChildStore using a SQL database.
func (*ChildStore) Count ¶ added in v1.2.8
func (s *ChildStore) Count(q *ChildQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*ChildStore) Debug ¶ added in v1.2.8
func (s *ChildStore) Debug() *ChildStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*ChildStore) DebugWith ¶ added in v1.2.8
func (s *ChildStore) DebugWith(logger kallax.LoggerFunc) *ChildStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*ChildStore) Delete ¶ added in v1.2.8
func (s *ChildStore) Delete(record *Child) error
Delete removes the given record from the database.
func (*ChildStore) DisableCacher ¶ added in v1.3.4
func (s *ChildStore) DisableCacher() *ChildStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*ChildStore) Find ¶ added in v1.2.8
func (s *ChildStore) Find(q *ChildQuery) (*ChildResultSet, error)
Find returns the set of results for the given query.
func (*ChildStore) FindAll ¶ added in v1.2.8
func (s *ChildStore) FindAll(q *ChildQuery) ([]*Child, error)
FindAll returns a list of all the rows returned by the given query.
func (*ChildStore) FindOne ¶ added in v1.2.8
func (s *ChildStore) FindOne(q *ChildQuery) (*Child, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*ChildStore) GenericStore ¶ added in v1.2.8
func (s *ChildStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*ChildStore) Insert ¶ added in v1.2.8
func (s *ChildStore) Insert(record *Child) error
Insert inserts a Child in the database. A non-persisted object is required for this operation.
func (*ChildStore) MustCount ¶ added in v1.2.8
func (s *ChildStore) MustCount(q *ChildQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*ChildStore) MustFind ¶ added in v1.2.8
func (s *ChildStore) MustFind(q *ChildQuery) *ChildResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*ChildStore) MustFindOne ¶ added in v1.2.8
func (s *ChildStore) MustFindOne(q *ChildQuery) *Child
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*ChildStore) Reload ¶ added in v1.2.8
func (s *ChildStore) Reload(record *Child) error
Reload refreshes the Child with the data in the database and makes it writable.
func (*ChildStore) Save ¶ added in v1.2.8
func (s *ChildStore) Save(record *Child) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*ChildStore) SetGenericStore ¶ added in v1.2.8
func (s *ChildStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*ChildStore) Transaction ¶ added in v1.2.8
func (s *ChildStore) Transaction(callback func(*ChildStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*ChildStore) Update ¶ added in v1.2.8
func (s *ChildStore) Update(record *Child, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type EventsAllFixture ¶ added in v0.13.0
type EventsAllFixture struct { kallax.Model `table:"event"` ID kallax.ULID `pk:""` Checks map[string]bool MustFailBefore error MustFailAfter error }
func NewEventsAllFixture ¶ added in v0.13.0
func NewEventsAllFixture() (record *EventsAllFixture)
NewEventsAllFixture returns a new instance of EventsAllFixture.
func (*EventsAllFixture) AfterInsert ¶ added in v0.13.0
func (s *EventsAllFixture) AfterInsert() error
func (*EventsAllFixture) AfterSave ¶ added in v0.13.0
func (s *EventsAllFixture) AfterSave() error
func (*EventsAllFixture) AfterUpdate ¶ added in v0.13.0
func (s *EventsAllFixture) AfterUpdate() error
func (*EventsAllFixture) BeforeInsert ¶ added in v0.13.0
func (s *EventsAllFixture) BeforeInsert() error
func (*EventsAllFixture) BeforeSave ¶ added in v0.13.0
func (s *EventsAllFixture) BeforeSave() error
func (*EventsAllFixture) BeforeUpdate ¶ added in v0.13.0
func (s *EventsAllFixture) BeforeUpdate() error
func (*EventsAllFixture) ColumnAddress ¶ added in v0.13.0
func (r *EventsAllFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*EventsAllFixture) GetID ¶ added in v0.13.0
func (r *EventsAllFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*EventsAllFixture) NewRelationshipRecord ¶ added in v0.13.0
func (r *EventsAllFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*EventsAllFixture) SetRelationship ¶ added in v0.13.0
func (r *EventsAllFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*EventsAllFixture) Value ¶ added in v0.13.0
func (r *EventsAllFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type EventsAllFixtureQuery ¶ added in v0.13.0
type EventsAllFixtureQuery struct {
*kallax.BaseQuery
}
EventsAllFixtureQuery is the object used to create queries for the EventsAllFixture entity.
func NewEventsAllFixtureQuery ¶ added in v0.13.0
func NewEventsAllFixtureQuery() *EventsAllFixtureQuery
NewEventsAllFixtureQuery returns a new instance of EventsAllFixtureQuery.
func (*EventsAllFixtureQuery) BatchSize ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) BatchSize(size uint64) *EventsAllFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*EventsAllFixtureQuery) Copy ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Copy() *EventsAllFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*EventsAllFixtureQuery) FindByID ¶ added in v1.0.0
func (q *EventsAllFixtureQuery) FindByID(v ...kallax.ULID) *EventsAllFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*EventsAllFixtureQuery) Limit ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Limit(n uint64) *EventsAllFixtureQuery
Limit sets the max number of items to retrieve.
func (*EventsAllFixtureQuery) Offset ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Offset(n uint64) *EventsAllFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*EventsAllFixtureQuery) Order ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsAllFixtureQuery
Order adds order clauses to the query for the given columns.
func (*EventsAllFixtureQuery) Select ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Select(columns ...kallax.SchemaField) *EventsAllFixtureQuery
Select adds columns to select in the query.
func (*EventsAllFixtureQuery) SelectNot ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsAllFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*EventsAllFixtureQuery) Where ¶ added in v0.13.0
func (q *EventsAllFixtureQuery) Where(cond kallax.Condition) *EventsAllFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type EventsAllFixtureResultSet ¶ added in v0.13.0
type EventsAllFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
EventsAllFixtureResultSet is the set of results returned by a query to the database.
func NewEventsAllFixtureResultSet ¶ added in v0.13.0
func NewEventsAllFixtureResultSet(rs kallax.ResultSet) *EventsAllFixtureResultSet
NewEventsAllFixtureResultSet creates a new result set for rows of the type EventsAllFixture.
func (*EventsAllFixtureResultSet) All ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) All() ([]*EventsAllFixture, error)
All returns all records on the result set and closes the result set.
func (*EventsAllFixtureResultSet) Close ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) Close() error
Close closes the result set.
func (*EventsAllFixtureResultSet) Err ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) Err() error
Err returns the last error occurred.
func (*EventsAllFixtureResultSet) ForEach ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) ForEach(fn func(*EventsAllFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*EventsAllFixtureResultSet) Get ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) Get() (*EventsAllFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*EventsAllFixtureResultSet) Next ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*EventsAllFixtureResultSet) One ¶ added in v0.13.0
func (rs *EventsAllFixtureResultSet) One() (*EventsAllFixture, error)
One returns the first record on the result set and closes the result set.
type EventsAllFixtureStore ¶ added in v0.13.0
type EventsAllFixtureStore struct {
*kallax.Store
}
EventsAllFixtureStore is the entity to access the records of the type EventsAllFixture in the database.
func NewEventsAllFixtureStore ¶ added in v0.13.0
func NewEventsAllFixtureStore(db *sql.DB) *EventsAllFixtureStore
NewEventsAllFixtureStore creates a new instance of EventsAllFixtureStore using a SQL database.
func (*EventsAllFixtureStore) Count ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Count(q *EventsAllFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*EventsAllFixtureStore) Debug ¶ added in v1.1.4
func (s *EventsAllFixtureStore) Debug() *EventsAllFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*EventsAllFixtureStore) DebugWith ¶ added in v1.1.4
func (s *EventsAllFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsAllFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*EventsAllFixtureStore) Delete ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Delete(record *EventsAllFixture) error
Delete removes the given record from the database.
func (*EventsAllFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *EventsAllFixtureStore) DisableCacher() *EventsAllFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*EventsAllFixtureStore) Find ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Find(q *EventsAllFixtureQuery) (*EventsAllFixtureResultSet, error)
Find returns the set of results for the given query.
func (*EventsAllFixtureStore) FindAll ¶ added in v1.2.1
func (s *EventsAllFixtureStore) FindAll(q *EventsAllFixtureQuery) ([]*EventsAllFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*EventsAllFixtureStore) FindOne ¶ added in v0.13.0
func (s *EventsAllFixtureStore) FindOne(q *EventsAllFixtureQuery) (*EventsAllFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*EventsAllFixtureStore) GenericStore ¶ added in v1.1.0
func (s *EventsAllFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*EventsAllFixtureStore) Insert ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Insert(record *EventsAllFixture) error
Insert inserts a EventsAllFixture in the database. A non-persisted object is required for this operation.
func (*EventsAllFixtureStore) MustCount ¶ added in v0.13.0
func (s *EventsAllFixtureStore) MustCount(q *EventsAllFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*EventsAllFixtureStore) MustFind ¶ added in v0.13.0
func (s *EventsAllFixtureStore) MustFind(q *EventsAllFixtureQuery) *EventsAllFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*EventsAllFixtureStore) MustFindOne ¶ added in v0.13.0
func (s *EventsAllFixtureStore) MustFindOne(q *EventsAllFixtureQuery) *EventsAllFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*EventsAllFixtureStore) Reload ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Reload(record *EventsAllFixture) error
Reload refreshes the EventsAllFixture with the data in the database and makes it writable.
func (*EventsAllFixtureStore) Save ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Save(record *EventsAllFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*EventsAllFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *EventsAllFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*EventsAllFixtureStore) Transaction ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Transaction(callback func(*EventsAllFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*EventsAllFixtureStore) Update ¶ added in v0.13.0
func (s *EventsAllFixtureStore) Update(record *EventsAllFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type EventsFixture ¶
type EventsFixture struct { kallax.Model `table:"event"` ID kallax.ULID `pk:""` Checks map[string]bool MustFailBefore error MustFailAfter error }
func NewEventsFixture ¶
func NewEventsFixture() (record *EventsFixture)
NewEventsFixture returns a new instance of EventsFixture.
func (*EventsFixture) AfterInsert ¶ added in v0.12.0
func (s *EventsFixture) AfterInsert() error
func (*EventsFixture) AfterUpdate ¶ added in v0.12.0
func (s *EventsFixture) AfterUpdate() error
func (*EventsFixture) BeforeInsert ¶ added in v0.12.0
func (s *EventsFixture) BeforeInsert() error
func (*EventsFixture) BeforeUpdate ¶ added in v0.12.0
func (s *EventsFixture) BeforeUpdate() error
func (*EventsFixture) ColumnAddress ¶
func (r *EventsFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*EventsFixture) GetID ¶ added in v0.13.0
func (r *EventsFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*EventsFixture) NewRelationshipRecord ¶
func (r *EventsFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*EventsFixture) SetRelationship ¶
func (r *EventsFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*EventsFixture) Value ¶
func (r *EventsFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type EventsFixtureQuery ¶
type EventsFixtureQuery struct {
*kallax.BaseQuery
}
EventsFixtureQuery is the object used to create queries for the EventsFixture entity.
func NewEventsFixtureQuery ¶
func NewEventsFixtureQuery() *EventsFixtureQuery
NewEventsFixtureQuery returns a new instance of EventsFixtureQuery.
func (*EventsFixtureQuery) BatchSize ¶
func (q *EventsFixtureQuery) BatchSize(size uint64) *EventsFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*EventsFixtureQuery) Copy ¶
func (q *EventsFixtureQuery) Copy() *EventsFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*EventsFixtureQuery) FindByID ¶ added in v1.0.0
func (q *EventsFixtureQuery) FindByID(v ...kallax.ULID) *EventsFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*EventsFixtureQuery) Limit ¶
func (q *EventsFixtureQuery) Limit(n uint64) *EventsFixtureQuery
Limit sets the max number of items to retrieve.
func (*EventsFixtureQuery) Offset ¶
func (q *EventsFixtureQuery) Offset(n uint64) *EventsFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*EventsFixtureQuery) Order ¶
func (q *EventsFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsFixtureQuery
Order adds order clauses to the query for the given columns.
func (*EventsFixtureQuery) Select ¶
func (q *EventsFixtureQuery) Select(columns ...kallax.SchemaField) *EventsFixtureQuery
Select adds columns to select in the query.
func (*EventsFixtureQuery) SelectNot ¶
func (q *EventsFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*EventsFixtureQuery) Where ¶
func (q *EventsFixtureQuery) Where(cond kallax.Condition) *EventsFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type EventsFixtureResultSet ¶
type EventsFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
EventsFixtureResultSet is the set of results returned by a query to the database.
func NewEventsFixtureResultSet ¶
func NewEventsFixtureResultSet(rs kallax.ResultSet) *EventsFixtureResultSet
NewEventsFixtureResultSet creates a new result set for rows of the type EventsFixture.
func (*EventsFixtureResultSet) All ¶
func (rs *EventsFixtureResultSet) All() ([]*EventsFixture, error)
All returns all records on the result set and closes the result set.
func (*EventsFixtureResultSet) Close ¶ added in v0.12.0
func (rs *EventsFixtureResultSet) Close() error
Close closes the result set.
func (*EventsFixtureResultSet) Err ¶ added in v0.12.0
func (rs *EventsFixtureResultSet) Err() error
Err returns the last error occurred.
func (*EventsFixtureResultSet) ForEach ¶
func (rs *EventsFixtureResultSet) ForEach(fn func(*EventsFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*EventsFixtureResultSet) Get ¶
func (rs *EventsFixtureResultSet) Get() (*EventsFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*EventsFixtureResultSet) Next ¶
func (rs *EventsFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*EventsFixtureResultSet) One ¶
func (rs *EventsFixtureResultSet) One() (*EventsFixture, error)
One returns the first record on the result set and closes the result set.
type EventsFixtureStore ¶
type EventsFixtureStore struct {
*kallax.Store
}
EventsFixtureStore is the entity to access the records of the type EventsFixture in the database.
func NewEventsFixtureStore ¶
func NewEventsFixtureStore(db *sql.DB) *EventsFixtureStore
NewEventsFixtureStore creates a new instance of EventsFixtureStore using a SQL database.
func (*EventsFixtureStore) Count ¶
func (s *EventsFixtureStore) Count(q *EventsFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*EventsFixtureStore) Debug ¶ added in v1.1.4
func (s *EventsFixtureStore) Debug() *EventsFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*EventsFixtureStore) DebugWith ¶ added in v1.1.4
func (s *EventsFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*EventsFixtureStore) Delete ¶
func (s *EventsFixtureStore) Delete(record *EventsFixture) error
Delete removes the given record from the database.
func (*EventsFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *EventsFixtureStore) DisableCacher() *EventsFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*EventsFixtureStore) Find ¶
func (s *EventsFixtureStore) Find(q *EventsFixtureQuery) (*EventsFixtureResultSet, error)
Find returns the set of results for the given query.
func (*EventsFixtureStore) FindAll ¶ added in v1.2.1
func (s *EventsFixtureStore) FindAll(q *EventsFixtureQuery) ([]*EventsFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*EventsFixtureStore) FindOne ¶
func (s *EventsFixtureStore) FindOne(q *EventsFixtureQuery) (*EventsFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*EventsFixtureStore) GenericStore ¶ added in v1.1.0
func (s *EventsFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*EventsFixtureStore) Insert ¶
func (s *EventsFixtureStore) Insert(record *EventsFixture) error
Insert inserts a EventsFixture in the database. A non-persisted object is required for this operation.
func (*EventsFixtureStore) MustCount ¶
func (s *EventsFixtureStore) MustCount(q *EventsFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*EventsFixtureStore) MustFind ¶
func (s *EventsFixtureStore) MustFind(q *EventsFixtureQuery) *EventsFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*EventsFixtureStore) MustFindOne ¶
func (s *EventsFixtureStore) MustFindOne(q *EventsFixtureQuery) *EventsFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*EventsFixtureStore) Reload ¶
func (s *EventsFixtureStore) Reload(record *EventsFixture) error
Reload refreshes the EventsFixture with the data in the database and makes it writable.
func (*EventsFixtureStore) Save ¶
func (s *EventsFixtureStore) Save(record *EventsFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*EventsFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *EventsFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*EventsFixtureStore) Transaction ¶
func (s *EventsFixtureStore) Transaction(callback func(*EventsFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*EventsFixtureStore) Update ¶
func (s *EventsFixtureStore) Update(record *EventsFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type EventsSaveFixture ¶
type EventsSaveFixture struct { kallax.Model `table:"event"` ID kallax.ULID `pk:""` Checks map[string]bool MustFailBefore error MustFailAfter error }
func NewEventsSaveFixture ¶
func NewEventsSaveFixture() (record *EventsSaveFixture)
NewEventsSaveFixture returns a new instance of EventsSaveFixture.
func (*EventsSaveFixture) AfterSave ¶ added in v0.12.0
func (s *EventsSaveFixture) AfterSave() error
func (*EventsSaveFixture) BeforeSave ¶ added in v0.12.0
func (s *EventsSaveFixture) BeforeSave() error
func (*EventsSaveFixture) ColumnAddress ¶
func (r *EventsSaveFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*EventsSaveFixture) GetID ¶ added in v0.13.0
func (r *EventsSaveFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*EventsSaveFixture) NewRelationshipRecord ¶
func (r *EventsSaveFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*EventsSaveFixture) SetRelationship ¶
func (r *EventsSaveFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*EventsSaveFixture) Value ¶
func (r *EventsSaveFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type EventsSaveFixtureQuery ¶
type EventsSaveFixtureQuery struct {
*kallax.BaseQuery
}
EventsSaveFixtureQuery is the object used to create queries for the EventsSaveFixture entity.
func NewEventsSaveFixtureQuery ¶
func NewEventsSaveFixtureQuery() *EventsSaveFixtureQuery
NewEventsSaveFixtureQuery returns a new instance of EventsSaveFixtureQuery.
func (*EventsSaveFixtureQuery) BatchSize ¶
func (q *EventsSaveFixtureQuery) BatchSize(size uint64) *EventsSaveFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*EventsSaveFixtureQuery) Copy ¶
func (q *EventsSaveFixtureQuery) Copy() *EventsSaveFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*EventsSaveFixtureQuery) FindByID ¶ added in v1.0.0
func (q *EventsSaveFixtureQuery) FindByID(v ...kallax.ULID) *EventsSaveFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*EventsSaveFixtureQuery) Limit ¶
func (q *EventsSaveFixtureQuery) Limit(n uint64) *EventsSaveFixtureQuery
Limit sets the max number of items to retrieve.
func (*EventsSaveFixtureQuery) Offset ¶
func (q *EventsSaveFixtureQuery) Offset(n uint64) *EventsSaveFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*EventsSaveFixtureQuery) Order ¶
func (q *EventsSaveFixtureQuery) Order(cols ...kallax.ColumnOrder) *EventsSaveFixtureQuery
Order adds order clauses to the query for the given columns.
func (*EventsSaveFixtureQuery) Select ¶
func (q *EventsSaveFixtureQuery) Select(columns ...kallax.SchemaField) *EventsSaveFixtureQuery
Select adds columns to select in the query.
func (*EventsSaveFixtureQuery) SelectNot ¶
func (q *EventsSaveFixtureQuery) SelectNot(columns ...kallax.SchemaField) *EventsSaveFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*EventsSaveFixtureQuery) Where ¶
func (q *EventsSaveFixtureQuery) Where(cond kallax.Condition) *EventsSaveFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type EventsSaveFixtureResultSet ¶
type EventsSaveFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
EventsSaveFixtureResultSet is the set of results returned by a query to the database.
func NewEventsSaveFixtureResultSet ¶
func NewEventsSaveFixtureResultSet(rs kallax.ResultSet) *EventsSaveFixtureResultSet
NewEventsSaveFixtureResultSet creates a new result set for rows of the type EventsSaveFixture.
func (*EventsSaveFixtureResultSet) All ¶
func (rs *EventsSaveFixtureResultSet) All() ([]*EventsSaveFixture, error)
All returns all records on the result set and closes the result set.
func (*EventsSaveFixtureResultSet) Close ¶ added in v0.12.0
func (rs *EventsSaveFixtureResultSet) Close() error
Close closes the result set.
func (*EventsSaveFixtureResultSet) Err ¶ added in v0.12.0
func (rs *EventsSaveFixtureResultSet) Err() error
Err returns the last error occurred.
func (*EventsSaveFixtureResultSet) ForEach ¶
func (rs *EventsSaveFixtureResultSet) ForEach(fn func(*EventsSaveFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*EventsSaveFixtureResultSet) Get ¶
func (rs *EventsSaveFixtureResultSet) Get() (*EventsSaveFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*EventsSaveFixtureResultSet) Next ¶
func (rs *EventsSaveFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*EventsSaveFixtureResultSet) One ¶
func (rs *EventsSaveFixtureResultSet) One() (*EventsSaveFixture, error)
One returns the first record on the result set and closes the result set.
type EventsSaveFixtureStore ¶
type EventsSaveFixtureStore struct {
*kallax.Store
}
EventsSaveFixtureStore is the entity to access the records of the type EventsSaveFixture in the database.
func NewEventsSaveFixtureStore ¶
func NewEventsSaveFixtureStore(db *sql.DB) *EventsSaveFixtureStore
NewEventsSaveFixtureStore creates a new instance of EventsSaveFixtureStore using a SQL database.
func (*EventsSaveFixtureStore) Count ¶
func (s *EventsSaveFixtureStore) Count(q *EventsSaveFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*EventsSaveFixtureStore) Debug ¶ added in v1.1.4
func (s *EventsSaveFixtureStore) Debug() *EventsSaveFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*EventsSaveFixtureStore) DebugWith ¶ added in v1.1.4
func (s *EventsSaveFixtureStore) DebugWith(logger kallax.LoggerFunc) *EventsSaveFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*EventsSaveFixtureStore) Delete ¶
func (s *EventsSaveFixtureStore) Delete(record *EventsSaveFixture) error
Delete removes the given record from the database.
func (*EventsSaveFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *EventsSaveFixtureStore) DisableCacher() *EventsSaveFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*EventsSaveFixtureStore) Find ¶
func (s *EventsSaveFixtureStore) Find(q *EventsSaveFixtureQuery) (*EventsSaveFixtureResultSet, error)
Find returns the set of results for the given query.
func (*EventsSaveFixtureStore) FindAll ¶ added in v1.2.1
func (s *EventsSaveFixtureStore) FindAll(q *EventsSaveFixtureQuery) ([]*EventsSaveFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*EventsSaveFixtureStore) FindOne ¶
func (s *EventsSaveFixtureStore) FindOne(q *EventsSaveFixtureQuery) (*EventsSaveFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*EventsSaveFixtureStore) GenericStore ¶ added in v1.1.0
func (s *EventsSaveFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*EventsSaveFixtureStore) Insert ¶
func (s *EventsSaveFixtureStore) Insert(record *EventsSaveFixture) error
Insert inserts a EventsSaveFixture in the database. A non-persisted object is required for this operation.
func (*EventsSaveFixtureStore) MustCount ¶
func (s *EventsSaveFixtureStore) MustCount(q *EventsSaveFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*EventsSaveFixtureStore) MustFind ¶
func (s *EventsSaveFixtureStore) MustFind(q *EventsSaveFixtureQuery) *EventsSaveFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*EventsSaveFixtureStore) MustFindOne ¶
func (s *EventsSaveFixtureStore) MustFindOne(q *EventsSaveFixtureQuery) *EventsSaveFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*EventsSaveFixtureStore) Reload ¶
func (s *EventsSaveFixtureStore) Reload(record *EventsSaveFixture) error
Reload refreshes the EventsSaveFixture with the data in the database and makes it writable.
func (*EventsSaveFixtureStore) Save ¶
func (s *EventsSaveFixtureStore) Save(record *EventsSaveFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*EventsSaveFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *EventsSaveFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*EventsSaveFixtureStore) Transaction ¶
func (s *EventsSaveFixtureStore) Transaction(callback func(*EventsSaveFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*EventsSaveFixtureStore) Update ¶
func (s *EventsSaveFixtureStore) Update(record *EventsSaveFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type JSONModel ¶ added in v0.13.0
type JSONModel struct { kallax.Model `table:"jsons"` ID kallax.ULID `pk:""` Foo string Bar *Bar BazSlice []Baz Baz map[string]interface{} }
func NewJSONModel ¶ added in v0.13.0
func NewJSONModel() (record *JSONModel)
NewJSONModel returns a new instance of JSONModel.
func (*JSONModel) ColumnAddress ¶ added in v0.13.0
ColumnAddress returns the pointer to the value of the given column.
func (*JSONModel) GetID ¶ added in v0.13.0
func (r *JSONModel) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*JSONModel) NewRelationshipRecord ¶ added in v0.13.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*JSONModel) SetRelationship ¶ added in v0.13.0
SetRelationship sets the given relationship in the given field.
type JSONModelQuery ¶ added in v0.13.0
type JSONModelQuery struct {
*kallax.BaseQuery
}
JSONModelQuery is the object used to create queries for the JSONModel entity.
func NewJSONModelQuery ¶ added in v0.13.0
func NewJSONModelQuery() *JSONModelQuery
NewJSONModelQuery returns a new instance of JSONModelQuery.
func (*JSONModelQuery) BatchSize ¶ added in v0.13.0
func (q *JSONModelQuery) BatchSize(size uint64) *JSONModelQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*JSONModelQuery) Copy ¶ added in v0.13.0
func (q *JSONModelQuery) Copy() *JSONModelQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*JSONModelQuery) FindByFoo ¶ added in v1.0.0
func (q *JSONModelQuery) FindByFoo(v string) *JSONModelQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*JSONModelQuery) FindByID ¶ added in v1.0.0
func (q *JSONModelQuery) FindByID(v ...kallax.ULID) *JSONModelQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*JSONModelQuery) Limit ¶ added in v0.13.0
func (q *JSONModelQuery) Limit(n uint64) *JSONModelQuery
Limit sets the max number of items to retrieve.
func (*JSONModelQuery) Offset ¶ added in v0.13.0
func (q *JSONModelQuery) Offset(n uint64) *JSONModelQuery
Offset sets the number of items to skip from the result set of items.
func (*JSONModelQuery) Order ¶ added in v0.13.0
func (q *JSONModelQuery) Order(cols ...kallax.ColumnOrder) *JSONModelQuery
Order adds order clauses to the query for the given columns.
func (*JSONModelQuery) Select ¶ added in v0.13.0
func (q *JSONModelQuery) Select(columns ...kallax.SchemaField) *JSONModelQuery
Select adds columns to select in the query.
func (*JSONModelQuery) SelectNot ¶ added in v0.13.0
func (q *JSONModelQuery) SelectNot(columns ...kallax.SchemaField) *JSONModelQuery
SelectNot excludes columns from being selected in the query.
func (*JSONModelQuery) Where ¶ added in v0.13.0
func (q *JSONModelQuery) Where(cond kallax.Condition) *JSONModelQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type JSONModelResultSet ¶ added in v0.13.0
type JSONModelResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
JSONModelResultSet is the set of results returned by a query to the database.
func NewJSONModelResultSet ¶ added in v0.13.0
func NewJSONModelResultSet(rs kallax.ResultSet) *JSONModelResultSet
NewJSONModelResultSet creates a new result set for rows of the type JSONModel.
func (*JSONModelResultSet) All ¶ added in v0.13.0
func (rs *JSONModelResultSet) All() ([]*JSONModel, error)
All returns all records on the result set and closes the result set.
func (*JSONModelResultSet) Close ¶ added in v0.13.0
func (rs *JSONModelResultSet) Close() error
Close closes the result set.
func (*JSONModelResultSet) Err ¶ added in v0.13.0
func (rs *JSONModelResultSet) Err() error
Err returns the last error occurred.
func (*JSONModelResultSet) ForEach ¶ added in v0.13.0
func (rs *JSONModelResultSet) ForEach(fn func(*JSONModel) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*JSONModelResultSet) Get ¶ added in v0.13.0
func (rs *JSONModelResultSet) Get() (*JSONModel, error)
Get retrieves the last fetched item from the result set and the last error.
func (*JSONModelResultSet) Next ¶ added in v0.13.0
func (rs *JSONModelResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*JSONModelResultSet) One ¶ added in v0.13.0
func (rs *JSONModelResultSet) One() (*JSONModel, error)
One returns the first record on the result set and closes the result set.
type JSONModelStore ¶ added in v0.13.0
type JSONModelStore struct {
*kallax.Store
}
JSONModelStore is the entity to access the records of the type JSONModel in the database.
func NewJSONModelStore ¶ added in v0.13.0
func NewJSONModelStore(db *sql.DB) *JSONModelStore
NewJSONModelStore creates a new instance of JSONModelStore using a SQL database.
func (*JSONModelStore) Count ¶ added in v0.13.0
func (s *JSONModelStore) Count(q *JSONModelQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*JSONModelStore) Debug ¶ added in v1.1.4
func (s *JSONModelStore) Debug() *JSONModelStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*JSONModelStore) DebugWith ¶ added in v1.1.4
func (s *JSONModelStore) DebugWith(logger kallax.LoggerFunc) *JSONModelStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*JSONModelStore) Delete ¶ added in v0.13.0
func (s *JSONModelStore) Delete(record *JSONModel) error
Delete removes the given record from the database.
func (*JSONModelStore) DisableCacher ¶ added in v1.3.4
func (s *JSONModelStore) DisableCacher() *JSONModelStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*JSONModelStore) Find ¶ added in v0.13.0
func (s *JSONModelStore) Find(q *JSONModelQuery) (*JSONModelResultSet, error)
Find returns the set of results for the given query.
func (*JSONModelStore) FindAll ¶ added in v1.2.1
func (s *JSONModelStore) FindAll(q *JSONModelQuery) ([]*JSONModel, error)
FindAll returns a list of all the rows returned by the given query.
func (*JSONModelStore) FindOne ¶ added in v0.13.0
func (s *JSONModelStore) FindOne(q *JSONModelQuery) (*JSONModel, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*JSONModelStore) GenericStore ¶ added in v1.1.0
func (s *JSONModelStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*JSONModelStore) Insert ¶ added in v0.13.0
func (s *JSONModelStore) Insert(record *JSONModel) error
Insert inserts a JSONModel in the database. A non-persisted object is required for this operation.
func (*JSONModelStore) MustCount ¶ added in v0.13.0
func (s *JSONModelStore) MustCount(q *JSONModelQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*JSONModelStore) MustFind ¶ added in v0.13.0
func (s *JSONModelStore) MustFind(q *JSONModelQuery) *JSONModelResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*JSONModelStore) MustFindOne ¶ added in v0.13.0
func (s *JSONModelStore) MustFindOne(q *JSONModelQuery) *JSONModel
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*JSONModelStore) Reload ¶ added in v0.13.0
func (s *JSONModelStore) Reload(record *JSONModel) error
Reload refreshes the JSONModel with the data in the database and makes it writable.
func (*JSONModelStore) Save ¶ added in v0.13.0
func (s *JSONModelStore) Save(record *JSONModel) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*JSONModelStore) SetGenericStore ¶ added in v1.1.0
func (s *JSONModelStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*JSONModelStore) Transaction ¶ added in v0.13.0
func (s *JSONModelStore) Transaction(callback func(*JSONModelStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*JSONModelStore) Update ¶ added in v0.13.0
func (s *JSONModelStore) Update(record *JSONModel, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type MultiKeySortFixture ¶
type MultiKeySortFixture struct { kallax.Model `table:"query"` ID kallax.ULID `pk:""` Name string Start time.Time End time.Time }
func NewMultiKeySortFixture ¶
func NewMultiKeySortFixture() (record *MultiKeySortFixture)
NewMultiKeySortFixture returns a new instance of MultiKeySortFixture.
func (*MultiKeySortFixture) ColumnAddress ¶
func (r *MultiKeySortFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*MultiKeySortFixture) GetID ¶ added in v0.13.0
func (r *MultiKeySortFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*MultiKeySortFixture) NewRelationshipRecord ¶
func (r *MultiKeySortFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*MultiKeySortFixture) SetRelationship ¶
func (r *MultiKeySortFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*MultiKeySortFixture) Value ¶
func (r *MultiKeySortFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type MultiKeySortFixtureQuery ¶
type MultiKeySortFixtureQuery struct {
*kallax.BaseQuery
}
MultiKeySortFixtureQuery is the object used to create queries for the MultiKeySortFixture entity.
func NewMultiKeySortFixtureQuery ¶
func NewMultiKeySortFixtureQuery() *MultiKeySortFixtureQuery
NewMultiKeySortFixtureQuery returns a new instance of MultiKeySortFixtureQuery.
func (*MultiKeySortFixtureQuery) BatchSize ¶
func (q *MultiKeySortFixtureQuery) BatchSize(size uint64) *MultiKeySortFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*MultiKeySortFixtureQuery) Copy ¶
func (q *MultiKeySortFixtureQuery) Copy() *MultiKeySortFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*MultiKeySortFixtureQuery) FindByEnd ¶ added in v1.0.0
func (q *MultiKeySortFixtureQuery) FindByEnd(cond kallax.ScalarCond, v time.Time) *MultiKeySortFixtureQuery
FindByEnd adds a new filter to the query that will require that the End property is equal to the passed value.
func (*MultiKeySortFixtureQuery) FindByID ¶ added in v1.0.0
func (q *MultiKeySortFixtureQuery) FindByID(v ...kallax.ULID) *MultiKeySortFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*MultiKeySortFixtureQuery) FindByName ¶ added in v1.0.0
func (q *MultiKeySortFixtureQuery) FindByName(v string) *MultiKeySortFixtureQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*MultiKeySortFixtureQuery) FindByStart ¶ added in v1.0.0
func (q *MultiKeySortFixtureQuery) FindByStart(cond kallax.ScalarCond, v time.Time) *MultiKeySortFixtureQuery
FindByStart adds a new filter to the query that will require that the Start property is equal to the passed value.
func (*MultiKeySortFixtureQuery) Limit ¶
func (q *MultiKeySortFixtureQuery) Limit(n uint64) *MultiKeySortFixtureQuery
Limit sets the max number of items to retrieve.
func (*MultiKeySortFixtureQuery) Offset ¶
func (q *MultiKeySortFixtureQuery) Offset(n uint64) *MultiKeySortFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*MultiKeySortFixtureQuery) Order ¶
func (q *MultiKeySortFixtureQuery) Order(cols ...kallax.ColumnOrder) *MultiKeySortFixtureQuery
Order adds order clauses to the query for the given columns.
func (*MultiKeySortFixtureQuery) Select ¶
func (q *MultiKeySortFixtureQuery) Select(columns ...kallax.SchemaField) *MultiKeySortFixtureQuery
Select adds columns to select in the query.
func (*MultiKeySortFixtureQuery) SelectNot ¶
func (q *MultiKeySortFixtureQuery) SelectNot(columns ...kallax.SchemaField) *MultiKeySortFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*MultiKeySortFixtureQuery) Where ¶
func (q *MultiKeySortFixtureQuery) Where(cond kallax.Condition) *MultiKeySortFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type MultiKeySortFixtureResultSet ¶
type MultiKeySortFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
MultiKeySortFixtureResultSet is the set of results returned by a query to the database.
func NewMultiKeySortFixtureResultSet ¶
func NewMultiKeySortFixtureResultSet(rs kallax.ResultSet) *MultiKeySortFixtureResultSet
NewMultiKeySortFixtureResultSet creates a new result set for rows of the type MultiKeySortFixture.
func (*MultiKeySortFixtureResultSet) All ¶
func (rs *MultiKeySortFixtureResultSet) All() ([]*MultiKeySortFixture, error)
All returns all records on the result set and closes the result set.
func (*MultiKeySortFixtureResultSet) Close ¶ added in v0.12.0
func (rs *MultiKeySortFixtureResultSet) Close() error
Close closes the result set.
func (*MultiKeySortFixtureResultSet) Err ¶ added in v0.12.0
func (rs *MultiKeySortFixtureResultSet) Err() error
Err returns the last error occurred.
func (*MultiKeySortFixtureResultSet) ForEach ¶
func (rs *MultiKeySortFixtureResultSet) ForEach(fn func(*MultiKeySortFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*MultiKeySortFixtureResultSet) Get ¶
func (rs *MultiKeySortFixtureResultSet) Get() (*MultiKeySortFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*MultiKeySortFixtureResultSet) Next ¶
func (rs *MultiKeySortFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*MultiKeySortFixtureResultSet) One ¶
func (rs *MultiKeySortFixtureResultSet) One() (*MultiKeySortFixture, error)
One returns the first record on the result set and closes the result set.
type MultiKeySortFixtureStore ¶
type MultiKeySortFixtureStore struct {
*kallax.Store
}
MultiKeySortFixtureStore is the entity to access the records of the type MultiKeySortFixture in the database.
func NewMultiKeySortFixtureStore ¶
func NewMultiKeySortFixtureStore(db *sql.DB) *MultiKeySortFixtureStore
NewMultiKeySortFixtureStore creates a new instance of MultiKeySortFixtureStore using a SQL database.
func (*MultiKeySortFixtureStore) Count ¶
func (s *MultiKeySortFixtureStore) Count(q *MultiKeySortFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*MultiKeySortFixtureStore) Debug ¶ added in v1.1.4
func (s *MultiKeySortFixtureStore) Debug() *MultiKeySortFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*MultiKeySortFixtureStore) DebugWith ¶ added in v1.1.4
func (s *MultiKeySortFixtureStore) DebugWith(logger kallax.LoggerFunc) *MultiKeySortFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*MultiKeySortFixtureStore) Delete ¶
func (s *MultiKeySortFixtureStore) Delete(record *MultiKeySortFixture) error
Delete removes the given record from the database.
func (*MultiKeySortFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *MultiKeySortFixtureStore) DisableCacher() *MultiKeySortFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*MultiKeySortFixtureStore) Find ¶
func (s *MultiKeySortFixtureStore) Find(q *MultiKeySortFixtureQuery) (*MultiKeySortFixtureResultSet, error)
Find returns the set of results for the given query.
func (*MultiKeySortFixtureStore) FindAll ¶ added in v1.2.1
func (s *MultiKeySortFixtureStore) FindAll(q *MultiKeySortFixtureQuery) ([]*MultiKeySortFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*MultiKeySortFixtureStore) FindOne ¶
func (s *MultiKeySortFixtureStore) FindOne(q *MultiKeySortFixtureQuery) (*MultiKeySortFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*MultiKeySortFixtureStore) GenericStore ¶ added in v1.1.0
func (s *MultiKeySortFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*MultiKeySortFixtureStore) Insert ¶
func (s *MultiKeySortFixtureStore) Insert(record *MultiKeySortFixture) error
Insert inserts a MultiKeySortFixture in the database. A non-persisted object is required for this operation.
func (*MultiKeySortFixtureStore) MustCount ¶
func (s *MultiKeySortFixtureStore) MustCount(q *MultiKeySortFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*MultiKeySortFixtureStore) MustFind ¶
func (s *MultiKeySortFixtureStore) MustFind(q *MultiKeySortFixtureQuery) *MultiKeySortFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*MultiKeySortFixtureStore) MustFindOne ¶
func (s *MultiKeySortFixtureStore) MustFindOne(q *MultiKeySortFixtureQuery) *MultiKeySortFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*MultiKeySortFixtureStore) Reload ¶
func (s *MultiKeySortFixtureStore) Reload(record *MultiKeySortFixture) error
Reload refreshes the MultiKeySortFixture with the data in the database and makes it writable.
func (*MultiKeySortFixtureStore) Save ¶
func (s *MultiKeySortFixtureStore) Save(record *MultiKeySortFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*MultiKeySortFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *MultiKeySortFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*MultiKeySortFixtureStore) Transaction ¶
func (s *MultiKeySortFixtureStore) Transaction(callback func(*MultiKeySortFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*MultiKeySortFixtureStore) Update ¶
func (s *MultiKeySortFixtureStore) Update(record *MultiKeySortFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Nullable ¶ added in v1.0.0
type Nullable struct { kallax.Model `table:"nullable"` ID int64 `pk:"autoincr"` T *time.Time SomeJSON *SomeJSON Scanner *kallax.ULID }
func NewNullable ¶ added in v1.0.0
func NewNullable() (record *Nullable)
NewNullable returns a new instance of Nullable.
func (*Nullable) ColumnAddress ¶ added in v1.0.0
ColumnAddress returns the pointer to the value of the given column.
func (*Nullable) GetID ¶ added in v1.0.0
func (r *Nullable) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Nullable) NewRelationshipRecord ¶ added in v1.0.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Nullable) SetRelationship ¶ added in v1.0.0
SetRelationship sets the given relationship in the given field.
type NullableQuery ¶ added in v1.0.0
type NullableQuery struct {
*kallax.BaseQuery
}
NullableQuery is the object used to create queries for the Nullable entity.
func NewNullableQuery ¶ added in v1.0.0
func NewNullableQuery() *NullableQuery
NewNullableQuery returns a new instance of NullableQuery.
func (*NullableQuery) BatchSize ¶ added in v1.0.0
func (q *NullableQuery) BatchSize(size uint64) *NullableQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*NullableQuery) Copy ¶ added in v1.0.0
func (q *NullableQuery) Copy() *NullableQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*NullableQuery) FindByID ¶ added in v1.0.0
func (q *NullableQuery) FindByID(v ...int64) *NullableQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*NullableQuery) FindByScanner ¶ added in v1.0.0
func (q *NullableQuery) FindByScanner(v kallax.ULID) *NullableQuery
FindByScanner adds a new filter to the query that will require that the Scanner property is equal to the passed value.
func (*NullableQuery) FindByT ¶ added in v1.0.0
func (q *NullableQuery) FindByT(cond kallax.ScalarCond, v time.Time) *NullableQuery
FindByT adds a new filter to the query that will require that the T property is equal to the passed value.
func (*NullableQuery) Limit ¶ added in v1.0.0
func (q *NullableQuery) Limit(n uint64) *NullableQuery
Limit sets the max number of items to retrieve.
func (*NullableQuery) Offset ¶ added in v1.0.0
func (q *NullableQuery) Offset(n uint64) *NullableQuery
Offset sets the number of items to skip from the result set of items.
func (*NullableQuery) Order ¶ added in v1.0.0
func (q *NullableQuery) Order(cols ...kallax.ColumnOrder) *NullableQuery
Order adds order clauses to the query for the given columns.
func (*NullableQuery) Select ¶ added in v1.0.0
func (q *NullableQuery) Select(columns ...kallax.SchemaField) *NullableQuery
Select adds columns to select in the query.
func (*NullableQuery) SelectNot ¶ added in v1.0.0
func (q *NullableQuery) SelectNot(columns ...kallax.SchemaField) *NullableQuery
SelectNot excludes columns from being selected in the query.
func (*NullableQuery) Where ¶ added in v1.0.0
func (q *NullableQuery) Where(cond kallax.Condition) *NullableQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type NullableResultSet ¶ added in v1.0.0
type NullableResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
NullableResultSet is the set of results returned by a query to the database.
func NewNullableResultSet ¶ added in v1.0.0
func NewNullableResultSet(rs kallax.ResultSet) *NullableResultSet
NewNullableResultSet creates a new result set for rows of the type Nullable.
func (*NullableResultSet) All ¶ added in v1.0.0
func (rs *NullableResultSet) All() ([]*Nullable, error)
All returns all records on the result set and closes the result set.
func (*NullableResultSet) Close ¶ added in v1.0.0
func (rs *NullableResultSet) Close() error
Close closes the result set.
func (*NullableResultSet) Err ¶ added in v1.0.0
func (rs *NullableResultSet) Err() error
Err returns the last error occurred.
func (*NullableResultSet) ForEach ¶ added in v1.0.0
func (rs *NullableResultSet) ForEach(fn func(*Nullable) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*NullableResultSet) Get ¶ added in v1.0.0
func (rs *NullableResultSet) Get() (*Nullable, error)
Get retrieves the last fetched item from the result set and the last error.
func (*NullableResultSet) Next ¶ added in v1.0.0
func (rs *NullableResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*NullableResultSet) One ¶ added in v1.0.0
func (rs *NullableResultSet) One() (*Nullable, error)
One returns the first record on the result set and closes the result set.
type NullableStore ¶ added in v1.0.0
type NullableStore struct {
*kallax.Store
}
NullableStore is the entity to access the records of the type Nullable in the database.
func NewNullableStore ¶ added in v1.0.0
func NewNullableStore(db *sql.DB) *NullableStore
NewNullableStore creates a new instance of NullableStore using a SQL database.
func (*NullableStore) Count ¶ added in v1.0.0
func (s *NullableStore) Count(q *NullableQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*NullableStore) Debug ¶ added in v1.1.4
func (s *NullableStore) Debug() *NullableStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*NullableStore) DebugWith ¶ added in v1.1.4
func (s *NullableStore) DebugWith(logger kallax.LoggerFunc) *NullableStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*NullableStore) Delete ¶ added in v1.0.0
func (s *NullableStore) Delete(record *Nullable) error
Delete removes the given record from the database.
func (*NullableStore) DisableCacher ¶ added in v1.3.4
func (s *NullableStore) DisableCacher() *NullableStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*NullableStore) Find ¶ added in v1.0.0
func (s *NullableStore) Find(q *NullableQuery) (*NullableResultSet, error)
Find returns the set of results for the given query.
func (*NullableStore) FindAll ¶ added in v1.2.1
func (s *NullableStore) FindAll(q *NullableQuery) ([]*Nullable, error)
FindAll returns a list of all the rows returned by the given query.
func (*NullableStore) FindOne ¶ added in v1.0.0
func (s *NullableStore) FindOne(q *NullableQuery) (*Nullable, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*NullableStore) GenericStore ¶ added in v1.1.0
func (s *NullableStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*NullableStore) Insert ¶ added in v1.0.0
func (s *NullableStore) Insert(record *Nullable) error
Insert inserts a Nullable in the database. A non-persisted object is required for this operation.
func (*NullableStore) MustCount ¶ added in v1.0.0
func (s *NullableStore) MustCount(q *NullableQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*NullableStore) MustFind ¶ added in v1.0.0
func (s *NullableStore) MustFind(q *NullableQuery) *NullableResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*NullableStore) MustFindOne ¶ added in v1.0.0
func (s *NullableStore) MustFindOne(q *NullableQuery) *Nullable
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*NullableStore) Reload ¶ added in v1.0.0
func (s *NullableStore) Reload(record *Nullable) error
Reload refreshes the Nullable with the data in the database and makes it writable.
func (*NullableStore) Save ¶ added in v1.0.0
func (s *NullableStore) Save(record *Nullable) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*NullableStore) SetGenericStore ¶ added in v1.1.0
func (s *NullableStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*NullableStore) Transaction ¶ added in v1.0.0
func (s *NullableStore) Transaction(callback func(*NullableStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*NullableStore) Update ¶ added in v1.0.0
func (s *NullableStore) Update(record *Nullable, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Parent ¶ added in v1.2.8
type Parent struct { kallax.Model `table:"parents" pk:"id,autoincr"` ID int64 Name string Children []*Child }
func NewParent ¶ added in v1.2.8
func NewParent() (record *Parent)
NewParent returns a new instance of Parent.
func (*Parent) ColumnAddress ¶ added in v1.2.8
ColumnAddress returns the pointer to the value of the given column.
func (*Parent) GetID ¶ added in v1.2.8
func (r *Parent) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Parent) NewRelationshipRecord ¶ added in v1.2.8
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Parent) SetRelationship ¶ added in v1.2.8
SetRelationship sets the given relationship in the given field.
type ParentNoPtr ¶ added in v1.2.9
type ParentNoPtr struct { kallax.Model `table:"parents"` ID int64 `pk:"autoincr"` Name string Children []Child `fk:"parent_id"` }
func NewParentNoPtr ¶ added in v1.2.9
func NewParentNoPtr() (record *ParentNoPtr)
NewParentNoPtr returns a new instance of ParentNoPtr.
func (*ParentNoPtr) ColumnAddress ¶ added in v1.2.9
func (r *ParentNoPtr) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*ParentNoPtr) GetID ¶ added in v1.2.9
func (r *ParentNoPtr) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*ParentNoPtr) NewRelationshipRecord ¶ added in v1.2.9
func (r *ParentNoPtr) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*ParentNoPtr) SetRelationship ¶ added in v1.2.9
func (r *ParentNoPtr) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*ParentNoPtr) Value ¶ added in v1.2.9
func (r *ParentNoPtr) Value(col string) (interface{}, error)
Value returns the value of the given column.
type ParentNoPtrQuery ¶ added in v1.2.9
type ParentNoPtrQuery struct {
*kallax.BaseQuery
}
ParentNoPtrQuery is the object used to create queries for the ParentNoPtr entity.
func NewParentNoPtrQuery ¶ added in v1.2.9
func NewParentNoPtrQuery() *ParentNoPtrQuery
NewParentNoPtrQuery returns a new instance of ParentNoPtrQuery.
func (*ParentNoPtrQuery) BatchSize ¶ added in v1.2.9
func (q *ParentNoPtrQuery) BatchSize(size uint64) *ParentNoPtrQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*ParentNoPtrQuery) Copy ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Copy() *ParentNoPtrQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*ParentNoPtrQuery) FindByID ¶ added in v1.2.9
func (q *ParentNoPtrQuery) FindByID(v ...int64) *ParentNoPtrQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*ParentNoPtrQuery) FindByName ¶ added in v1.2.9
func (q *ParentNoPtrQuery) FindByName(v string) *ParentNoPtrQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*ParentNoPtrQuery) Limit ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Limit(n uint64) *ParentNoPtrQuery
Limit sets the max number of items to retrieve.
func (*ParentNoPtrQuery) Offset ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Offset(n uint64) *ParentNoPtrQuery
Offset sets the number of items to skip from the result set of items.
func (*ParentNoPtrQuery) Order ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Order(cols ...kallax.ColumnOrder) *ParentNoPtrQuery
Order adds order clauses to the query for the given columns.
func (*ParentNoPtrQuery) Select ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Select(columns ...kallax.SchemaField) *ParentNoPtrQuery
Select adds columns to select in the query.
func (*ParentNoPtrQuery) SelectNot ¶ added in v1.2.9
func (q *ParentNoPtrQuery) SelectNot(columns ...kallax.SchemaField) *ParentNoPtrQuery
SelectNot excludes columns from being selected in the query.
func (*ParentNoPtrQuery) Where ¶ added in v1.2.9
func (q *ParentNoPtrQuery) Where(cond kallax.Condition) *ParentNoPtrQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*ParentNoPtrQuery) WithChildren ¶ added in v1.2.9
func (q *ParentNoPtrQuery) WithChildren(cond kallax.Condition) *ParentNoPtrQuery
type ParentNoPtrResultSet ¶ added in v1.2.9
type ParentNoPtrResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
ParentNoPtrResultSet is the set of results returned by a query to the database.
func NewParentNoPtrResultSet ¶ added in v1.2.9
func NewParentNoPtrResultSet(rs kallax.ResultSet) *ParentNoPtrResultSet
NewParentNoPtrResultSet creates a new result set for rows of the type ParentNoPtr.
func (*ParentNoPtrResultSet) All ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) All() ([]*ParentNoPtr, error)
All returns all records on the result set and closes the result set.
func (*ParentNoPtrResultSet) Close ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) Close() error
Close closes the result set.
func (*ParentNoPtrResultSet) Err ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) Err() error
Err returns the last error occurred.
func (*ParentNoPtrResultSet) ForEach ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) ForEach(fn func(*ParentNoPtr) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*ParentNoPtrResultSet) Get ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) Get() (*ParentNoPtr, error)
Get retrieves the last fetched item from the result set and the last error.
func (*ParentNoPtrResultSet) Next ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*ParentNoPtrResultSet) One ¶ added in v1.2.9
func (rs *ParentNoPtrResultSet) One() (*ParentNoPtr, error)
One returns the first record on the result set and closes the result set.
type ParentNoPtrStore ¶ added in v1.2.9
type ParentNoPtrStore struct {
*kallax.Store
}
ParentNoPtrStore is the entity to access the records of the type ParentNoPtr in the database.
func NewParentNoPtrStore ¶ added in v1.2.9
func NewParentNoPtrStore(db *sql.DB) *ParentNoPtrStore
NewParentNoPtrStore creates a new instance of ParentNoPtrStore using a SQL database.
func (*ParentNoPtrStore) Count ¶ added in v1.2.9
func (s *ParentNoPtrStore) Count(q *ParentNoPtrQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*ParentNoPtrStore) Debug ¶ added in v1.2.9
func (s *ParentNoPtrStore) Debug() *ParentNoPtrStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*ParentNoPtrStore) DebugWith ¶ added in v1.2.9
func (s *ParentNoPtrStore) DebugWith(logger kallax.LoggerFunc) *ParentNoPtrStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*ParentNoPtrStore) Delete ¶ added in v1.2.9
func (s *ParentNoPtrStore) Delete(record *ParentNoPtr) error
Delete removes the given record from the database.
func (*ParentNoPtrStore) DisableCacher ¶ added in v1.3.4
func (s *ParentNoPtrStore) DisableCacher() *ParentNoPtrStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*ParentNoPtrStore) Find ¶ added in v1.2.9
func (s *ParentNoPtrStore) Find(q *ParentNoPtrQuery) (*ParentNoPtrResultSet, error)
Find returns the set of results for the given query.
func (*ParentNoPtrStore) FindAll ¶ added in v1.2.9
func (s *ParentNoPtrStore) FindAll(q *ParentNoPtrQuery) ([]*ParentNoPtr, error)
FindAll returns a list of all the rows returned by the given query.
func (*ParentNoPtrStore) FindOne ¶ added in v1.2.9
func (s *ParentNoPtrStore) FindOne(q *ParentNoPtrQuery) (*ParentNoPtr, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*ParentNoPtrStore) GenericStore ¶ added in v1.2.9
func (s *ParentNoPtrStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*ParentNoPtrStore) Insert ¶ added in v1.2.9
func (s *ParentNoPtrStore) Insert(record *ParentNoPtr) error
Insert inserts a ParentNoPtr in the database. A non-persisted object is required for this operation.
func (*ParentNoPtrStore) MustCount ¶ added in v1.2.9
func (s *ParentNoPtrStore) MustCount(q *ParentNoPtrQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*ParentNoPtrStore) MustFind ¶ added in v1.2.9
func (s *ParentNoPtrStore) MustFind(q *ParentNoPtrQuery) *ParentNoPtrResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*ParentNoPtrStore) MustFindOne ¶ added in v1.2.9
func (s *ParentNoPtrStore) MustFindOne(q *ParentNoPtrQuery) *ParentNoPtr
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*ParentNoPtrStore) Reload ¶ added in v1.2.9
func (s *ParentNoPtrStore) Reload(record *ParentNoPtr) error
Reload refreshes the ParentNoPtr with the data in the database and makes it writable.
func (*ParentNoPtrStore) RemoveChildren ¶ added in v1.2.9
func (s *ParentNoPtrStore) RemoveChildren(record *ParentNoPtr, deleted ...Child) error
RemoveChildren removes the given items of the Children field of the model. If no items are given, it removes all of them. The items will also be removed from the passed record inside this method. Note that is required that `Children` is not empty. This method clears the the elements of Children in a model, it does not retrieve them to know what relationships the model has.
func (*ParentNoPtrStore) Save ¶ added in v1.2.9
func (s *ParentNoPtrStore) Save(record *ParentNoPtr) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*ParentNoPtrStore) SetGenericStore ¶ added in v1.2.9
func (s *ParentNoPtrStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*ParentNoPtrStore) Transaction ¶ added in v1.2.9
func (s *ParentNoPtrStore) Transaction(callback func(*ParentNoPtrStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*ParentNoPtrStore) Update ¶ added in v1.2.9
func (s *ParentNoPtrStore) Update(record *ParentNoPtr, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type ParentQuery ¶ added in v1.2.8
type ParentQuery struct {
*kallax.BaseQuery
}
ParentQuery is the object used to create queries for the Parent entity.
func NewParentQuery ¶ added in v1.2.8
func NewParentQuery() *ParentQuery
NewParentQuery returns a new instance of ParentQuery.
func (*ParentQuery) BatchSize ¶ added in v1.2.8
func (q *ParentQuery) BatchSize(size uint64) *ParentQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*ParentQuery) Copy ¶ added in v1.2.8
func (q *ParentQuery) Copy() *ParentQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*ParentQuery) FindByID ¶ added in v1.2.8
func (q *ParentQuery) FindByID(v ...int64) *ParentQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*ParentQuery) FindByName ¶ added in v1.2.8
func (q *ParentQuery) FindByName(v string) *ParentQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*ParentQuery) Limit ¶ added in v1.2.8
func (q *ParentQuery) Limit(n uint64) *ParentQuery
Limit sets the max number of items to retrieve.
func (*ParentQuery) Offset ¶ added in v1.2.8
func (q *ParentQuery) Offset(n uint64) *ParentQuery
Offset sets the number of items to skip from the result set of items.
func (*ParentQuery) Order ¶ added in v1.2.8
func (q *ParentQuery) Order(cols ...kallax.ColumnOrder) *ParentQuery
Order adds order clauses to the query for the given columns.
func (*ParentQuery) Select ¶ added in v1.2.8
func (q *ParentQuery) Select(columns ...kallax.SchemaField) *ParentQuery
Select adds columns to select in the query.
func (*ParentQuery) SelectNot ¶ added in v1.2.8
func (q *ParentQuery) SelectNot(columns ...kallax.SchemaField) *ParentQuery
SelectNot excludes columns from being selected in the query.
func (*ParentQuery) Where ¶ added in v1.2.8
func (q *ParentQuery) Where(cond kallax.Condition) *ParentQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*ParentQuery) WithChildren ¶ added in v1.2.8
func (q *ParentQuery) WithChildren(cond kallax.Condition) *ParentQuery
type ParentResultSet ¶ added in v1.2.8
type ParentResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
ParentResultSet is the set of results returned by a query to the database.
func NewParentResultSet ¶ added in v1.2.8
func NewParentResultSet(rs kallax.ResultSet) *ParentResultSet
NewParentResultSet creates a new result set for rows of the type Parent.
func (*ParentResultSet) All ¶ added in v1.2.8
func (rs *ParentResultSet) All() ([]*Parent, error)
All returns all records on the result set and closes the result set.
func (*ParentResultSet) Close ¶ added in v1.2.8
func (rs *ParentResultSet) Close() error
Close closes the result set.
func (*ParentResultSet) Err ¶ added in v1.2.8
func (rs *ParentResultSet) Err() error
Err returns the last error occurred.
func (*ParentResultSet) ForEach ¶ added in v1.2.8
func (rs *ParentResultSet) ForEach(fn func(*Parent) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*ParentResultSet) Get ¶ added in v1.2.8
func (rs *ParentResultSet) Get() (*Parent, error)
Get retrieves the last fetched item from the result set and the last error.
func (*ParentResultSet) Next ¶ added in v1.2.8
func (rs *ParentResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*ParentResultSet) One ¶ added in v1.2.8
func (rs *ParentResultSet) One() (*Parent, error)
One returns the first record on the result set and closes the result set.
type ParentStore ¶ added in v1.2.8
type ParentStore struct {
*kallax.Store
}
ParentStore is the entity to access the records of the type Parent in the database.
func NewParentStore ¶ added in v1.2.8
func NewParentStore(db *sql.DB) *ParentStore
NewParentStore creates a new instance of ParentStore using a SQL database.
func (*ParentStore) Count ¶ added in v1.2.8
func (s *ParentStore) Count(q *ParentQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*ParentStore) Debug ¶ added in v1.2.8
func (s *ParentStore) Debug() *ParentStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*ParentStore) DebugWith ¶ added in v1.2.8
func (s *ParentStore) DebugWith(logger kallax.LoggerFunc) *ParentStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*ParentStore) Delete ¶ added in v1.2.8
func (s *ParentStore) Delete(record *Parent) error
Delete removes the given record from the database.
func (*ParentStore) DisableCacher ¶ added in v1.3.4
func (s *ParentStore) DisableCacher() *ParentStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*ParentStore) Find ¶ added in v1.2.8
func (s *ParentStore) Find(q *ParentQuery) (*ParentResultSet, error)
Find returns the set of results for the given query.
func (*ParentStore) FindAll ¶ added in v1.2.8
func (s *ParentStore) FindAll(q *ParentQuery) ([]*Parent, error)
FindAll returns a list of all the rows returned by the given query.
func (*ParentStore) FindOne ¶ added in v1.2.8
func (s *ParentStore) FindOne(q *ParentQuery) (*Parent, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*ParentStore) GenericStore ¶ added in v1.2.8
func (s *ParentStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*ParentStore) Insert ¶ added in v1.2.8
func (s *ParentStore) Insert(record *Parent) error
Insert inserts a Parent in the database. A non-persisted object is required for this operation.
func (*ParentStore) MustCount ¶ added in v1.2.8
func (s *ParentStore) MustCount(q *ParentQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*ParentStore) MustFind ¶ added in v1.2.8
func (s *ParentStore) MustFind(q *ParentQuery) *ParentResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*ParentStore) MustFindOne ¶ added in v1.2.8
func (s *ParentStore) MustFindOne(q *ParentQuery) *Parent
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*ParentStore) Reload ¶ added in v1.2.8
func (s *ParentStore) Reload(record *Parent) error
Reload refreshes the Parent with the data in the database and makes it writable.
func (*ParentStore) RemoveChildren ¶ added in v1.2.8
func (s *ParentStore) RemoveChildren(record *Parent, deleted ...*Child) error
RemoveChildren removes the given items of the Children field of the model. If no items are given, it removes all of them. The items will also be removed from the passed record inside this method. Note that is required that `Children` is not empty. This method clears the the elements of Children in a model, it does not retrieve them to know what relationships the model has.
func (*ParentStore) Save ¶ added in v1.2.8
func (s *ParentStore) Save(record *Parent) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*ParentStore) SetGenericStore ¶ added in v1.2.8
func (s *ParentStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*ParentStore) Transaction ¶ added in v1.2.8
func (s *ParentStore) Transaction(callback func(*ParentStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*ParentStore) Update ¶ added in v1.2.8
func (s *ParentStore) Update(record *Parent, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Person ¶ added in v0.12.0
type Person struct { kallax.Model `table:"persons"` ID int64 `pk:"autoincr"` Name string Pets []*Pet `fk:"owner_id"` PetsArr [2]*Pet `fk:"owner_id"` Car *Car `fk:"owner_id"` // contains filtered or unexported fields }
func (*Person) AfterDelete ¶ added in v0.13.0
func (*Person) BeforeDelete ¶ added in v0.13.0
func (*Person) BeforeSave ¶ added in v0.13.0
func (*Person) ColumnAddress ¶ added in v0.12.0
ColumnAddress returns the pointer to the value of the given column.
func (*Person) GetID ¶ added in v0.13.0
func (r *Person) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Person) NewRelationshipRecord ¶ added in v0.12.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Person) SetRelationship ¶ added in v0.12.0
SetRelationship sets the given relationship in the given field.
type PersonQuery ¶ added in v0.12.0
type PersonQuery struct {
*kallax.BaseQuery
}
PersonQuery is the object used to create queries for the Person entity.
func NewPersonQuery ¶ added in v0.12.0
func NewPersonQuery() *PersonQuery
NewPersonQuery returns a new instance of PersonQuery.
func (*PersonQuery) BatchSize ¶ added in v0.12.0
func (q *PersonQuery) BatchSize(size uint64) *PersonQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*PersonQuery) Copy ¶ added in v0.12.0
func (q *PersonQuery) Copy() *PersonQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*PersonQuery) FindByID ¶ added in v1.0.0
func (q *PersonQuery) FindByID(v ...int64) *PersonQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*PersonQuery) FindByName ¶ added in v1.0.0
func (q *PersonQuery) FindByName(v string) *PersonQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*PersonQuery) Limit ¶ added in v0.12.0
func (q *PersonQuery) Limit(n uint64) *PersonQuery
Limit sets the max number of items to retrieve.
func (*PersonQuery) Offset ¶ added in v0.12.0
func (q *PersonQuery) Offset(n uint64) *PersonQuery
Offset sets the number of items to skip from the result set of items.
func (*PersonQuery) Order ¶ added in v0.12.0
func (q *PersonQuery) Order(cols ...kallax.ColumnOrder) *PersonQuery
Order adds order clauses to the query for the given columns.
func (*PersonQuery) Select ¶ added in v0.12.0
func (q *PersonQuery) Select(columns ...kallax.SchemaField) *PersonQuery
Select adds columns to select in the query.
func (*PersonQuery) SelectNot ¶ added in v0.12.0
func (q *PersonQuery) SelectNot(columns ...kallax.SchemaField) *PersonQuery
SelectNot excludes columns from being selected in the query.
func (*PersonQuery) Where ¶ added in v0.12.0
func (q *PersonQuery) Where(cond kallax.Condition) *PersonQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*PersonQuery) WithCar ¶ added in v0.12.0
func (q *PersonQuery) WithCar() *PersonQuery
func (*PersonQuery) WithPets ¶ added in v0.12.0
func (q *PersonQuery) WithPets(cond kallax.Condition) *PersonQuery
type PersonResultSet ¶ added in v0.12.0
type PersonResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
PersonResultSet is the set of results returned by a query to the database.
func NewPersonResultSet ¶ added in v0.12.0
func NewPersonResultSet(rs kallax.ResultSet) *PersonResultSet
NewPersonResultSet creates a new result set for rows of the type Person.
func (*PersonResultSet) All ¶ added in v0.12.0
func (rs *PersonResultSet) All() ([]*Person, error)
All returns all records on the result set and closes the result set.
func (*PersonResultSet) Close ¶ added in v0.12.0
func (rs *PersonResultSet) Close() error
Close closes the result set.
func (*PersonResultSet) Err ¶ added in v0.12.0
func (rs *PersonResultSet) Err() error
Err returns the last error occurred.
func (*PersonResultSet) ForEach ¶ added in v0.12.0
func (rs *PersonResultSet) ForEach(fn func(*Person) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*PersonResultSet) Get ¶ added in v0.12.0
func (rs *PersonResultSet) Get() (*Person, error)
Get retrieves the last fetched item from the result set and the last error.
func (*PersonResultSet) Next ¶ added in v0.12.0
func (rs *PersonResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*PersonResultSet) One ¶ added in v0.12.0
func (rs *PersonResultSet) One() (*Person, error)
One returns the first record on the result set and closes the result set.
type PersonStore ¶ added in v0.12.0
type PersonStore struct {
*kallax.Store
}
PersonStore is the entity to access the records of the type Person in the database.
func NewPersonStore ¶ added in v0.12.0
func NewPersonStore(db *sql.DB) *PersonStore
NewPersonStore creates a new instance of PersonStore using a SQL database.
func (*PersonStore) Count ¶ added in v0.12.0
func (s *PersonStore) Count(q *PersonQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*PersonStore) Debug ¶ added in v1.1.4
func (s *PersonStore) Debug() *PersonStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*PersonStore) DebugWith ¶ added in v1.1.4
func (s *PersonStore) DebugWith(logger kallax.LoggerFunc) *PersonStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*PersonStore) Delete ¶ added in v0.12.0
func (s *PersonStore) Delete(record *Person) error
Delete removes the given record from the database.
func (*PersonStore) DisableCacher ¶ added in v1.3.4
func (s *PersonStore) DisableCacher() *PersonStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*PersonStore) Find ¶ added in v0.12.0
func (s *PersonStore) Find(q *PersonQuery) (*PersonResultSet, error)
Find returns the set of results for the given query.
func (*PersonStore) FindAll ¶ added in v1.2.1
func (s *PersonStore) FindAll(q *PersonQuery) ([]*Person, error)
FindAll returns a list of all the rows returned by the given query.
func (*PersonStore) FindOne ¶ added in v0.12.0
func (s *PersonStore) FindOne(q *PersonQuery) (*Person, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*PersonStore) GenericStore ¶ added in v1.1.0
func (s *PersonStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*PersonStore) Insert ¶ added in v0.12.0
func (s *PersonStore) Insert(record *Person) error
Insert inserts a Person in the database. A non-persisted object is required for this operation.
func (*PersonStore) MustCount ¶ added in v0.12.0
func (s *PersonStore) MustCount(q *PersonQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*PersonStore) MustFind ¶ added in v0.12.0
func (s *PersonStore) MustFind(q *PersonQuery) *PersonResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*PersonStore) MustFindOne ¶ added in v0.12.0
func (s *PersonStore) MustFindOne(q *PersonQuery) *Person
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*PersonStore) Reload ¶ added in v0.12.0
func (s *PersonStore) Reload(record *Person) error
Reload refreshes the Person with the data in the database and makes it writable.
func (*PersonStore) RemoveCar ¶ added in v0.12.0
func (s *PersonStore) RemoveCar(record *Person) error
RemoveCar removes from the database the given relationship of the model. It also resets the field Car of the model.
func (*PersonStore) RemovePets ¶ added in v0.12.0
func (s *PersonStore) RemovePets(record *Person, deleted ...*Pet) error
RemovePets removes the given items of the Pets field of the model. If no items are given, it removes all of them. The items will also be removed from the passed record inside this method. Note that is required that `Pets` is not empty. This method clears the the elements of Pets in a model, it does not retrieve them to know what relationships the model has.
func (*PersonStore) Save ¶ added in v0.12.0
func (s *PersonStore) Save(record *Person) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*PersonStore) SetGenericStore ¶ added in v1.1.0
func (s *PersonStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*PersonStore) Transaction ¶ added in v0.12.0
func (s *PersonStore) Transaction(callback func(*PersonStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*PersonStore) Update ¶ added in v0.12.0
func (s *PersonStore) Update(record *Person, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type Pet ¶ added in v0.12.0
type Pet struct { kallax.Model `table:"pets"` ID kallax.ULID `pk:""` Name string Kind string Owner *Person `fk:"owner_id,inverse"` // contains filtered or unexported fields }
func (*Pet) AfterDelete ¶ added in v0.13.0
func (*Pet) BeforeDelete ¶ added in v0.13.0
func (*Pet) BeforeSave ¶ added in v0.13.0
func (*Pet) ColumnAddress ¶ added in v0.12.0
ColumnAddress returns the pointer to the value of the given column.
func (*Pet) GetID ¶ added in v0.13.0
func (r *Pet) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*Pet) NewRelationshipRecord ¶ added in v0.12.0
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*Pet) SetRelationship ¶ added in v0.12.0
SetRelationship sets the given relationship in the given field.
type PetQuery ¶ added in v0.12.0
type PetQuery struct {
*kallax.BaseQuery
}
PetQuery is the object used to create queries for the Pet entity.
func NewPetQuery ¶ added in v0.12.0
func NewPetQuery() *PetQuery
NewPetQuery returns a new instance of PetQuery.
func (*PetQuery) BatchSize ¶ added in v0.12.0
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*PetQuery) Copy ¶ added in v0.12.0
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*PetQuery) FindByID ¶ added in v1.0.0
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*PetQuery) FindByKind ¶ added in v1.0.0
FindByKind adds a new filter to the query that will require that the Kind property is equal to the passed value.
func (*PetQuery) FindByName ¶ added in v1.0.0
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*PetQuery) FindByOwner ¶ added in v1.1.0
FindByOwner adds a new filter to the query that will require that the foreign key of Owner is equal to the passed value.
func (*PetQuery) Offset ¶ added in v0.12.0
Offset sets the number of items to skip from the result set of items.
func (*PetQuery) Order ¶ added in v0.12.0
Order adds order clauses to the query for the given columns.
func (*PetQuery) SelectNot ¶ added in v0.12.0
SelectNot excludes columns from being selected in the query.
type PetResultSet ¶ added in v0.12.0
type PetResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
PetResultSet is the set of results returned by a query to the database.
func NewPetResultSet ¶ added in v0.12.0
func NewPetResultSet(rs kallax.ResultSet) *PetResultSet
NewPetResultSet creates a new result set for rows of the type Pet.
func (*PetResultSet) All ¶ added in v0.12.0
func (rs *PetResultSet) All() ([]*Pet, error)
All returns all records on the result set and closes the result set.
func (*PetResultSet) Close ¶ added in v0.12.0
func (rs *PetResultSet) Close() error
Close closes the result set.
func (*PetResultSet) Err ¶ added in v0.12.0
func (rs *PetResultSet) Err() error
Err returns the last error occurred.
func (*PetResultSet) ForEach ¶ added in v0.12.0
func (rs *PetResultSet) ForEach(fn func(*Pet) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*PetResultSet) Get ¶ added in v0.12.0
func (rs *PetResultSet) Get() (*Pet, error)
Get retrieves the last fetched item from the result set and the last error.
func (*PetResultSet) Next ¶ added in v0.12.0
func (rs *PetResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*PetResultSet) One ¶ added in v0.12.0
func (rs *PetResultSet) One() (*Pet, error)
One returns the first record on the result set and closes the result set.
type PetStore ¶ added in v0.12.0
type PetStore struct {
*kallax.Store
}
PetStore is the entity to access the records of the type Pet in the database.
func NewPetStore ¶ added in v0.12.0
NewPetStore creates a new instance of PetStore using a SQL database.
func (*PetStore) Count ¶ added in v0.12.0
Count returns the number of rows that would be retrieved with the given query.
func (*PetStore) Debug ¶ added in v1.1.4
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*PetStore) DebugWith ¶ added in v1.1.4
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*PetStore) DisableCacher ¶ added in v1.3.4
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*PetStore) Find ¶ added in v0.12.0
func (s *PetStore) Find(q *PetQuery) (*PetResultSet, error)
Find returns the set of results for the given query.
func (*PetStore) FindAll ¶ added in v1.2.1
FindAll returns a list of all the rows returned by the given query.
func (*PetStore) FindOne ¶ added in v0.12.0
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*PetStore) GenericStore ¶ added in v1.1.0
func (s *PetStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*PetStore) Insert ¶ added in v0.12.0
Insert inserts a Pet in the database. A non-persisted object is required for this operation.
func (*PetStore) MustCount ¶ added in v0.12.0
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*PetStore) MustFind ¶ added in v0.12.0
func (s *PetStore) MustFind(q *PetQuery) *PetResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*PetStore) MustFindOne ¶ added in v0.12.0
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*PetStore) Reload ¶ added in v0.12.0
Reload refreshes the Pet with the data in the database and makes it writable.
func (*PetStore) Save ¶ added in v0.12.0
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*PetStore) SetGenericStore ¶ added in v1.1.0
func (s *PetStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*PetStore) Transaction ¶ added in v0.12.0
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*PetStore) Update ¶ added in v0.12.0
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type QueryFixture ¶
type QueryFixture struct { kallax.Model `table:"query"` ID kallax.ULID `pk:""` Relation *QueryRelationFixture `fk:"owner_id"` Inverse *QueryRelationFixture `fk:"inverse_id,inverse"` NRelation []*QueryRelationFixture `fk:"owner_id"` Embedded fixtures.QueryDummy Ignored fixtures.QueryDummy `kallax:"-"` Inline struct { Inline string } `kallax:",inline"` MapOfString map[string]string MapOfInterface map[string]interface{} MapOfSomeType map[string]fixtures.QueryDummy Foo string StringProperty string Integer int Integer64 int64 Float32 float32 Boolean bool ArrayParam [3]string SliceParam []string AliasArrayParam fixtures.AliasArray AliasSliceParam fixtures.AliasSlice AliasStringParam fixtures.AliasString AliasIntParam fixtures.AliasInt DummyParam fixtures.QueryDummy AliasDummyParam fixtures.AliasDummyParam SliceDummyParam []fixtures.QueryDummy IDPropertyParam kallax.ULID InterfacePropParam fixtures.InterfaceImplementation `sqltype:"jsonb"` URLParam url.URL TimeParam time.Time AliasArrAliasStringParam fixtures.AliasArrAliasString AliasHereArrayParam AliasHereArray ArrayAliasHereStringParam []AliasHereString ScannerValuerParam ScannerValuer `sqltype:"jsonb"` }
func NewQueryFixture ¶
func NewQueryFixture(f string) (record *QueryFixture)
NewQueryFixture returns a new instance of QueryFixture.
func (*QueryFixture) ColumnAddress ¶
func (r *QueryFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*QueryFixture) Eq ¶ added in v1.0.0
func (q *QueryFixture) Eq(v *QueryFixture) bool
func (*QueryFixture) GetID ¶ added in v0.13.0
func (r *QueryFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*QueryFixture) NewRelationshipRecord ¶
func (r *QueryFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*QueryFixture) SetRelationship ¶
func (r *QueryFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*QueryFixture) Value ¶
func (r *QueryFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type QueryFixtureQuery ¶
type QueryFixtureQuery struct {
*kallax.BaseQuery
}
QueryFixtureQuery is the object used to create queries for the QueryFixture entity.
func NewQueryFixtureQuery ¶
func NewQueryFixtureQuery() *QueryFixtureQuery
NewQueryFixtureQuery returns a new instance of QueryFixtureQuery.
func (*QueryFixtureQuery) BatchSize ¶
func (q *QueryFixtureQuery) BatchSize(size uint64) *QueryFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*QueryFixtureQuery) Copy ¶
func (q *QueryFixtureQuery) Copy() *QueryFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*QueryFixtureQuery) FindByAliasArrAliasStringParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasArrAliasStringParam(v ...fixtures.AliasString) *QueryFixtureQuery
FindByAliasArrAliasStringParam adds a new filter to the query that will require that the AliasArrAliasStringParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByAliasArrayParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasArrayParam(v ...string) *QueryFixtureQuery
FindByAliasArrayParam adds a new filter to the query that will require that the AliasArrayParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByAliasHereArrayParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasHereArrayParam(v ...string) *QueryFixtureQuery
FindByAliasHereArrayParam adds a new filter to the query that will require that the AliasHereArrayParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByAliasIntParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasIntParam(cond kallax.ScalarCond, v fixtures.AliasInt) *QueryFixtureQuery
FindByAliasIntParam adds a new filter to the query that will require that the AliasIntParam property is equal to the passed value.
func (*QueryFixtureQuery) FindByAliasSliceParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasSliceParam(v ...string) *QueryFixtureQuery
FindByAliasSliceParam adds a new filter to the query that will require that the AliasSliceParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByAliasStringParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByAliasStringParam(v fixtures.AliasString) *QueryFixtureQuery
FindByAliasStringParam adds a new filter to the query that will require that the AliasStringParam property is equal to the passed value.
func (*QueryFixtureQuery) FindByArrayAliasHereStringParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByArrayAliasHereStringParam(v ...AliasHereString) *QueryFixtureQuery
FindByArrayAliasHereStringParam adds a new filter to the query that will require that the ArrayAliasHereStringParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByArrayParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByArrayParam(v ...string) *QueryFixtureQuery
FindByArrayParam adds a new filter to the query that will require that the ArrayParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByBoolean ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByBoolean(v bool) *QueryFixtureQuery
FindByBoolean adds a new filter to the query that will require that the Boolean property is equal to the passed value.
func (*QueryFixtureQuery) FindByFloat32 ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByFloat32(cond kallax.ScalarCond, v float32) *QueryFixtureQuery
FindByFloat32 adds a new filter to the query that will require that the Float32 property is equal to the passed value.
func (*QueryFixtureQuery) FindByFoo ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByFoo(v string) *QueryFixtureQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*QueryFixtureQuery) FindByID ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByID(v ...kallax.ULID) *QueryFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByIDPropertyParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByIDPropertyParam(v kallax.ULID) *QueryFixtureQuery
FindByIDPropertyParam adds a new filter to the query that will require that the IDPropertyParam property is equal to the passed value.
func (*QueryFixtureQuery) FindByInline ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByInline(v string) *QueryFixtureQuery
FindByInline adds a new filter to the query that will require that the Inline property is equal to the passed value.
func (*QueryFixtureQuery) FindByInteger ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByInteger(cond kallax.ScalarCond, v int) *QueryFixtureQuery
FindByInteger adds a new filter to the query that will require that the Integer property is equal to the passed value.
func (*QueryFixtureQuery) FindByInteger64 ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByInteger64(cond kallax.ScalarCond, v int64) *QueryFixtureQuery
FindByInteger64 adds a new filter to the query that will require that the Integer64 property is equal to the passed value.
func (*QueryFixtureQuery) FindByInterfacePropParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByInterfacePropParam(v fixtures.InterfaceImplementation) *QueryFixtureQuery
FindByInterfacePropParam adds a new filter to the query that will require that the InterfacePropParam property is equal to the passed value.
func (*QueryFixtureQuery) FindByInverse ¶ added in v1.1.0
func (q *QueryFixtureQuery) FindByInverse(v kallax.ULID) *QueryFixtureQuery
FindByInverse adds a new filter to the query that will require that the foreign key of Inverse is equal to the passed value.
func (*QueryFixtureQuery) FindByScannerValuerParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByScannerValuerParam(v ScannerValuer) *QueryFixtureQuery
FindByScannerValuerParam adds a new filter to the query that will require that the ScannerValuerParam property is equal to the passed value.
func (*QueryFixtureQuery) FindBySliceParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindBySliceParam(v ...string) *QueryFixtureQuery
FindBySliceParam adds a new filter to the query that will require that the SliceParam property contains all the passed values; if no passed values, it will do nothing.
func (*QueryFixtureQuery) FindByStringProperty ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByStringProperty(v string) *QueryFixtureQuery
FindByStringProperty adds a new filter to the query that will require that the StringProperty property is equal to the passed value.
func (*QueryFixtureQuery) FindByTimeParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByTimeParam(cond kallax.ScalarCond, v time.Time) *QueryFixtureQuery
FindByTimeParam adds a new filter to the query that will require that the TimeParam property is equal to the passed value.
func (*QueryFixtureQuery) FindByURLParam ¶ added in v1.0.0
func (q *QueryFixtureQuery) FindByURLParam(v url.URL) *QueryFixtureQuery
FindByURLParam adds a new filter to the query that will require that the URLParam property is equal to the passed value.
func (*QueryFixtureQuery) Limit ¶
func (q *QueryFixtureQuery) Limit(n uint64) *QueryFixtureQuery
Limit sets the max number of items to retrieve.
func (*QueryFixtureQuery) Offset ¶
func (q *QueryFixtureQuery) Offset(n uint64) *QueryFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*QueryFixtureQuery) Order ¶
func (q *QueryFixtureQuery) Order(cols ...kallax.ColumnOrder) *QueryFixtureQuery
Order adds order clauses to the query for the given columns.
func (*QueryFixtureQuery) Select ¶
func (q *QueryFixtureQuery) Select(columns ...kallax.SchemaField) *QueryFixtureQuery
Select adds columns to select in the query.
func (*QueryFixtureQuery) SelectNot ¶
func (q *QueryFixtureQuery) SelectNot(columns ...kallax.SchemaField) *QueryFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*QueryFixtureQuery) Where ¶
func (q *QueryFixtureQuery) Where(cond kallax.Condition) *QueryFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*QueryFixtureQuery) WithInverse ¶ added in v1.1.0
func (q *QueryFixtureQuery) WithInverse() *QueryFixtureQuery
func (*QueryFixtureQuery) WithNRelation ¶ added in v1.0.0
func (q *QueryFixtureQuery) WithNRelation(cond kallax.Condition) *QueryFixtureQuery
func (*QueryFixtureQuery) WithRelation ¶ added in v1.0.0
func (q *QueryFixtureQuery) WithRelation() *QueryFixtureQuery
type QueryFixtureResultSet ¶
type QueryFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
QueryFixtureResultSet is the set of results returned by a query to the database.
func NewQueryFixtureResultSet ¶
func NewQueryFixtureResultSet(rs kallax.ResultSet) *QueryFixtureResultSet
NewQueryFixtureResultSet creates a new result set for rows of the type QueryFixture.
func (*QueryFixtureResultSet) All ¶
func (rs *QueryFixtureResultSet) All() ([]*QueryFixture, error)
All returns all records on the result set and closes the result set.
func (*QueryFixtureResultSet) Close ¶ added in v0.12.0
func (rs *QueryFixtureResultSet) Close() error
Close closes the result set.
func (*QueryFixtureResultSet) Err ¶ added in v0.12.0
func (rs *QueryFixtureResultSet) Err() error
Err returns the last error occurred.
func (*QueryFixtureResultSet) ForEach ¶
func (rs *QueryFixtureResultSet) ForEach(fn func(*QueryFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*QueryFixtureResultSet) Get ¶
func (rs *QueryFixtureResultSet) Get() (*QueryFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*QueryFixtureResultSet) Next ¶
func (rs *QueryFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*QueryFixtureResultSet) One ¶
func (rs *QueryFixtureResultSet) One() (*QueryFixture, error)
One returns the first record on the result set and closes the result set.
type QueryFixtureStore ¶
type QueryFixtureStore struct {
*kallax.Store
}
QueryFixtureStore is the entity to access the records of the type QueryFixture in the database.
func NewQueryFixtureStore ¶
func NewQueryFixtureStore(db *sql.DB) *QueryFixtureStore
NewQueryFixtureStore creates a new instance of QueryFixtureStore using a SQL database.
func (*QueryFixtureStore) Count ¶
func (s *QueryFixtureStore) Count(q *QueryFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*QueryFixtureStore) Debug ¶ added in v1.1.4
func (s *QueryFixtureStore) Debug() *QueryFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*QueryFixtureStore) DebugWith ¶ added in v1.1.4
func (s *QueryFixtureStore) DebugWith(logger kallax.LoggerFunc) *QueryFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*QueryFixtureStore) Delete ¶
func (s *QueryFixtureStore) Delete(record *QueryFixture) error
Delete removes the given record from the database.
func (*QueryFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *QueryFixtureStore) DisableCacher() *QueryFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*QueryFixtureStore) Find ¶
func (s *QueryFixtureStore) Find(q *QueryFixtureQuery) (*QueryFixtureResultSet, error)
Find returns the set of results for the given query.
func (*QueryFixtureStore) FindAll ¶ added in v1.2.1
func (s *QueryFixtureStore) FindAll(q *QueryFixtureQuery) ([]*QueryFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*QueryFixtureStore) FindOne ¶
func (s *QueryFixtureStore) FindOne(q *QueryFixtureQuery) (*QueryFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*QueryFixtureStore) GenericStore ¶ added in v1.1.0
func (s *QueryFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*QueryFixtureStore) Insert ¶
func (s *QueryFixtureStore) Insert(record *QueryFixture) error
Insert inserts a QueryFixture in the database. A non-persisted object is required for this operation.
func (*QueryFixtureStore) MustCount ¶
func (s *QueryFixtureStore) MustCount(q *QueryFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*QueryFixtureStore) MustFind ¶
func (s *QueryFixtureStore) MustFind(q *QueryFixtureQuery) *QueryFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*QueryFixtureStore) MustFindOne ¶
func (s *QueryFixtureStore) MustFindOne(q *QueryFixtureQuery) *QueryFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*QueryFixtureStore) Reload ¶
func (s *QueryFixtureStore) Reload(record *QueryFixture) error
Reload refreshes the QueryFixture with the data in the database and makes it writable.
func (*QueryFixtureStore) RemoveNRelation ¶ added in v1.0.0
func (s *QueryFixtureStore) RemoveNRelation(record *QueryFixture, deleted ...*QueryRelationFixture) error
RemoveNRelation removes the given items of the NRelation field of the model. If no items are given, it removes all of them. The items will also be removed from the passed record inside this method. Note that is required that `NRelation` is not empty. This method clears the the elements of NRelation in a model, it does not retrieve them to know what relationships the model has.
func (*QueryFixtureStore) RemoveRelation ¶ added in v1.0.0
func (s *QueryFixtureStore) RemoveRelation(record *QueryFixture) error
RemoveRelation removes from the database the given relationship of the model. It also resets the field Relation of the model.
func (*QueryFixtureStore) Save ¶
func (s *QueryFixtureStore) Save(record *QueryFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*QueryFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *QueryFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*QueryFixtureStore) Transaction ¶
func (s *QueryFixtureStore) Transaction(callback func(*QueryFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*QueryFixtureStore) Update ¶
func (s *QueryFixtureStore) Update(record *QueryFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type QueryRelationFixture ¶ added in v1.0.0
type QueryRelationFixture struct { kallax.Model `table:"query_relation"` ID kallax.ULID `pk:""` Name string Owner *QueryFixture `fk:"owner_id,inverse"` }
func NewQueryRelationFixture ¶ added in v1.0.0
func NewQueryRelationFixture() (record *QueryRelationFixture)
NewQueryRelationFixture returns a new instance of QueryRelationFixture.
func (*QueryRelationFixture) ColumnAddress ¶ added in v1.0.0
func (r *QueryRelationFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*QueryRelationFixture) GetID ¶ added in v1.0.0
func (r *QueryRelationFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*QueryRelationFixture) NewRelationshipRecord ¶ added in v1.0.0
func (r *QueryRelationFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*QueryRelationFixture) SetRelationship ¶ added in v1.0.0
func (r *QueryRelationFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*QueryRelationFixture) Value ¶ added in v1.0.0
func (r *QueryRelationFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type QueryRelationFixtureQuery ¶ added in v1.0.0
type QueryRelationFixtureQuery struct {
*kallax.BaseQuery
}
QueryRelationFixtureQuery is the object used to create queries for the QueryRelationFixture entity.
func NewQueryRelationFixtureQuery ¶ added in v1.0.0
func NewQueryRelationFixtureQuery() *QueryRelationFixtureQuery
NewQueryRelationFixtureQuery returns a new instance of QueryRelationFixtureQuery.
func (*QueryRelationFixtureQuery) BatchSize ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) BatchSize(size uint64) *QueryRelationFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*QueryRelationFixtureQuery) Copy ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Copy() *QueryRelationFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*QueryRelationFixtureQuery) FindByID ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) FindByID(v ...kallax.ULID) *QueryRelationFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*QueryRelationFixtureQuery) FindByName ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) FindByName(v string) *QueryRelationFixtureQuery
FindByName adds a new filter to the query that will require that the Name property is equal to the passed value.
func (*QueryRelationFixtureQuery) FindByOwner ¶ added in v1.1.0
func (q *QueryRelationFixtureQuery) FindByOwner(v kallax.ULID) *QueryRelationFixtureQuery
FindByOwner adds a new filter to the query that will require that the foreign key of Owner is equal to the passed value.
func (*QueryRelationFixtureQuery) Limit ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Limit(n uint64) *QueryRelationFixtureQuery
Limit sets the max number of items to retrieve.
func (*QueryRelationFixtureQuery) Offset ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Offset(n uint64) *QueryRelationFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*QueryRelationFixtureQuery) Order ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Order(cols ...kallax.ColumnOrder) *QueryRelationFixtureQuery
Order adds order clauses to the query for the given columns.
func (*QueryRelationFixtureQuery) Select ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Select(columns ...kallax.SchemaField) *QueryRelationFixtureQuery
Select adds columns to select in the query.
func (*QueryRelationFixtureQuery) SelectNot ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) SelectNot(columns ...kallax.SchemaField) *QueryRelationFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*QueryRelationFixtureQuery) Where ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) Where(cond kallax.Condition) *QueryRelationFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*QueryRelationFixtureQuery) WithOwner ¶ added in v1.0.0
func (q *QueryRelationFixtureQuery) WithOwner() *QueryRelationFixtureQuery
type QueryRelationFixtureResultSet ¶ added in v1.0.0
type QueryRelationFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
QueryRelationFixtureResultSet is the set of results returned by a query to the database.
func NewQueryRelationFixtureResultSet ¶ added in v1.0.0
func NewQueryRelationFixtureResultSet(rs kallax.ResultSet) *QueryRelationFixtureResultSet
NewQueryRelationFixtureResultSet creates a new result set for rows of the type QueryRelationFixture.
func (*QueryRelationFixtureResultSet) All ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) All() ([]*QueryRelationFixture, error)
All returns all records on the result set and closes the result set.
func (*QueryRelationFixtureResultSet) Close ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) Close() error
Close closes the result set.
func (*QueryRelationFixtureResultSet) Err ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) Err() error
Err returns the last error occurred.
func (*QueryRelationFixtureResultSet) ForEach ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) ForEach(fn func(*QueryRelationFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*QueryRelationFixtureResultSet) Get ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) Get() (*QueryRelationFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*QueryRelationFixtureResultSet) Next ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*QueryRelationFixtureResultSet) One ¶ added in v1.0.0
func (rs *QueryRelationFixtureResultSet) One() (*QueryRelationFixture, error)
One returns the first record on the result set and closes the result set.
type QueryRelationFixtureStore ¶ added in v1.0.0
type QueryRelationFixtureStore struct {
*kallax.Store
}
QueryRelationFixtureStore is the entity to access the records of the type QueryRelationFixture in the database.
func NewQueryRelationFixtureStore ¶ added in v1.0.0
func NewQueryRelationFixtureStore(db *sql.DB) *QueryRelationFixtureStore
NewQueryRelationFixtureStore creates a new instance of QueryRelationFixtureStore using a SQL database.
func (*QueryRelationFixtureStore) Count ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Count(q *QueryRelationFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*QueryRelationFixtureStore) Debug ¶ added in v1.1.4
func (s *QueryRelationFixtureStore) Debug() *QueryRelationFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*QueryRelationFixtureStore) DebugWith ¶ added in v1.1.4
func (s *QueryRelationFixtureStore) DebugWith(logger kallax.LoggerFunc) *QueryRelationFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*QueryRelationFixtureStore) Delete ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Delete(record *QueryRelationFixture) error
Delete removes the given record from the database.
func (*QueryRelationFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *QueryRelationFixtureStore) DisableCacher() *QueryRelationFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*QueryRelationFixtureStore) Find ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Find(q *QueryRelationFixtureQuery) (*QueryRelationFixtureResultSet, error)
Find returns the set of results for the given query.
func (*QueryRelationFixtureStore) FindAll ¶ added in v1.2.1
func (s *QueryRelationFixtureStore) FindAll(q *QueryRelationFixtureQuery) ([]*QueryRelationFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*QueryRelationFixtureStore) FindOne ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) FindOne(q *QueryRelationFixtureQuery) (*QueryRelationFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*QueryRelationFixtureStore) GenericStore ¶ added in v1.1.0
func (s *QueryRelationFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*QueryRelationFixtureStore) Insert ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Insert(record *QueryRelationFixture) error
Insert inserts a QueryRelationFixture in the database. A non-persisted object is required for this operation.
func (*QueryRelationFixtureStore) MustCount ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) MustCount(q *QueryRelationFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*QueryRelationFixtureStore) MustFind ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) MustFind(q *QueryRelationFixtureQuery) *QueryRelationFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*QueryRelationFixtureStore) MustFindOne ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) MustFindOne(q *QueryRelationFixtureQuery) *QueryRelationFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*QueryRelationFixtureStore) Reload ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Reload(record *QueryRelationFixture) error
Reload refreshes the QueryRelationFixture with the data in the database and makes it writable.
func (*QueryRelationFixtureStore) Save ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Save(record *QueryRelationFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*QueryRelationFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *QueryRelationFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*QueryRelationFixtureStore) Transaction ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Transaction(callback func(*QueryRelationFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*QueryRelationFixtureStore) Update ¶ added in v1.0.0
func (s *QueryRelationFixtureStore) Update(record *QueryRelationFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type ResultSetFixture ¶
type ResultSetFixture struct { kallax.Model `table:"resultset"` ID kallax.ULID `pk:""` Foo string }
func NewResultSetFixture ¶
func NewResultSetFixture(f string) (record *ResultSetFixture)
NewResultSetFixture returns a new instance of ResultSetFixture.
func (*ResultSetFixture) ColumnAddress ¶
func (r *ResultSetFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*ResultSetFixture) GetID ¶ added in v0.13.0
func (r *ResultSetFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*ResultSetFixture) NewRelationshipRecord ¶
func (r *ResultSetFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*ResultSetFixture) SetRelationship ¶
func (r *ResultSetFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*ResultSetFixture) Value ¶
func (r *ResultSetFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type ResultSetFixtureQuery ¶
type ResultSetFixtureQuery struct {
*kallax.BaseQuery
}
ResultSetFixtureQuery is the object used to create queries for the ResultSetFixture entity.
func NewResultSetFixtureQuery ¶
func NewResultSetFixtureQuery() *ResultSetFixtureQuery
NewResultSetFixtureQuery returns a new instance of ResultSetFixtureQuery.
func (*ResultSetFixtureQuery) BatchSize ¶
func (q *ResultSetFixtureQuery) BatchSize(size uint64) *ResultSetFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*ResultSetFixtureQuery) Copy ¶
func (q *ResultSetFixtureQuery) Copy() *ResultSetFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*ResultSetFixtureQuery) FindByFoo ¶ added in v1.0.0
func (q *ResultSetFixtureQuery) FindByFoo(v string) *ResultSetFixtureQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*ResultSetFixtureQuery) FindByID ¶ added in v1.0.0
func (q *ResultSetFixtureQuery) FindByID(v ...kallax.ULID) *ResultSetFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*ResultSetFixtureQuery) Limit ¶
func (q *ResultSetFixtureQuery) Limit(n uint64) *ResultSetFixtureQuery
Limit sets the max number of items to retrieve.
func (*ResultSetFixtureQuery) Offset ¶
func (q *ResultSetFixtureQuery) Offset(n uint64) *ResultSetFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*ResultSetFixtureQuery) Order ¶
func (q *ResultSetFixtureQuery) Order(cols ...kallax.ColumnOrder) *ResultSetFixtureQuery
Order adds order clauses to the query for the given columns.
func (*ResultSetFixtureQuery) Select ¶
func (q *ResultSetFixtureQuery) Select(columns ...kallax.SchemaField) *ResultSetFixtureQuery
Select adds columns to select in the query.
func (*ResultSetFixtureQuery) SelectNot ¶
func (q *ResultSetFixtureQuery) SelectNot(columns ...kallax.SchemaField) *ResultSetFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*ResultSetFixtureQuery) Where ¶
func (q *ResultSetFixtureQuery) Where(cond kallax.Condition) *ResultSetFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type ResultSetFixtureResultSet ¶
type ResultSetFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
ResultSetFixtureResultSet is the set of results returned by a query to the database.
func NewResultSetFixtureResultSet ¶
func NewResultSetFixtureResultSet(rs kallax.ResultSet) *ResultSetFixtureResultSet
NewResultSetFixtureResultSet creates a new result set for rows of the type ResultSetFixture.
func (*ResultSetFixtureResultSet) All ¶
func (rs *ResultSetFixtureResultSet) All() ([]*ResultSetFixture, error)
All returns all records on the result set and closes the result set.
func (*ResultSetFixtureResultSet) Close ¶ added in v0.12.0
func (rs *ResultSetFixtureResultSet) Close() error
Close closes the result set.
func (*ResultSetFixtureResultSet) Err ¶ added in v0.12.0
func (rs *ResultSetFixtureResultSet) Err() error
Err returns the last error occurred.
func (*ResultSetFixtureResultSet) ForEach ¶
func (rs *ResultSetFixtureResultSet) ForEach(fn func(*ResultSetFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*ResultSetFixtureResultSet) Get ¶
func (rs *ResultSetFixtureResultSet) Get() (*ResultSetFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*ResultSetFixtureResultSet) Next ¶
func (rs *ResultSetFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*ResultSetFixtureResultSet) One ¶
func (rs *ResultSetFixtureResultSet) One() (*ResultSetFixture, error)
One returns the first record on the result set and closes the result set.
type ResultSetFixtureStore ¶
type ResultSetFixtureStore struct {
*kallax.Store
}
ResultSetFixtureStore is the entity to access the records of the type ResultSetFixture in the database.
func NewResultSetFixtureStore ¶
func NewResultSetFixtureStore(db *sql.DB) *ResultSetFixtureStore
NewResultSetFixtureStore creates a new instance of ResultSetFixtureStore using a SQL database.
func (*ResultSetFixtureStore) Count ¶
func (s *ResultSetFixtureStore) Count(q *ResultSetFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*ResultSetFixtureStore) Debug ¶ added in v1.1.4
func (s *ResultSetFixtureStore) Debug() *ResultSetFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*ResultSetFixtureStore) DebugWith ¶ added in v1.1.4
func (s *ResultSetFixtureStore) DebugWith(logger kallax.LoggerFunc) *ResultSetFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*ResultSetFixtureStore) Delete ¶
func (s *ResultSetFixtureStore) Delete(record *ResultSetFixture) error
Delete removes the given record from the database.
func (*ResultSetFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *ResultSetFixtureStore) DisableCacher() *ResultSetFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*ResultSetFixtureStore) Find ¶
func (s *ResultSetFixtureStore) Find(q *ResultSetFixtureQuery) (*ResultSetFixtureResultSet, error)
Find returns the set of results for the given query.
func (*ResultSetFixtureStore) FindAll ¶ added in v1.2.1
func (s *ResultSetFixtureStore) FindAll(q *ResultSetFixtureQuery) ([]*ResultSetFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*ResultSetFixtureStore) FindOne ¶
func (s *ResultSetFixtureStore) FindOne(q *ResultSetFixtureQuery) (*ResultSetFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*ResultSetFixtureStore) GenericStore ¶ added in v1.1.0
func (s *ResultSetFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*ResultSetFixtureStore) Insert ¶
func (s *ResultSetFixtureStore) Insert(record *ResultSetFixture) error
Insert inserts a ResultSetFixture in the database. A non-persisted object is required for this operation.
func (*ResultSetFixtureStore) MustCount ¶
func (s *ResultSetFixtureStore) MustCount(q *ResultSetFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*ResultSetFixtureStore) MustFind ¶
func (s *ResultSetFixtureStore) MustFind(q *ResultSetFixtureQuery) *ResultSetFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*ResultSetFixtureStore) MustFindOne ¶
func (s *ResultSetFixtureStore) MustFindOne(q *ResultSetFixtureQuery) *ResultSetFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*ResultSetFixtureStore) Reload ¶
func (s *ResultSetFixtureStore) Reload(record *ResultSetFixture) error
Reload refreshes the ResultSetFixture with the data in the database and makes it writable.
func (*ResultSetFixtureStore) Save ¶
func (s *ResultSetFixtureStore) Save(record *ResultSetFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*ResultSetFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *ResultSetFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*ResultSetFixtureStore) Transaction ¶
func (s *ResultSetFixtureStore) Transaction(callback func(*ResultSetFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*ResultSetFixtureStore) Update ¶
func (s *ResultSetFixtureStore) Update(record *ResultSetFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type ScannerValuer ¶ added in v1.0.0
type ScannerValuer struct {
fixtures.ScannerValuer
}
type SchemaFixture ¶
type SchemaFixture struct { kallax.Model `table:"schema"` ID kallax.ULID `pk:""` ShouldIgnore string `kallax:"-"` String string Int int Nested *SchemaFixture Inline struct { Inline string } `kallax:",inline"` MapOfString map[string]string MapOfInterface map[string]interface{} MapOfSomeType map[string]struct { Foo string } Inverse *SchemaRelationshipFixture `fk:"rel_id,inverse"` }
func NewSchemaFixture ¶
func NewSchemaFixture() (record *SchemaFixture)
NewSchemaFixture returns a new instance of SchemaFixture.
func (*SchemaFixture) ColumnAddress ¶
func (r *SchemaFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*SchemaFixture) GetID ¶ added in v0.13.0
func (r *SchemaFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*SchemaFixture) NewRelationshipRecord ¶
func (r *SchemaFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*SchemaFixture) SetRelationship ¶
func (r *SchemaFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*SchemaFixture) Value ¶
func (r *SchemaFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type SchemaFixtureQuery ¶
type SchemaFixtureQuery struct {
*kallax.BaseQuery
}
SchemaFixtureQuery is the object used to create queries for the SchemaFixture entity.
func NewSchemaFixtureQuery ¶
func NewSchemaFixtureQuery() *SchemaFixtureQuery
NewSchemaFixtureQuery returns a new instance of SchemaFixtureQuery.
func (*SchemaFixtureQuery) BatchSize ¶
func (q *SchemaFixtureQuery) BatchSize(size uint64) *SchemaFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*SchemaFixtureQuery) Copy ¶
func (q *SchemaFixtureQuery) Copy() *SchemaFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*SchemaFixtureQuery) FindByID ¶ added in v1.0.0
func (q *SchemaFixtureQuery) FindByID(v ...kallax.ULID) *SchemaFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*SchemaFixtureQuery) FindByInline ¶ added in v1.0.0
func (q *SchemaFixtureQuery) FindByInline(v string) *SchemaFixtureQuery
FindByInline adds a new filter to the query that will require that the Inline property is equal to the passed value.
func (*SchemaFixtureQuery) FindByInt ¶ added in v1.0.0
func (q *SchemaFixtureQuery) FindByInt(cond kallax.ScalarCond, v int) *SchemaFixtureQuery
FindByInt adds a new filter to the query that will require that the Int property is equal to the passed value.
func (*SchemaFixtureQuery) FindByInverse ¶ added in v1.1.0
func (q *SchemaFixtureQuery) FindByInverse(v kallax.ULID) *SchemaFixtureQuery
FindByInverse adds a new filter to the query that will require that the foreign key of Inverse is equal to the passed value.
func (*SchemaFixtureQuery) FindByString ¶ added in v1.0.0
func (q *SchemaFixtureQuery) FindByString(v string) *SchemaFixtureQuery
FindByString adds a new filter to the query that will require that the String property is equal to the passed value.
func (*SchemaFixtureQuery) Limit ¶
func (q *SchemaFixtureQuery) Limit(n uint64) *SchemaFixtureQuery
Limit sets the max number of items to retrieve.
func (*SchemaFixtureQuery) Offset ¶
func (q *SchemaFixtureQuery) Offset(n uint64) *SchemaFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*SchemaFixtureQuery) Order ¶
func (q *SchemaFixtureQuery) Order(cols ...kallax.ColumnOrder) *SchemaFixtureQuery
Order adds order clauses to the query for the given columns.
func (*SchemaFixtureQuery) Select ¶
func (q *SchemaFixtureQuery) Select(columns ...kallax.SchemaField) *SchemaFixtureQuery
Select adds columns to select in the query.
func (*SchemaFixtureQuery) SelectNot ¶
func (q *SchemaFixtureQuery) SelectNot(columns ...kallax.SchemaField) *SchemaFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*SchemaFixtureQuery) Where ¶
func (q *SchemaFixtureQuery) Where(cond kallax.Condition) *SchemaFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
func (*SchemaFixtureQuery) WithInverse ¶ added in v1.1.0
func (q *SchemaFixtureQuery) WithInverse() *SchemaFixtureQuery
func (*SchemaFixtureQuery) WithNested ¶
func (q *SchemaFixtureQuery) WithNested() *SchemaFixtureQuery
type SchemaFixtureResultSet ¶
type SchemaFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
SchemaFixtureResultSet is the set of results returned by a query to the database.
func NewSchemaFixtureResultSet ¶
func NewSchemaFixtureResultSet(rs kallax.ResultSet) *SchemaFixtureResultSet
NewSchemaFixtureResultSet creates a new result set for rows of the type SchemaFixture.
func (*SchemaFixtureResultSet) All ¶
func (rs *SchemaFixtureResultSet) All() ([]*SchemaFixture, error)
All returns all records on the result set and closes the result set.
func (*SchemaFixtureResultSet) Close ¶ added in v0.12.0
func (rs *SchemaFixtureResultSet) Close() error
Close closes the result set.
func (*SchemaFixtureResultSet) Err ¶ added in v0.12.0
func (rs *SchemaFixtureResultSet) Err() error
Err returns the last error occurred.
func (*SchemaFixtureResultSet) ForEach ¶
func (rs *SchemaFixtureResultSet) ForEach(fn func(*SchemaFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*SchemaFixtureResultSet) Get ¶
func (rs *SchemaFixtureResultSet) Get() (*SchemaFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*SchemaFixtureResultSet) Next ¶
func (rs *SchemaFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*SchemaFixtureResultSet) One ¶
func (rs *SchemaFixtureResultSet) One() (*SchemaFixture, error)
One returns the first record on the result set and closes the result set.
type SchemaFixtureStore ¶
type SchemaFixtureStore struct {
*kallax.Store
}
SchemaFixtureStore is the entity to access the records of the type SchemaFixture in the database.
func NewSchemaFixtureStore ¶
func NewSchemaFixtureStore(db *sql.DB) *SchemaFixtureStore
NewSchemaFixtureStore creates a new instance of SchemaFixtureStore using a SQL database.
func (*SchemaFixtureStore) Count ¶
func (s *SchemaFixtureStore) Count(q *SchemaFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*SchemaFixtureStore) Debug ¶ added in v1.1.4
func (s *SchemaFixtureStore) Debug() *SchemaFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*SchemaFixtureStore) DebugWith ¶ added in v1.1.4
func (s *SchemaFixtureStore) DebugWith(logger kallax.LoggerFunc) *SchemaFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*SchemaFixtureStore) Delete ¶
func (s *SchemaFixtureStore) Delete(record *SchemaFixture) error
Delete removes the given record from the database.
func (*SchemaFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *SchemaFixtureStore) DisableCacher() *SchemaFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*SchemaFixtureStore) Find ¶
func (s *SchemaFixtureStore) Find(q *SchemaFixtureQuery) (*SchemaFixtureResultSet, error)
Find returns the set of results for the given query.
func (*SchemaFixtureStore) FindAll ¶ added in v1.2.1
func (s *SchemaFixtureStore) FindAll(q *SchemaFixtureQuery) ([]*SchemaFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*SchemaFixtureStore) FindOne ¶
func (s *SchemaFixtureStore) FindOne(q *SchemaFixtureQuery) (*SchemaFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*SchemaFixtureStore) GenericStore ¶ added in v1.1.0
func (s *SchemaFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*SchemaFixtureStore) Insert ¶
func (s *SchemaFixtureStore) Insert(record *SchemaFixture) error
Insert inserts a SchemaFixture in the database. A non-persisted object is required for this operation.
func (*SchemaFixtureStore) MustCount ¶
func (s *SchemaFixtureStore) MustCount(q *SchemaFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*SchemaFixtureStore) MustFind ¶
func (s *SchemaFixtureStore) MustFind(q *SchemaFixtureQuery) *SchemaFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*SchemaFixtureStore) MustFindOne ¶
func (s *SchemaFixtureStore) MustFindOne(q *SchemaFixtureQuery) *SchemaFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*SchemaFixtureStore) Reload ¶
func (s *SchemaFixtureStore) Reload(record *SchemaFixture) error
Reload refreshes the SchemaFixture with the data in the database and makes it writable.
func (*SchemaFixtureStore) RemoveNested ¶ added in v0.12.0
func (s *SchemaFixtureStore) RemoveNested(record *SchemaFixture) error
RemoveNested removes from the database the given relationship of the model. It also resets the field Nested of the model.
func (*SchemaFixtureStore) Save ¶
func (s *SchemaFixtureStore) Save(record *SchemaFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*SchemaFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *SchemaFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*SchemaFixtureStore) Transaction ¶
func (s *SchemaFixtureStore) Transaction(callback func(*SchemaFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*SchemaFixtureStore) Update ¶
func (s *SchemaFixtureStore) Update(record *SchemaFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type SchemaRelationshipFixture ¶ added in v1.1.0
type SchemaRelationshipFixture struct { kallax.Model `table:"relationship"` ID kallax.ULID `pk:""` }
func NewSchemaRelationshipFixture ¶ added in v1.1.0
func NewSchemaRelationshipFixture() (record *SchemaRelationshipFixture)
NewSchemaRelationshipFixture returns a new instance of SchemaRelationshipFixture.
func (*SchemaRelationshipFixture) ColumnAddress ¶ added in v1.1.0
func (r *SchemaRelationshipFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*SchemaRelationshipFixture) GetID ¶ added in v1.1.0
func (r *SchemaRelationshipFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*SchemaRelationshipFixture) NewRelationshipRecord ¶ added in v1.1.0
func (r *SchemaRelationshipFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*SchemaRelationshipFixture) SetRelationship ¶ added in v1.1.0
func (r *SchemaRelationshipFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*SchemaRelationshipFixture) Value ¶ added in v1.1.0
func (r *SchemaRelationshipFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type SchemaRelationshipFixtureQuery ¶ added in v1.1.0
type SchemaRelationshipFixtureQuery struct {
*kallax.BaseQuery
}
SchemaRelationshipFixtureQuery is the object used to create queries for the SchemaRelationshipFixture entity.
func NewSchemaRelationshipFixtureQuery ¶ added in v1.1.0
func NewSchemaRelationshipFixtureQuery() *SchemaRelationshipFixtureQuery
NewSchemaRelationshipFixtureQuery returns a new instance of SchemaRelationshipFixtureQuery.
func (*SchemaRelationshipFixtureQuery) BatchSize ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) BatchSize(size uint64) *SchemaRelationshipFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*SchemaRelationshipFixtureQuery) Copy ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Copy() *SchemaRelationshipFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*SchemaRelationshipFixtureQuery) FindByID ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) FindByID(v ...kallax.ULID) *SchemaRelationshipFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*SchemaRelationshipFixtureQuery) Limit ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Limit(n uint64) *SchemaRelationshipFixtureQuery
Limit sets the max number of items to retrieve.
func (*SchemaRelationshipFixtureQuery) Offset ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Offset(n uint64) *SchemaRelationshipFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*SchemaRelationshipFixtureQuery) Order ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Order(cols ...kallax.ColumnOrder) *SchemaRelationshipFixtureQuery
Order adds order clauses to the query for the given columns.
func (*SchemaRelationshipFixtureQuery) Select ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Select(columns ...kallax.SchemaField) *SchemaRelationshipFixtureQuery
Select adds columns to select in the query.
func (*SchemaRelationshipFixtureQuery) SelectNot ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) SelectNot(columns ...kallax.SchemaField) *SchemaRelationshipFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*SchemaRelationshipFixtureQuery) Where ¶ added in v1.1.0
func (q *SchemaRelationshipFixtureQuery) Where(cond kallax.Condition) *SchemaRelationshipFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type SchemaRelationshipFixtureResultSet ¶ added in v1.1.0
type SchemaRelationshipFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
SchemaRelationshipFixtureResultSet is the set of results returned by a query to the database.
func NewSchemaRelationshipFixtureResultSet ¶ added in v1.1.0
func NewSchemaRelationshipFixtureResultSet(rs kallax.ResultSet) *SchemaRelationshipFixtureResultSet
NewSchemaRelationshipFixtureResultSet creates a new result set for rows of the type SchemaRelationshipFixture.
func (*SchemaRelationshipFixtureResultSet) All ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) All() ([]*SchemaRelationshipFixture, error)
All returns all records on the result set and closes the result set.
func (*SchemaRelationshipFixtureResultSet) Close ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) Close() error
Close closes the result set.
func (*SchemaRelationshipFixtureResultSet) Err ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) Err() error
Err returns the last error occurred.
func (*SchemaRelationshipFixtureResultSet) ForEach ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) ForEach(fn func(*SchemaRelationshipFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*SchemaRelationshipFixtureResultSet) Get ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) Get() (*SchemaRelationshipFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*SchemaRelationshipFixtureResultSet) Next ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*SchemaRelationshipFixtureResultSet) One ¶ added in v1.1.0
func (rs *SchemaRelationshipFixtureResultSet) One() (*SchemaRelationshipFixture, error)
One returns the first record on the result set and closes the result set.
type SchemaRelationshipFixtureStore ¶ added in v1.1.0
type SchemaRelationshipFixtureStore struct {
*kallax.Store
}
SchemaRelationshipFixtureStore is the entity to access the records of the type SchemaRelationshipFixture in the database.
func NewSchemaRelationshipFixtureStore ¶ added in v1.1.0
func NewSchemaRelationshipFixtureStore(db *sql.DB) *SchemaRelationshipFixtureStore
NewSchemaRelationshipFixtureStore creates a new instance of SchemaRelationshipFixtureStore using a SQL database.
func (*SchemaRelationshipFixtureStore) Count ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Count(q *SchemaRelationshipFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*SchemaRelationshipFixtureStore) Debug ¶ added in v1.1.4
func (s *SchemaRelationshipFixtureStore) Debug() *SchemaRelationshipFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*SchemaRelationshipFixtureStore) DebugWith ¶ added in v1.1.4
func (s *SchemaRelationshipFixtureStore) DebugWith(logger kallax.LoggerFunc) *SchemaRelationshipFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*SchemaRelationshipFixtureStore) Delete ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Delete(record *SchemaRelationshipFixture) error
Delete removes the given record from the database.
func (*SchemaRelationshipFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *SchemaRelationshipFixtureStore) DisableCacher() *SchemaRelationshipFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*SchemaRelationshipFixtureStore) Find ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Find(q *SchemaRelationshipFixtureQuery) (*SchemaRelationshipFixtureResultSet, error)
Find returns the set of results for the given query.
func (*SchemaRelationshipFixtureStore) FindAll ¶ added in v1.2.1
func (s *SchemaRelationshipFixtureStore) FindAll(q *SchemaRelationshipFixtureQuery) ([]*SchemaRelationshipFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*SchemaRelationshipFixtureStore) FindOne ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) FindOne(q *SchemaRelationshipFixtureQuery) (*SchemaRelationshipFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*SchemaRelationshipFixtureStore) GenericStore ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*SchemaRelationshipFixtureStore) Insert ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Insert(record *SchemaRelationshipFixture) error
Insert inserts a SchemaRelationshipFixture in the database. A non-persisted object is required for this operation.
func (*SchemaRelationshipFixtureStore) MustCount ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) MustCount(q *SchemaRelationshipFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*SchemaRelationshipFixtureStore) MustFind ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) MustFind(q *SchemaRelationshipFixtureQuery) *SchemaRelationshipFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*SchemaRelationshipFixtureStore) MustFindOne ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) MustFindOne(q *SchemaRelationshipFixtureQuery) *SchemaRelationshipFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*SchemaRelationshipFixtureStore) Reload ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Reload(record *SchemaRelationshipFixture) error
Reload refreshes the SchemaRelationshipFixture with the data in the database and makes it writable.
func (*SchemaRelationshipFixtureStore) Save ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Save(record *SchemaRelationshipFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*SchemaRelationshipFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*SchemaRelationshipFixtureStore) Transaction ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Transaction(callback func(*SchemaRelationshipFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*SchemaRelationshipFixtureStore) Update ¶ added in v1.1.0
func (s *SchemaRelationshipFixtureStore) Update(record *SchemaRelationshipFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type StoreFixture ¶
type StoreFixture struct { kallax.Model `table:"store" pk:"id"` ID kallax.ULID Foo string SliceProp []string AliasSliceProp AliasSliceString }
func NewStoreFixture ¶
func NewStoreFixture() (record *StoreFixture)
NewStoreFixture returns a new instance of StoreFixture.
func (*StoreFixture) ColumnAddress ¶
func (r *StoreFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*StoreFixture) GetID ¶ added in v0.13.0
func (r *StoreFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*StoreFixture) NewRelationshipRecord ¶
func (r *StoreFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*StoreFixture) SetRelationship ¶
func (r *StoreFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*StoreFixture) Value ¶
func (r *StoreFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type StoreFixtureQuery ¶
type StoreFixtureQuery struct {
*kallax.BaseQuery
}
StoreFixtureQuery is the object used to create queries for the StoreFixture entity.
func NewStoreFixtureQuery ¶
func NewStoreFixtureQuery() *StoreFixtureQuery
NewStoreFixtureQuery returns a new instance of StoreFixtureQuery.
func (*StoreFixtureQuery) BatchSize ¶
func (q *StoreFixtureQuery) BatchSize(size uint64) *StoreFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*StoreFixtureQuery) Copy ¶
func (q *StoreFixtureQuery) Copy() *StoreFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*StoreFixtureQuery) FindByAliasSliceProp ¶ added in v1.0.0
func (q *StoreFixtureQuery) FindByAliasSliceProp(v ...string) *StoreFixtureQuery
FindByAliasSliceProp adds a new filter to the query that will require that the AliasSliceProp property contains all the passed values; if no passed values, it will do nothing.
func (*StoreFixtureQuery) FindByFoo ¶ added in v1.0.0
func (q *StoreFixtureQuery) FindByFoo(v string) *StoreFixtureQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*StoreFixtureQuery) FindByID ¶ added in v1.0.0
func (q *StoreFixtureQuery) FindByID(v ...kallax.ULID) *StoreFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*StoreFixtureQuery) FindBySliceProp ¶ added in v1.0.0
func (q *StoreFixtureQuery) FindBySliceProp(v ...string) *StoreFixtureQuery
FindBySliceProp adds a new filter to the query that will require that the SliceProp property contains all the passed values; if no passed values, it will do nothing.
func (*StoreFixtureQuery) Limit ¶
func (q *StoreFixtureQuery) Limit(n uint64) *StoreFixtureQuery
Limit sets the max number of items to retrieve.
func (*StoreFixtureQuery) Offset ¶
func (q *StoreFixtureQuery) Offset(n uint64) *StoreFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*StoreFixtureQuery) Order ¶
func (q *StoreFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreFixtureQuery
Order adds order clauses to the query for the given columns.
func (*StoreFixtureQuery) Select ¶
func (q *StoreFixtureQuery) Select(columns ...kallax.SchemaField) *StoreFixtureQuery
Select adds columns to select in the query.
func (*StoreFixtureQuery) SelectNot ¶
func (q *StoreFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*StoreFixtureQuery) Where ¶
func (q *StoreFixtureQuery) Where(cond kallax.Condition) *StoreFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type StoreFixtureResultSet ¶
type StoreFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
StoreFixtureResultSet is the set of results returned by a query to the database.
func NewStoreFixtureResultSet ¶
func NewStoreFixtureResultSet(rs kallax.ResultSet) *StoreFixtureResultSet
NewStoreFixtureResultSet creates a new result set for rows of the type StoreFixture.
func (*StoreFixtureResultSet) All ¶
func (rs *StoreFixtureResultSet) All() ([]*StoreFixture, error)
All returns all records on the result set and closes the result set.
func (*StoreFixtureResultSet) Close ¶ added in v0.12.0
func (rs *StoreFixtureResultSet) Close() error
Close closes the result set.
func (*StoreFixtureResultSet) Err ¶ added in v0.12.0
func (rs *StoreFixtureResultSet) Err() error
Err returns the last error occurred.
func (*StoreFixtureResultSet) ForEach ¶
func (rs *StoreFixtureResultSet) ForEach(fn func(*StoreFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*StoreFixtureResultSet) Get ¶
func (rs *StoreFixtureResultSet) Get() (*StoreFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*StoreFixtureResultSet) Next ¶
func (rs *StoreFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*StoreFixtureResultSet) One ¶
func (rs *StoreFixtureResultSet) One() (*StoreFixture, error)
One returns the first record on the result set and closes the result set.
type StoreFixtureStore ¶
type StoreFixtureStore struct {
*kallax.Store
}
StoreFixtureStore is the entity to access the records of the type StoreFixture in the database.
func NewStoreFixtureStore ¶
func NewStoreFixtureStore(db *sql.DB) *StoreFixtureStore
NewStoreFixtureStore creates a new instance of StoreFixtureStore using a SQL database.
func (*StoreFixtureStore) Count ¶
func (s *StoreFixtureStore) Count(q *StoreFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*StoreFixtureStore) Debug ¶ added in v1.1.4
func (s *StoreFixtureStore) Debug() *StoreFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*StoreFixtureStore) DebugWith ¶ added in v1.1.4
func (s *StoreFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*StoreFixtureStore) Delete ¶
func (s *StoreFixtureStore) Delete(record *StoreFixture) error
Delete removes the given record from the database.
func (*StoreFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *StoreFixtureStore) DisableCacher() *StoreFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*StoreFixtureStore) Find ¶
func (s *StoreFixtureStore) Find(q *StoreFixtureQuery) (*StoreFixtureResultSet, error)
Find returns the set of results for the given query.
func (*StoreFixtureStore) FindAll ¶ added in v1.2.1
func (s *StoreFixtureStore) FindAll(q *StoreFixtureQuery) ([]*StoreFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*StoreFixtureStore) FindOne ¶
func (s *StoreFixtureStore) FindOne(q *StoreFixtureQuery) (*StoreFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*StoreFixtureStore) GenericStore ¶ added in v1.1.0
func (s *StoreFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*StoreFixtureStore) Insert ¶
func (s *StoreFixtureStore) Insert(record *StoreFixture) error
Insert inserts a StoreFixture in the database. A non-persisted object is required for this operation.
func (*StoreFixtureStore) MustCount ¶
func (s *StoreFixtureStore) MustCount(q *StoreFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*StoreFixtureStore) MustFind ¶
func (s *StoreFixtureStore) MustFind(q *StoreFixtureQuery) *StoreFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*StoreFixtureStore) MustFindOne ¶
func (s *StoreFixtureStore) MustFindOne(q *StoreFixtureQuery) *StoreFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*StoreFixtureStore) Reload ¶
func (s *StoreFixtureStore) Reload(record *StoreFixture) error
Reload refreshes the StoreFixture with the data in the database and makes it writable.
func (*StoreFixtureStore) Save ¶
func (s *StoreFixtureStore) Save(record *StoreFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*StoreFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *StoreFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*StoreFixtureStore) Transaction ¶
func (s *StoreFixtureStore) Transaction(callback func(*StoreFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*StoreFixtureStore) Update ¶
func (s *StoreFixtureStore) Update(record *StoreFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type StoreWithConstructFixture ¶
type StoreWithConstructFixture struct { kallax.Model `table:"store_construct"` ID kallax.ULID `pk:""` Foo string }
func NewStoreWithConstructFixture ¶
func NewStoreWithConstructFixture(f string) (record *StoreWithConstructFixture)
NewStoreWithConstructFixture returns a new instance of StoreWithConstructFixture.
func (*StoreWithConstructFixture) ColumnAddress ¶
func (r *StoreWithConstructFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*StoreWithConstructFixture) GetID ¶ added in v0.13.0
func (r *StoreWithConstructFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*StoreWithConstructFixture) NewRelationshipRecord ¶
func (r *StoreWithConstructFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*StoreWithConstructFixture) SetRelationship ¶
func (r *StoreWithConstructFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*StoreWithConstructFixture) Value ¶
func (r *StoreWithConstructFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type StoreWithConstructFixtureQuery ¶
type StoreWithConstructFixtureQuery struct {
*kallax.BaseQuery
}
StoreWithConstructFixtureQuery is the object used to create queries for the StoreWithConstructFixture entity.
func NewStoreWithConstructFixtureQuery ¶
func NewStoreWithConstructFixtureQuery() *StoreWithConstructFixtureQuery
NewStoreWithConstructFixtureQuery returns a new instance of StoreWithConstructFixtureQuery.
func (*StoreWithConstructFixtureQuery) BatchSize ¶
func (q *StoreWithConstructFixtureQuery) BatchSize(size uint64) *StoreWithConstructFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*StoreWithConstructFixtureQuery) Copy ¶
func (q *StoreWithConstructFixtureQuery) Copy() *StoreWithConstructFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*StoreWithConstructFixtureQuery) FindByFoo ¶ added in v1.0.0
func (q *StoreWithConstructFixtureQuery) FindByFoo(v string) *StoreWithConstructFixtureQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*StoreWithConstructFixtureQuery) FindByID ¶ added in v1.0.0
func (q *StoreWithConstructFixtureQuery) FindByID(v ...kallax.ULID) *StoreWithConstructFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*StoreWithConstructFixtureQuery) Limit ¶
func (q *StoreWithConstructFixtureQuery) Limit(n uint64) *StoreWithConstructFixtureQuery
Limit sets the max number of items to retrieve.
func (*StoreWithConstructFixtureQuery) Offset ¶
func (q *StoreWithConstructFixtureQuery) Offset(n uint64) *StoreWithConstructFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*StoreWithConstructFixtureQuery) Order ¶
func (q *StoreWithConstructFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreWithConstructFixtureQuery
Order adds order clauses to the query for the given columns.
func (*StoreWithConstructFixtureQuery) Select ¶
func (q *StoreWithConstructFixtureQuery) Select(columns ...kallax.SchemaField) *StoreWithConstructFixtureQuery
Select adds columns to select in the query.
func (*StoreWithConstructFixtureQuery) SelectNot ¶
func (q *StoreWithConstructFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreWithConstructFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*StoreWithConstructFixtureQuery) Where ¶
func (q *StoreWithConstructFixtureQuery) Where(cond kallax.Condition) *StoreWithConstructFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type StoreWithConstructFixtureResultSet ¶
type StoreWithConstructFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
StoreWithConstructFixtureResultSet is the set of results returned by a query to the database.
func NewStoreWithConstructFixtureResultSet ¶
func NewStoreWithConstructFixtureResultSet(rs kallax.ResultSet) *StoreWithConstructFixtureResultSet
NewStoreWithConstructFixtureResultSet creates a new result set for rows of the type StoreWithConstructFixture.
func (*StoreWithConstructFixtureResultSet) All ¶
func (rs *StoreWithConstructFixtureResultSet) All() ([]*StoreWithConstructFixture, error)
All returns all records on the result set and closes the result set.
func (*StoreWithConstructFixtureResultSet) Close ¶ added in v0.12.0
func (rs *StoreWithConstructFixtureResultSet) Close() error
Close closes the result set.
func (*StoreWithConstructFixtureResultSet) Err ¶ added in v0.12.0
func (rs *StoreWithConstructFixtureResultSet) Err() error
Err returns the last error occurred.
func (*StoreWithConstructFixtureResultSet) ForEach ¶
func (rs *StoreWithConstructFixtureResultSet) ForEach(fn func(*StoreWithConstructFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*StoreWithConstructFixtureResultSet) Get ¶
func (rs *StoreWithConstructFixtureResultSet) Get() (*StoreWithConstructFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*StoreWithConstructFixtureResultSet) Next ¶
func (rs *StoreWithConstructFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*StoreWithConstructFixtureResultSet) One ¶
func (rs *StoreWithConstructFixtureResultSet) One() (*StoreWithConstructFixture, error)
One returns the first record on the result set and closes the result set.
type StoreWithConstructFixtureStore ¶
type StoreWithConstructFixtureStore struct {
*kallax.Store
}
StoreWithConstructFixtureStore is the entity to access the records of the type StoreWithConstructFixture in the database.
func NewStoreWithConstructFixtureStore ¶
func NewStoreWithConstructFixtureStore(db *sql.DB) *StoreWithConstructFixtureStore
NewStoreWithConstructFixtureStore creates a new instance of StoreWithConstructFixtureStore using a SQL database.
func (*StoreWithConstructFixtureStore) Count ¶
func (s *StoreWithConstructFixtureStore) Count(q *StoreWithConstructFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*StoreWithConstructFixtureStore) Debug ¶ added in v1.1.4
func (s *StoreWithConstructFixtureStore) Debug() *StoreWithConstructFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*StoreWithConstructFixtureStore) DebugWith ¶ added in v1.1.4
func (s *StoreWithConstructFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreWithConstructFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*StoreWithConstructFixtureStore) Delete ¶
func (s *StoreWithConstructFixtureStore) Delete(record *StoreWithConstructFixture) error
Delete removes the given record from the database.
func (*StoreWithConstructFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *StoreWithConstructFixtureStore) DisableCacher() *StoreWithConstructFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*StoreWithConstructFixtureStore) Find ¶
func (s *StoreWithConstructFixtureStore) Find(q *StoreWithConstructFixtureQuery) (*StoreWithConstructFixtureResultSet, error)
Find returns the set of results for the given query.
func (*StoreWithConstructFixtureStore) FindAll ¶ added in v1.2.1
func (s *StoreWithConstructFixtureStore) FindAll(q *StoreWithConstructFixtureQuery) ([]*StoreWithConstructFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*StoreWithConstructFixtureStore) FindOne ¶
func (s *StoreWithConstructFixtureStore) FindOne(q *StoreWithConstructFixtureQuery) (*StoreWithConstructFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*StoreWithConstructFixtureStore) GenericStore ¶ added in v1.1.0
func (s *StoreWithConstructFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*StoreWithConstructFixtureStore) Insert ¶
func (s *StoreWithConstructFixtureStore) Insert(record *StoreWithConstructFixture) error
Insert inserts a StoreWithConstructFixture in the database. A non-persisted object is required for this operation.
func (*StoreWithConstructFixtureStore) MustCount ¶
func (s *StoreWithConstructFixtureStore) MustCount(q *StoreWithConstructFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*StoreWithConstructFixtureStore) MustFind ¶
func (s *StoreWithConstructFixtureStore) MustFind(q *StoreWithConstructFixtureQuery) *StoreWithConstructFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*StoreWithConstructFixtureStore) MustFindOne ¶
func (s *StoreWithConstructFixtureStore) MustFindOne(q *StoreWithConstructFixtureQuery) *StoreWithConstructFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*StoreWithConstructFixtureStore) Reload ¶
func (s *StoreWithConstructFixtureStore) Reload(record *StoreWithConstructFixture) error
Reload refreshes the StoreWithConstructFixture with the data in the database and makes it writable.
func (*StoreWithConstructFixtureStore) Save ¶
func (s *StoreWithConstructFixtureStore) Save(record *StoreWithConstructFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*StoreWithConstructFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *StoreWithConstructFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*StoreWithConstructFixtureStore) Transaction ¶
func (s *StoreWithConstructFixtureStore) Transaction(callback func(*StoreWithConstructFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*StoreWithConstructFixtureStore) Update ¶
func (s *StoreWithConstructFixtureStore) Update(record *StoreWithConstructFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.
type StoreWithNewFixture ¶
type StoreWithNewFixture struct { kallax.Model `table:"store_new"` ID kallax.ULID `pk:""` Foo string Bar string }
func NewStoreWithNewFixture ¶
func NewStoreWithNewFixture() (record *StoreWithNewFixture)
NewStoreWithNewFixture returns a new instance of StoreWithNewFixture.
func (*StoreWithNewFixture) ColumnAddress ¶
func (r *StoreWithNewFixture) ColumnAddress(col string) (interface{}, error)
ColumnAddress returns the pointer to the value of the given column.
func (*StoreWithNewFixture) GetID ¶ added in v0.13.0
func (r *StoreWithNewFixture) GetID() kallax.Identifier
GetID returns the primary key of the model.
func (*StoreWithNewFixture) NewRelationshipRecord ¶
func (r *StoreWithNewFixture) NewRelationshipRecord(field string) (kallax.Record, error)
NewRelationshipRecord returns a new record for the relatiobship in the given field.
func (*StoreWithNewFixture) SetRelationship ¶
func (r *StoreWithNewFixture) SetRelationship(field string, rel interface{}) error
SetRelationship sets the given relationship in the given field.
func (*StoreWithNewFixture) Value ¶
func (r *StoreWithNewFixture) Value(col string) (interface{}, error)
Value returns the value of the given column.
type StoreWithNewFixtureQuery ¶
type StoreWithNewFixtureQuery struct {
*kallax.BaseQuery
}
StoreWithNewFixtureQuery is the object used to create queries for the StoreWithNewFixture entity.
func NewStoreWithNewFixtureQuery ¶
func NewStoreWithNewFixtureQuery() *StoreWithNewFixtureQuery
NewStoreWithNewFixtureQuery returns a new instance of StoreWithNewFixtureQuery.
func (*StoreWithNewFixtureQuery) BatchSize ¶
func (q *StoreWithNewFixtureQuery) BatchSize(size uint64) *StoreWithNewFixtureQuery
BatchSize sets the number of items to fetch per batch when there are 1:N relationships selected in the query.
func (*StoreWithNewFixtureQuery) Copy ¶
func (q *StoreWithNewFixtureQuery) Copy() *StoreWithNewFixtureQuery
Copy returns a new identical copy of the query. Remember queries are mutable so make a copy any time you need to reuse them.
func (*StoreWithNewFixtureQuery) FindByBar ¶ added in v1.0.0
func (q *StoreWithNewFixtureQuery) FindByBar(v string) *StoreWithNewFixtureQuery
FindByBar adds a new filter to the query that will require that the Bar property is equal to the passed value.
func (*StoreWithNewFixtureQuery) FindByFoo ¶ added in v1.0.0
func (q *StoreWithNewFixtureQuery) FindByFoo(v string) *StoreWithNewFixtureQuery
FindByFoo adds a new filter to the query that will require that the Foo property is equal to the passed value.
func (*StoreWithNewFixtureQuery) FindByID ¶ added in v1.0.0
func (q *StoreWithNewFixtureQuery) FindByID(v ...kallax.ULID) *StoreWithNewFixtureQuery
FindByID adds a new filter to the query that will require that the ID property is equal to one of the passed values; if no passed values, it will do nothing.
func (*StoreWithNewFixtureQuery) Limit ¶
func (q *StoreWithNewFixtureQuery) Limit(n uint64) *StoreWithNewFixtureQuery
Limit sets the max number of items to retrieve.
func (*StoreWithNewFixtureQuery) Offset ¶
func (q *StoreWithNewFixtureQuery) Offset(n uint64) *StoreWithNewFixtureQuery
Offset sets the number of items to skip from the result set of items.
func (*StoreWithNewFixtureQuery) Order ¶
func (q *StoreWithNewFixtureQuery) Order(cols ...kallax.ColumnOrder) *StoreWithNewFixtureQuery
Order adds order clauses to the query for the given columns.
func (*StoreWithNewFixtureQuery) Select ¶
func (q *StoreWithNewFixtureQuery) Select(columns ...kallax.SchemaField) *StoreWithNewFixtureQuery
Select adds columns to select in the query.
func (*StoreWithNewFixtureQuery) SelectNot ¶
func (q *StoreWithNewFixtureQuery) SelectNot(columns ...kallax.SchemaField) *StoreWithNewFixtureQuery
SelectNot excludes columns from being selected in the query.
func (*StoreWithNewFixtureQuery) Where ¶
func (q *StoreWithNewFixtureQuery) Where(cond kallax.Condition) *StoreWithNewFixtureQuery
Where adds a condition to the query. All conditions added are concatenated using a logical AND.
type StoreWithNewFixtureResultSet ¶
type StoreWithNewFixtureResultSet struct { ResultSet kallax.ResultSet // contains filtered or unexported fields }
StoreWithNewFixtureResultSet is the set of results returned by a query to the database.
func NewStoreWithNewFixtureResultSet ¶
func NewStoreWithNewFixtureResultSet(rs kallax.ResultSet) *StoreWithNewFixtureResultSet
NewStoreWithNewFixtureResultSet creates a new result set for rows of the type StoreWithNewFixture.
func (*StoreWithNewFixtureResultSet) All ¶
func (rs *StoreWithNewFixtureResultSet) All() ([]*StoreWithNewFixture, error)
All returns all records on the result set and closes the result set.
func (*StoreWithNewFixtureResultSet) Close ¶ added in v0.12.0
func (rs *StoreWithNewFixtureResultSet) Close() error
Close closes the result set.
func (*StoreWithNewFixtureResultSet) Err ¶ added in v0.12.0
func (rs *StoreWithNewFixtureResultSet) Err() error
Err returns the last error occurred.
func (*StoreWithNewFixtureResultSet) ForEach ¶
func (rs *StoreWithNewFixtureResultSet) ForEach(fn func(*StoreWithNewFixture) error) error
ForEach iterates over the complete result set passing every record found to the given callback. It is possible to stop the iteration by returning `kallax.ErrStop` in the callback. Result set is always closed at the end.
func (*StoreWithNewFixtureResultSet) Get ¶
func (rs *StoreWithNewFixtureResultSet) Get() (*StoreWithNewFixture, error)
Get retrieves the last fetched item from the result set and the last error.
func (*StoreWithNewFixtureResultSet) Next ¶
func (rs *StoreWithNewFixtureResultSet) Next() bool
Next fetches the next item in the result set and returns true if there is a next item. The result set is closed automatically when there are no more items.
func (*StoreWithNewFixtureResultSet) One ¶
func (rs *StoreWithNewFixtureResultSet) One() (*StoreWithNewFixture, error)
One returns the first record on the result set and closes the result set.
type StoreWithNewFixtureStore ¶
type StoreWithNewFixtureStore struct {
*kallax.Store
}
StoreWithNewFixtureStore is the entity to access the records of the type StoreWithNewFixture in the database.
func NewStoreWithNewFixtureStore ¶
func NewStoreWithNewFixtureStore(db *sql.DB) *StoreWithNewFixtureStore
NewStoreWithNewFixtureStore creates a new instance of StoreWithNewFixtureStore using a SQL database.
func (*StoreWithNewFixtureStore) Count ¶
func (s *StoreWithNewFixtureStore) Count(q *StoreWithNewFixtureQuery) (int64, error)
Count returns the number of rows that would be retrieved with the given query.
func (*StoreWithNewFixtureStore) Debug ¶ added in v1.1.4
func (s *StoreWithNewFixtureStore) Debug() *StoreWithNewFixtureStore
Debug returns a new store that will print all SQL statements to stdout using the log.Printf function.
func (*StoreWithNewFixtureStore) DebugWith ¶ added in v1.1.4
func (s *StoreWithNewFixtureStore) DebugWith(logger kallax.LoggerFunc) *StoreWithNewFixtureStore
DebugWith returns a new store that will print all SQL statements using the given logger function.
func (*StoreWithNewFixtureStore) Delete ¶
func (s *StoreWithNewFixtureStore) Delete(record *StoreWithNewFixture) error
Delete removes the given record from the database.
func (*StoreWithNewFixtureStore) DisableCacher ¶ added in v1.3.4
func (s *StoreWithNewFixtureStore) DisableCacher() *StoreWithNewFixtureStore
DisableCacher turns off prepared statements, which can be useful in some scenarios.
func (*StoreWithNewFixtureStore) Find ¶
func (s *StoreWithNewFixtureStore) Find(q *StoreWithNewFixtureQuery) (*StoreWithNewFixtureResultSet, error)
Find returns the set of results for the given query.
func (*StoreWithNewFixtureStore) FindAll ¶ added in v1.2.1
func (s *StoreWithNewFixtureStore) FindAll(q *StoreWithNewFixtureQuery) ([]*StoreWithNewFixture, error)
FindAll returns a list of all the rows returned by the given query.
func (*StoreWithNewFixtureStore) FindOne ¶
func (s *StoreWithNewFixtureStore) FindOne(q *StoreWithNewFixtureQuery) (*StoreWithNewFixture, error)
FindOne returns the first row returned by the given query. `ErrNotFound` is returned if there are no results.
func (*StoreWithNewFixtureStore) GenericStore ¶ added in v1.1.0
func (s *StoreWithNewFixtureStore) GenericStore() *kallax.Store
GenericStore returns the generic store of this store.
func (*StoreWithNewFixtureStore) Insert ¶
func (s *StoreWithNewFixtureStore) Insert(record *StoreWithNewFixture) error
Insert inserts a StoreWithNewFixture in the database. A non-persisted object is required for this operation.
func (*StoreWithNewFixtureStore) MustCount ¶
func (s *StoreWithNewFixtureStore) MustCount(q *StoreWithNewFixtureQuery) int64
MustCount returns the number of rows that would be retrieved with the given query, but panics if there is an error.
func (*StoreWithNewFixtureStore) MustFind ¶
func (s *StoreWithNewFixtureStore) MustFind(q *StoreWithNewFixtureQuery) *StoreWithNewFixtureResultSet
MustFind returns the set of results for the given query, but panics if there is any error.
func (*StoreWithNewFixtureStore) MustFindOne ¶
func (s *StoreWithNewFixtureStore) MustFindOne(q *StoreWithNewFixtureQuery) *StoreWithNewFixture
MustFindOne returns the first row retrieved by the given query. It panics if there is an error or if there are no rows.
func (*StoreWithNewFixtureStore) Reload ¶
func (s *StoreWithNewFixtureStore) Reload(record *StoreWithNewFixture) error
Reload refreshes the StoreWithNewFixture with the data in the database and makes it writable.
func (*StoreWithNewFixtureStore) Save ¶
func (s *StoreWithNewFixtureStore) Save(record *StoreWithNewFixture) (updated bool, err error)
Save inserts the object if the record is not persisted, otherwise it updates it. Same rules of Update and Insert apply depending on the case.
func (*StoreWithNewFixtureStore) SetGenericStore ¶ added in v1.1.0
func (s *StoreWithNewFixtureStore) SetGenericStore(store *kallax.Store)
SetGenericStore changes the generic store of this store.
func (*StoreWithNewFixtureStore) Transaction ¶
func (s *StoreWithNewFixtureStore) Transaction(callback func(*StoreWithNewFixtureStore) error) error
Transaction executes the given callback in a transaction and rollbacks if an error is returned. The transaction is only open in the store passed as a parameter to the callback.
func (*StoreWithNewFixtureStore) Update ¶
func (s *StoreWithNewFixtureStore) Update(record *StoreWithNewFixture, cols ...kallax.SchemaField) (updated int64, err error)
Update updates the given record on the database. If the columns are given, only these columns will be updated. Otherwise all of them will be. Be very careful with this, as you will have a potentially different object in memory but not on the database. Only writable records can be updated. Writable objects are those that have been just inserted or retrieved using a query with no custom select fields.