Documentation ¶
Index ¶
- type Database
- func (d *Database) AddForeignKey(tableStruct interface{}, field, dest, onDelete, onUpdate string) error
- func (d *Database) AddUniqueIndex(tableStruct interface{}, indexName string, fields ...string) error
- func (d *Database) CreateDB(dbName string) error
- func (d *Database) CreateEnum(enumName string, values []string) error
- func (d *Database) CreateTables(tablesStruct ...interface{}) error
- func (d *Database) DropDB(dbName string) error
- func (d *Database) DropEnum(enumName string) error
- func (d *Database) MigrateDB(tableStruct ...interface{}) error
- func (d *Database) UpdateEnum(enumName, value string) error
- func (d *Database) WithEndingBefore(tableName string, limit uint, before string) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithExternalIDs(tableName string, externalIDs []sql.NullString) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithIDs(tableName string, ids []string) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithIds(ids []uint, tableName string) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithLimitAndOffset(limit uint, offset uint) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithNotIds(ids []uint, tableName string) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithOrgID(tableName string, id uint) func(db *gorm.DB) *gorm.DB
- func (d *Database) WithStartingAfter(tableName string, limit uint, after string) func(db *gorm.DB) *gorm.DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
Database GORM wrapper
func (*Database) AddForeignKey ¶
func (d *Database) AddForeignKey(tableStruct interface{}, field, dest, onDelete, onUpdate string) error
AddForeignKey adds constraints to table
func (*Database) AddUniqueIndex ¶
func (d *Database) AddUniqueIndex(tableStruct interface{}, indexName string, fields ...string) error
AddUniqueIndex adds unique index to table
func (*Database) CreateEnum ¶ added in v0.2.0
CreateEnum creates enum in database
func (*Database) CreateTables ¶
CreateTables creates DB tables from table structs
func (*Database) UpdateEnum ¶ added in v0.2.0
UpdateEnum updates enum in database
func (*Database) WithEndingBefore ¶ added in v0.5.0
func (d *Database) WithEndingBefore(tableName string, limit uint, before string) func(db *gorm.DB) *gorm.DB
WithStartingAfter is a query scope for cursors
func (*Database) WithExternalIDs ¶ added in v0.5.0
func (d *Database) WithExternalIDs(tableName string, externalIDs []sql.NullString) func(db *gorm.DB) *gorm.DB
WithStartingAfter is a query scope for external IDs
func (*Database) WithIDs ¶ added in v0.5.0
WithIDs is a query scope to include the given IDs (string IDs)
func (*Database) WithLimitAndOffset ¶
WithLimitAndOffset is a query scope function for pagination
func (*Database) WithNotIds ¶
WithNotIds is a query scope function to exclude given ids
Click to show internal directories.
Click to hide internal directories.