Documentation ¶
Index ¶
- func SanitizeDBName(dbName *string) bool
- type Db
- func (db *Db) ApplyMigration(locations string) error
- func (db *Db) Close() error
- func (db *Db) Connect(dbHost string, dbPort uint, dbName string, dbUser string, dbPass string, ...) error
- func (db *Db) CreateDatabase(dbName string, owner string, dropIfExists bool) error
- func (db *Db) DbExists(dbName string) bool
- func (db *Db) Exec(sql string) (sql.Result, error)
- func (db *Db) Query(sql string, values ...any) (*sql.Rows, error)
- func (db *Db) Queryf(sql string, values ...any) (*sql.Rows, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeDBName ¶
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
func NewDbConnection ¶
func (*Db) ApplyMigration ¶
func (*Db) CreateDatabase ¶
CreateDatabase - Create database if not exists (with option to drop the database first)
Click to show internal directories.
Click to hide internal directories.