Versions in this module Expand all Collapse all v1 v1.0.6 Nov 23, 2023 v1.0.5 Jul 3, 2023 v1.0.4 Jun 26, 2023 v1.0.3 Jan 31, 2023 Changes in this version type DialectHandler + GetConfig func() DBConfig + SetConfig func(config DBConfig) type Mysql + func (m *Mysql) GetConfig() DBConfig + func (m *Mysql) SetConfig(config DBConfig) type Postgres + func (pd *Postgres) GetConfig() DBConfig + func (pd *Postgres) SetConfig(config DBConfig) type SQLite + func (s *SQLite) GetConfig() DBConfig + func (s *SQLite) SetConfig(config DBConfig) v1.0.2 Jan 18, 2023 v1.0.1 Jan 18, 2023 Changes in this version + func BulkDelete(db *sql.DB, model any, dialectType string) error type DialectHandler + BulkDelete func(model any) error type Mysql + func (m *Mysql) BulkDelete(model any) error type Postgres + func (pd *Postgres) BulkDelete(model any) error type SQLite + func (s *SQLite) BulkDelete(model any) error v1.0.0 Jan 16, 2023 Changes in this version + const DIALECT_TYPE_MYSQL + const DIALECT_TYPE_PSQL + const DIALECT_TYPE_SQLITE + var Databases map[string]DialectHandler + func Create(db *sql.DB, model any, dialectType string) error + func Delete(db *sql.DB, model any, dialectType string) error + func Find(db *sql.DB, model any, dialectType string, args ...any) error + func Update(db *sql.DB, model any, dialectType string) error + func Where(db *sql.DB, model any, stmt string, limit int, dialectType string, args ...any) error + type DBConfig struct + Auth bool + Connect bool + Database string + Dialect string + Host string + MaxIdleConn int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpenConn int + Password string + Path string + Pool int + Port int + User string + type DialectHandler interface + Create func(model any) error + Delete func(model any) error + Find func(model any, args ...any) error + QueryString func(connInfo DBConfig) string + Raw func(query string, args ...any) (*RawQuery, error) + SetDB func(connDB *sql.DB) + Update func(model any) error + Where func(model any, stmt string, limit int, args ...any) error + type MultiTenantDialectHandler struct + Handlers map[string]DialectHandler + func (mtd *MultiTenantDialectHandler) Set(key string, handler DialectHandler) + func (mtd MultiTenantDialectHandler) Empty() bool + func (mtd MultiTenantDialectHandler) SwitchDB(database string) DialectHandler + type Mysql struct + func (m *Mysql) Create(model any) error + func (m *Mysql) Delete(model any) error + func (m *Mysql) Find(model any, args ...any) error + func (m *Mysql) QueryString(connInfo DBConfig) string + func (m *Mysql) Raw(query string, args ...any) (*RawQuery, error) + func (m *Mysql) SetDB(connDB *sql.DB) + func (m *Mysql) Update(model any) error + func (m *Mysql) Where(model any, stmt string, limit int, args ...any) error + type Postgres struct + func (pd *Postgres) Create(model any) error + func (pd *Postgres) Delete(model any) error + func (pd *Postgres) Find(model any, args ...any) error + func (pd *Postgres) QueryString(c DBConfig) string + func (pd *Postgres) Raw(query string, args ...any) (*RawQuery, error) + func (pd *Postgres) SetDB(connDB *sql.DB) + func (pd *Postgres) Update(model any) error + func (pd *Postgres) Where(model any, stmt string, limit int, args ...any) error + type RawQuery struct + func Raw(db *sql.DB, query string, args ...any) (*RawQuery, error) + func (rq *RawQuery) All(model any) error + func (rq *RawQuery) Exec() error + type SQLite struct + func (s *SQLite) Create(model any) error + func (s *SQLite) Delete(model any) error + func (s *SQLite) Find(model any, args ...any) error + func (s *SQLite) QueryString(connInfo DBConfig) string + func (s *SQLite) Raw(query string, args ...any) (*RawQuery, error) + func (s *SQLite) SetDB(connDB *sql.DB) + func (s *SQLite) Update(model any) error + func (s *SQLite) Where(model any, stmt string, limit int, args ...any) error