Documentation ¶
Index ¶
- Constants
- func BeginTransactionError(t Table, err error) error
- func CommitTransactionError(t Table, err error) error
- func ConfigureDatabase(ctx context.Context, db *sql.DB, opts *ConfigureDatabaseOptions) error
- func ConfigurePostgresDatabase(ctx context.Context, db *sql.DB, opts *ConfigureDatabaseOptions) error
- func ConfigureSQLiteDatabase(ctx context.Context, db *sql.DB, opts *ConfigureDatabaseOptions) error
- func ConfigureSQLitePragma(ctx context.Context, db *sql.DB, pragma []string) error
- func CreateTableIfNecessary(ctx context.Context, db *sql.DB, t Table) error
- func DatabaseConnectionError(t Table, err error) error
- func DefaultSQLitePragma() []string
- func Driver(db *sql.DB) string
- func DriverTypeOf(db *sql.DB) string
- func ExecuteStatementError(t Table, err error) error
- func HasPostgresTable(ctx context.Context, db *sql.DB, table_name string) (bool, error)
- func HasSQLiteTable(ctx context.Context, db *sql.DB, table_name string) (bool, error)
- func HasTable(ctx context.Context, db *sql.DB, table_name string) (bool, error)
- func InitializeTableError(t Table, err error) error
- func LoadDuckDBExtensions(ctx context.Context, db *db_sql.DB, extensions ...string) error
- func OpenWithURI(ctx context.Context, db_uri string) (*sql.DB, error)
- func PrepareStatementError(t Table, err error) error
- func WrapError(t Table, err error) error
- type ConfigureDatabaseOptions
- type Table
Constants ¶
const MYSQL_DRIVER string = "mysql"
const POSTGRES_DRIVER string = "postgres"
const SQLITE_DRIVER string = "sqlite"
Variables ¶
This section is empty.
Functions ¶
func BeginTransactionError ¶
BeginTransactionError returns a new error with a default message for database transaction initialization problems wrapping 'err' and prepending with the value of 't's Name() method.
func CommitTransactionError ¶
CommitTransactionError returns a new error with a default message for problems committing database transactions wrapping 'err' and prepending with the value of 't's Name() method.
func ConfigureDatabase ¶
func ConfigurePostgresDatabase ¶ added in v0.0.8
func ConfigureSQLiteDatabase ¶
func ConfigureSQLitePragma ¶
func CreateTableIfNecessary ¶
func DatabaseConnectionError ¶
DatabaseConnectionError returns a new error with a default message for database connection problems wrapping 'err' and prepending with the value of 't's Name() method.
func DefaultSQLitePragma ¶
func DefaultSQLitePragma() []string
func DriverTypeOf ¶
func ExecuteStatementError ¶
ExecuteStatementError returns a new error with a default message for problems executing database (SQL) statements wrapping 'err' and prepending with the value of 't's Name() method.
func HasPostgresTable ¶ added in v0.0.8
func HasSQLiteTable ¶
func InitializeTableError ¶
InitializeTableError returns a new error with a default message for database initialization problems wrapping 'err' and prepending with the value of 't's Name() method.
func LoadDuckDBExtensions ¶ added in v0.0.12
LoadDuckDBExtensions will issue 'INSTALL' and 'LOAD' statements for 'extensions' using 'db'.
func PrepareStatementError ¶
PrepareStatementError returns a new error with a default message for problems preparing database (SQL) statements wrapping 'err' and prepending with the value of 't's Name() method.
Types ¶
type ConfigureDatabaseOptions ¶
type ConfigureDatabaseOptions struct { CreateTablesIfNecessary bool Tables []Table Pragma []string }
func DefaultConfigureDatabaseOptions ¶
func DefaultConfigureDatabaseOptions() *ConfigureDatabaseOptions