Documentation ¶
Index ¶
- Constants
- func Connect(c *Config) (*gorm.DB, error)
- type Config
- type Database
- func (d *Database) CountAll(mod model.Model) int64
- func (d *Database) Create(mod model.Model) error
- func (d *Database) Delete(mod model.Model) error
- func (d *Database) FetchAll(mod model.Model, rows interface{}) error
- func (d *Database) FetchLatest(mod model.Model, creationColumn string) error
- func (d *Database) FetchOne(mod model.Model) error
- func (d *Database) FetchOnly(mod model.Model, limit int, rows interface{}) error
- func (d *Database) FetchPage(mod model.Model, limit int, offset int, rows interface{}) error
- func (d *Database) Save(mod model.Model) error
- func (d *Database) Transaction(transaction func(tx *gorm.DB) error) error
- func (d *Database) Upsert(mod model.Model) error
- type Repository
Constants ¶
View Source
const ( PostGreType = iota MySQLType )
View Source
const ( MaxIdle = 0 MaxConnections = 10 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string Port int Database string User string Pass string DatabaseType int SSLMode string }
func (*Config) ConnectionString ¶
type Database ¶
func NewDatabase ¶
func (*Database) FetchLatest ¶
func (*Database) Transaction ¶
type Repository ¶
Click to show internal directories.
Click to hide internal directories.