Versions in this module Expand all Collapse all v5 v5.0.1 Apr 10, 2026 Changes in this version + var ErrDatabaseNotReady = platformerrors.New("database is not ready yet") + var ErrUserAlreadyExists = platformerrors.New("user already exists") + func BoolFromNullBool(b sql.NullBool) bool + func Float32FromNullString(s sql.NullString) float32 + func Float32FromString(s string) float32 + func Float32PointerFromNullString(f sql.NullString) *float32 + func Float64PointerFromNullString(f sql.NullString) *float64 + func Int32PointerFromNullInt32(i sql.NullInt32) *int32 + func NullBoolFromBool(b bool) sql.NullBool + func NullBoolFromBoolPointer(b *bool) sql.NullBool + func NullInt32FromInt32Pointer(i *int32) sql.NullInt32 + func NullInt32FromUint16(i uint16) sql.NullInt32 + func NullInt32FromUint16Pointer(i *uint16) sql.NullInt32 + func NullInt32FromUint32Pointer(i *uint32) sql.NullInt32 + func NullInt32FromUint8Pointer(i *uint8) sql.NullInt32 + func NullInt64FromUint32Pointer(f *uint32) sql.NullInt64 + func NullStringFromFloat32(f float32) sql.NullString + func NullStringFromFloat32Pointer(f *float32) sql.NullString + func NullStringFromFloat64Pointer(f *float64) sql.NullString + func NullStringFromString(s string) sql.NullString + func NullStringFromStringPointer(s *string) sql.NullString + func NullTimeFromTime(t time.Time) sql.NullTime + func NullTimeFromTimePointer(t *time.Time) sql.NullTime + func StringFromFloat32(f float32) string + func StringFromFloat64(f float64) string + func StringFromNullString(nt sql.NullString) string + func StringPointerFromNullString(nt sql.NullString) *string + func TimeFromNullTime(nt sql.NullTime) time.Time + func TimePointerFromNullTime(nt sql.NullTime) *time.Time + func Uint16PointerFromNullInt32(f sql.NullInt32) *uint16 + func Uint32PointerFromNullInt32(f sql.NullInt32) *uint32 + func Uint32PointerFromNullInt64(f sql.NullInt64) *uint32 + type Client interface + Close func() error + CurrentTime func() time.Time + ReadDB func() *sql.DB + RollbackTransaction func(ctx context.Context, tx SQLQueryExecutorAndTransactionManager) + WriteDB func() *sql.DB + type ClientConfig interface + GetConnMaxLifetime func() time.Duration + GetMaxIdleConns func() int + GetMaxOpenConns func() int + GetMaxPingAttempts func() uint64 + GetPingWaitPeriod func() time.Duration + GetReadConnectionString func() string + GetWriteConnectionString func() string + type Manager interface + CreateDatabase func(ctx context.Context, dbName, owner string) error + CreateUser func(ctx context.Context, username, password string) error + DatabaseExists func(ctx context.Context, dbName string) (bool, error) + DeleteDatabase func(ctx context.Context, dbName string) error + DeleteUser func(ctx context.Context, username string) error + GrantUserAccessToTable func(ctx context.Context, username, schema, table, privilege string) error + UserCanAccessDatabase func(ctx context.Context, username, dbName string) (bool, error) + UserExists func(ctx context.Context, username string) (bool, error) + type Migrator interface + Migrate func(ctx context.Context, db *sql.DB) error + type MockClient struct + func (m *MockClient) Close() error + func (m *MockClient) CurrentTime() time.Time + func (m *MockClient) ReadDB() *sql.DB + func (m *MockClient) RollbackTransaction(ctx context.Context, tx SQLQueryExecutorAndTransactionManager) + func (m *MockClient) WriteDB() *sql.DB + type MockDatabase struct + func NewMockDatabase() *MockDatabase + func (m *MockDatabase) BeginTx(ctx context.Context, options *sql.TxOptions) (*sql.Tx, error) + func (m *MockDatabase) Close() + func (m *MockDatabase) DB() *sql.DB + func (m *MockDatabase) IsReady(ctx context.Context) (ready bool) + func (m *MockDatabase) Migrate(ctx context.Context) error + func (m *MockDatabase) ReadDB() *sql.DB + func (m *MockDatabase) WriteDB() *sql.DB + type MockQueryExecutor struct + func (m *MockQueryExecutor) ExecContext(ctx context.Context, query string, queryArgs ...any) (sql.Result, error) + func (m *MockQueryExecutor) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) + func (m *MockQueryExecutor) QueryContext(ctx context.Context, query string, queryArgs ...any) (*sql.Rows, error) + func (m *MockQueryExecutor) QueryRowContext(ctx context.Context, query string, queryArgs ...any) *sql.Row + type MockResultIterator struct + func (m *MockResultIterator) Close() error + func (m *MockResultIterator) Err() error + func (m *MockResultIterator) Next() bool + func (m *MockResultIterator) Scan(dest ...any) error + type MockSQLResult struct + func (m *MockSQLResult) LastInsertId() (int64, error) + func (m *MockSQLResult) RowsAffected() (int64, error) + type ResultIterator interface + Err func() error + Next func() bool + type SQLQueryExecutor interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + PrepareContext func(context.Context, string) (*sql.Stmt, error) + QueryContext func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...any) *sql.Row + type SQLQueryExecutorAndTransactionManager interface + type SQLTransactionManager interface + Rollback func() error + type Scanner interface + Scan func(dest ...any) error Other modules containing this package github.com/verygoodsoftwarenotvirus/platform github.com/verygoodsoftwarenotvirus/platform/v2 github.com/verygoodsoftwarenotvirus/platform/v3 github.com/verygoodsoftwarenotvirus/platform/v4