Documentation
¶
Index ¶
- Constants
- func Exec(ctx context.Context, ex Executor, sql string, args ...any) error
- func IsDatabaseConnected(ctx context.Context, db *sql.DB) (perr error)
- func LoadDatabase(addr string, addrConnMax int) (drv string, db *sql.DB, err error)
- func ParseAddress(addr string) (drv, dsn string, err error)
- type DMLInsert
- type DMLLevel
- type Executor
- type Parsed
- type TCLLevel
Constants ¶
View Source
const ( MySQLDialect = "mysql" MariaDBDialect = MySQLDialect PostgresDialect = "postgres" OracleDialect = "oracle" SQLServerDialect = "mssql" )
Variables ¶
This section is empty.
Functions ¶
func LoadDatabase ¶
func ParseAddress ¶
Types ¶
type Parsed ¶ added in v0.2.0
type Parsed interface { // Origin returns the original SQL. Origin() string // Unknown returns true if not matched any languages. Unknown() bool // TCL returns the TCLLevel and true if the Origin is transaction control language. TCL() (TCLLevel, bool) // DCL returns true if the Origin is data control language. DCL() bool // DDL returns true if the Origin is data definition language. DDL() bool // DML returns the DMLLevel and true if the Origin is data manipulation language. DML() (DMLLevel, bool) // AsDMLInsert returns the structuring insert statement if possible. AsDMLInsert() (DMLInsert, bool) }
Click to show internal directories.
Click to hide internal directories.