Documentation ¶
Index ¶
- type Database
- func (db *Database) Close() error
- func (db *Database) Exec(sql string, data ...interface{}) error
- func (db *Database) GetDatabase() *sql.DB
- func (db *Database) GetLastInsertId() uint64
- func (db *Database) GetOne(sql string, data ...interface{}) ([]byte, error)
- func (db *Database) GetRecord(sqlString string, data ...interface{}) (map[string]interface{}, error)
- func (db *Database) GetRecords(sqlString string, data ...interface{}) ([]map[string]interface{}, error)
- func (db *Database) GetResult() (sql.Result, error)
- func (db *Database) GetStmt(sql string) (*sql.Stmt, error)
- func (db *Database) Insert(tableName string, data map[string]interface{}) error
- func (db *Database) IsConnected() bool
- func (db *Database) IsMySQL() bool
- func (db *Database) IsPostgres() bool
- func (db *Database) IsSQLite() bool
- func (db *Database) NewDB(cfg *conf.DBConfiguration) error
- func (db *Database) Update(tableName string, data map[string]interface{}) error
- type IDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func NewDatabase(cfg *conf.DBConfiguration) (*Database, error)
func (*Database) GetDatabase ¶
func (*Database) GetLastInsertId ¶
func (*Database) GetRecords ¶
func (*Database) IsConnected ¶
func (*Database) IsPostgres ¶
type IDatabase ¶
type IDatabase interface { NewDB(*conf.DBConfiguration) error Exec(sql string, data ...interface{}) error GetOne(sql string, data ...interface{}) ([]byte, error) GetRecord(sql string, data ...interface{}) (map[string]interface{}, error) GetRecords(sql string, data ...interface{}) ([]map[string]interface{}, error) Insert(tableName string, data map[string]interface{}) error Update(tableName string, data map[string]interface{}) error IsConnected() bool IsSQLite() bool IsMySQL() bool IsPostgres() bool GetLastInsertId() uint64 GetResult() (sql.Result, error) GetDatabase() *sql.DB }
Click to show internal directories.
Click to hide internal directories.