Documentation ¶
Index ¶
- func ConnectDB(connInfo *SQLConnectionInfo) (*sql.DB, error)
- func DeleteTable(db *sql.DB, tableName string, databaseType DatabaseType) error
- func DuplicateTable(db *sql.DB, originalTableName, newTableName string, databaseType DatabaseType) error
- func EditRecord(db *sql.DB, tableName string, record TableRecord, updateColumn string, ...) error
- func GetColumns(db *sql.DB, tableName string, databaseType DatabaseType) ([]string, error)
- func GetPrimaryKeys(db *sql.DB, dbName, tableName string, databaseType DatabaseType) ([]string, error)
- func GetTable(db *sql.DB, tableName string, dbType DatabaseType) ([]map[string]interface{}, error)
- func GetTables(db *sql.DB, dbName string, dbType DatabaseType) ([]string, error)
- func InsertRecord(db *sql.DB, tableName string, record TableRecord, databaseType DatabaseType) (int64, error)
- func RemoveRecord(db *sql.DB, dbName, tableName string, databaseType DatabaseType, ...) (int64, error)
- func RenameTable(db *sql.DB, oldTableName string, newTableName string, ...) error
- type DatabaseType
- type SQLConnectionInfo
- type TableRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteTable ¶
func DeleteTable(db *sql.DB, tableName string, databaseType DatabaseType) error
func DuplicateTable ¶
func DuplicateTable(db *sql.DB, originalTableName, newTableName string, databaseType DatabaseType) error
func EditRecord ¶
func EditRecord( db *sql.DB, tableName string, record TableRecord, updateColumn string, updateValue any, databaseType DatabaseType, ) error
func GetColumns ¶
func GetPrimaryKeys ¶
func InsertRecord ¶
func InsertRecord( db *sql.DB, tableName string, record TableRecord, databaseType DatabaseType, ) (int64, error)
func RemoveRecord ¶
func RemoveRecord( db *sql.DB, dbName, tableName string, databaseType DatabaseType, record TableRecord, ) (int64, error)
func RenameTable ¶
Types ¶
type DatabaseType ¶
type DatabaseType string
const ( PostgreSQL DatabaseType = "postgres" MySQL DatabaseType = "mysql" SQLite DatabaseType = "sqlite3" SQLServer DatabaseType = "sqlserver" Oracle DatabaseType = "oracle" MariaDB DatabaseType = "mariadb" CockroachDB DatabaseType = "cockroachdb" )
type SQLConnectionInfo ¶
type TableRecord ¶
type TableRecord map[string]interface{}
Click to show internal directories.
Click to hide internal directories.