Documentation
¶
Index ¶
Constants ¶
View Source
const SchemaApplyTimeout = 5 * time.Second
Variables ¶
View Source
var ErrUnique = errors.New("unique constraint failed")
Failed unique constraint, conflict.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶ added in v0.10.0
type Dialect string
Dialect identifies the underlying database engine.
type NullTimeScanner ¶ added in v1.0.0
NullTimeScanner implements database/sql.Scanner for nullable time.Time values stored as RFC3339 strings. T must point to the *time.Time field on the destination struct; it is set to nil when the column value is NULL.
func (NullTimeScanner) Scan ¶ added in v1.0.0
func (n NullTimeScanner) Scan(value any) error
Scan implements database/sql.Scanner.
type SQLClient ¶
type SQLClient interface {
// Begin starts a new transaction.
Begin(ctx context.Context) (Transaction, error)
// Exec executes a standard query without returning any rows.
Exec(ctx context.Context, stmt string, args ...any) (sql.Result, error)
// Query executes a standard query, returning resulting rows.
Query(ctx context.Context, stmt string, args ...any) (*sql.Rows, error)
// Dialect returns the underlying database dialect.
Dialect() Dialect
}
type TimeString ¶ added in v1.0.0
TimeString implements database/sql.Scanner for time.Time values stored as RFC3339/RFC3339Nano strings (e.g. by the SQLite driver).
func (*TimeString) Scan ¶ added in v1.0.0
func (t *TimeString) Scan(value any) error
Scan implements database/sql.Scanner.
type Transaction ¶ added in v0.6.0
type Transaction interface {
// Exec executes a standard query without returning any rows.
Exec(ctx context.Context, stmt string, args ...any) (sql.Result, error)
// Query executes a standard query, returning resulting rows.
Query(ctx context.Context, stmt string, args ...any) (*sql.Rows, error)
// Commit commits the transaction.
Commit() error
// Rollback rolls the transaction back.
Rollback() error
}
Click to show internal directories.
Click to hide internal directories.