Documentation
¶
Index ¶
- Variables
- func Connect(ctx context.Context, driver string, datasource string) (*sqlx.DB, error)
- func ConnectAndMigrate(ctx context.Context, driver string, datasource string, migrator Migrator) (*sqlx.DB, error)
- func Limit(size int) uint64
- func Must(db *sqlx.DB, err error) *sqlx.DB
- func Offset(page, size int) uint64
- func ProcessSQLErrorf(ctx context.Context, err error, format string, args ...interface{}) error
- type Config
- type Migrator
Constants ¶
This section is empty.
Variables ¶
View Source
var Builder = squirrel.StatementBuilder.PlaceholderFormat(squirrel.Dollar)
Builder is a global instance of the sql builder. we are able to hardcode to postgres since sqlite3 is compatible with postgres.
Functions ¶
func ConnectAndMigrate ¶
func ConnectAndMigrate(ctx context.Context, driver string, datasource string, migrator Migrator) (*sqlx.DB, error)
ConnectAndMigrate creates the database handle and migrates the database.
Types ¶
Click to show internal directories.
Click to hide internal directories.