Documentation ¶
Index ¶
- Constants
- func GetQueryFromFile(filename string) (string, error)
- func NewOptions(opts ...OptionFunc) *provider.Options
- type OptionFunc
- func WithConnectionString(connectionString string) OptionFunc
- func WithContext(ctx context.Context) OptionFunc
- func WithDriver(driver provider.NamedProvider) OptionFunc
- func WithHost(host string) OptionFunc
- func WithName(name string) OptionFunc
- func WithPassword(password string) OptionFunc
- func WithPoolSize(poolSize int) OptionFunc
- func WithPort(port int) OptionFunc
- func WithSQLTablesPrefix(sqlTablesPrefix string) OptionFunc
- func WithSchema(schema string) OptionFunc
- func WithUsername(username string) OptionFunc
- type Provider
- type Status
Constants ¶
View Source
const ( // OracleDatabaseProviderName defines the name for Oracle database Provider OracleDatabaseProviderName = provider.OracleDatabaseProviderName // SQLiteDataProviderName defines the name for SQLite database Provider SQLiteDataProviderName = provider.SQLiteDataProviderName // MySQLDatabaseProviderName defines the name for MySQL database Provider MySQLDatabaseProviderName = provider.MySQLDatabaseProviderName // PostgreSQLDatabaseProviderName defines the name for PostgreSQL database Provider PostgreSQLDatabaseProviderName = provider.PostgreSQLDatabaseProviderName // MemoryDataProviderName defines the name for memory provider using SQLite in-memory database Provider MemoryDataProviderName = provider.MemoryDataProviderName )
Variables ¶
This section is empty.
Functions ¶
func GetQueryFromFile ¶
func NewOptions ¶ added in v0.1.0
func NewOptions(opts ...OptionFunc) *provider.Options
Types ¶
type OptionFunc ¶ added in v0.1.0
func WithConnectionString ¶ added in v0.1.0
func WithConnectionString(connectionString string) OptionFunc
func WithContext ¶ added in v0.1.0
func WithContext(ctx context.Context) OptionFunc
func WithDriver ¶ added in v0.1.0
func WithDriver(driver provider.NamedProvider) OptionFunc
func WithHost ¶ added in v0.1.0
func WithHost(host string) OptionFunc
func WithName ¶ added in v0.1.0
func WithName(name string) OptionFunc
func WithPassword ¶ added in v0.1.0
func WithPassword(password string) OptionFunc
func WithPoolSize ¶ added in v0.1.0
func WithPoolSize(poolSize int) OptionFunc
func WithPort ¶ added in v0.1.0
func WithPort(port int) OptionFunc
func WithSQLTablesPrefix ¶ added in v0.1.0
func WithSQLTablesPrefix(sqlTablesPrefix string) OptionFunc
func WithSchema ¶ added in v0.1.0
func WithSchema(schema string) OptionFunc
func WithUsername ¶ added in v0.1.0
func WithUsername(username string) OptionFunc
type Provider ¶
type Provider interface { // Disconnect disconnects from the data provider Disconnect() error // GetConnection returns the connection to the data provider GetConnection() *sqlx.DB // CheckAvailability checks if the data provider is available CheckAvailability() error // ReconnectDatabase reconnects to the database ReconnectDatabase() error // InitializeDatabase initializes the database InitializeDatabase(schema string) error // MigrateDatabase migrates the database to the latest version MigrateDatabase() migration.MigrationProvider // RevertDatabase reverts the database to the specified version RevertDatabase(targetVersion int) error // ResetDatabase resets the database ResetDatabase() error // GetProviderStatus returns the status of the provider GetProviderStatus() Status }
Click to show internal directories.
Click to hide internal directories.