Documentation ¶
Index ¶
- type Base
- type Database
- func (database *Database) Create(transaction *gorm.DB, object interface{}) error
- func (database *Database) Delete(transaction *gorm.DB, target interface{}, objectID uuid.UUID) error
- func (database *Database) DeleteWhere(transaction *gorm.DB, target interface{}, where ...interface{}) error
- func (database *Database) GetCursor(transaction *gorm.DB) *gorm.DB
- func (database *Database) PaginatedReadAllWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, ...) (int, error)
- func (database *Database) Read(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, ...) error
- func (database *Database) ReadAll(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, ...) error
- func (database *Database) ReadAllWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, ...) error
- func (database *Database) ReadWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, ...) error
- func (database *Database) TransactionBegin() *gorm.DB
- func (database *Database) TransactionCommit(transaction *gorm.DB) error
- func (database *Database) TransactionRollback(transaction *gorm.DB)
- func (database *Database) Update(transaction *gorm.DB, object interface{}) error
- type JustID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
Base Model that contains create, update, and soft delete times along with a UUID primary key.
type Database ¶
Database is a wrapper around GORM.
func GetPostgres ¶
GetPostgres will return a Database.
func (*Database) Delete ¶
func (database *Database) Delete(transaction *gorm.DB, target interface{}, objectID uuid.UUID) error
Delete will delete an existing row by it's objectID.
func (*Database) DeleteWhere ¶
func (database *Database) DeleteWhere(transaction *gorm.DB, target interface{}, where ...interface{}) error
DeleteWhere will delete all existing rows by a SQL search.
func (*Database) PaginatedReadAllWhere ¶
func (database *Database) PaginatedReadAllWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, preloads []string, page int, size int, where ...interface{}) (int, error)
PaginatedReadAllWhere finds all rows by a SQL search that is limited and offset. Also returns the row count.
func (*Database) Read ¶
func (database *Database) Read(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, preloads []string, objectID uuid.UUID) error
Read finds a row by it's objectID.
func (*Database) ReadAll ¶
func (database *Database) ReadAll(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, preloads []string) error
ReadAll finds all rows.
func (*Database) ReadAllWhere ¶
func (database *Database) ReadAllWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, preloads []string, where ...interface{}) error
ReadAllWhere finds all rows by a SQL search.
func (*Database) ReadWhere ¶
func (database *Database) ReadWhere(transaction *gorm.DB, target interface{}, orderBy string, selectKeys string, preloads []string, where ...interface{}) error
ReadWhere finds a row by a SQL search.
func (*Database) TransactionBegin ¶
TransactionBegin will begin a transaction.
func (*Database) TransactionCommit ¶
TransactionCommit will attempt to commit a transaction.
func (*Database) TransactionRollback ¶
TransactionRollback will rollback a transaction.