Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSQLName ¶
func GenerateSQLName() string
GenerateSQLName generates a unique safe name that can be used for a database or table name
Types ¶
type SQLBuilder ¶ added in v1.4.0
type SQLBuilder interface {
// Select returns a SelectBuilder
Select(columns ...string) squirrel.SelectBuilder
// Insert returns a InsertBuilder
Insert(into string) squirrel.InsertBuilder
// Update returns a UpdateBuilder
Update(table string) squirrel.UpdateBuilder
// Delete returns a DeleteBuilder
Delete(from string) squirrel.DeleteBuilder
// RunWith sets the RunWith field for any child builders.
RunWith(runner squirrel.BaseRunner) squirrel.StatementBuilderType
}
SQLBuilder describes a basic SQL builder using the squirrel library
type SQLDB ¶
type SQLDB interface {
// Query executes the given query as implemented by database/sql.Query.
Query(string, ...interface{}) (*sql.Rows, error)
// QueryContext executes a query that returns rows, typically a SELECT.
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
// QueryRow executes a query that is expected to return at most one row. QueryRow always returns a
// non-nil value.
QueryRow(string, ...interface{}) *sql.Row
// QueryRowContext executes a query that is expected to return at most one row. QueryRow always
// returns a non-nil value.
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
// Exec executes a query without returning any rows.
Exec(string, ...interface{}) (sql.Result, error)
// ExecContext executes a query without returning any rows.
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
}
SQLDB is the standard SQL database interface which the standard library should have but it does not
type TraceableDB ¶
TraceableDB is the SQL database wrapped with open tracing
func WrapWithTracing ¶
func WrapWithTracing(db SQLDB) TraceableDB
WrapWithTracing Wraps a SQL database with open tracing and logging
Click to show internal directories.
Click to hide internal directories.