Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuilderFor ¶ added in v1.14.0
BuilderFor returns a squirrel statement builder which decorates the provided sql.DB configured for the provided driver.
func WithMigrate ¶ added in v1.14.0
func WithMigrate(o *Options)
func WithSSLDisabled ¶ added in v1.14.0
func WithSSLDisabled(o *Options)
Types ¶
type Driver ¶
type Driver uint8
Driver represents a database driver
const ( // SQLite ... SQLite Driver // Postgres ... Postgres // MySQL ... MySQL // CockroachDB ... CockroachDB // LibSQL ... LibSQL // Clickhouse ... Clickhouse )
func (Driver) AdaptError ¶ added in v1.15.0
AdaptError converts specific known-driver errors into wrapped storage errors.
func (Driver) Migrations ¶ added in v1.29.0
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is responsible for migrating the database schema
func NewAnalyticsMigrator ¶ added in v1.37.0
NewAnalyticsMigrator returns a migrator for analytics databases
func NewMigrator ¶
NewMigrator creates a new Migrator
type MockDriverContext ¶ added in v1.41.0
MockDriverContext is an autogenerated mock type for the DriverContext type
func NewMockDriverContext ¶ added in v1.41.0
func NewMockDriverContext(t interface { mock.TestingT Cleanup(func()) }) *MockDriverContext
NewMockDriverContext creates a new instance of MockDriverContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockDriverContext) OpenConnector ¶ added in v1.41.0
func (_m *MockDriverContext) OpenConnector(name string) (driver.Connector, error)
OpenConnector provides a mock function with given fields: name
type NullableTimestamp ¶ added in v1.15.0
type NullableTimestamp Timestamp
func (*NullableTimestamp) Scan ¶ added in v1.15.0
func (t *NullableTimestamp) Scan(value interface{}) error