Documentation
¶
Index ¶
- type ColumnInfo
- type DB
- func (db *DB) ListDatabases(logger zerolog.Logger, driverName string) ([]string, error)
- func (db *DB) ListTables(logger zerolog.Logger, driverName, databaseName string) ([]string, error)
- func (db *DB) Query(logger zerolog.Logger, driverName, query string, isSelect bool, ...) ([]map[string]interface{}, []ColumnInfo, int, error)
- func (db *DB) SelectDatabase(logger zerolog.Logger, driverName, databaseName string)
- func (db *DB) TotalPages(logger zerolog.Logger, query string, pageSize int) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type DB ¶
DB wraps the sqlx.DB connection
func NewConnection ¶
func NewConnection(logger zerolog.Logger, env *environment.Environment) (*DB, error)
NewConnection establishes a database connection with retry logic
func (*DB) ListDatabases ¶
ListDatabases retrieves and returns a list of all databases. It supports multiple database types (MySQL, PostgreSQL, SQLite, etc.).
func (*DB) ListTables ¶
ListTables retrieves and returns a list of all tables in the specified database. It supports multiple database types (MySQL, PostgreSQL, SQLite, etc.).
func (*DB) Query ¶
func (db *DB) Query(logger zerolog.Logger, driverName, query string, isSelect bool, page, pageSize int) ([]map[string]interface{}, []ColumnInfo, int, error)
Query executes a query and delegates to the appropriate handler based on query type and driver
func (*DB) SelectDatabase ¶
SelectDatabase sets the active database for the connection. It supports multiple database types (MySQL, PostgreSQL, etc.).
Click to show internal directories.
Click to hide internal directories.