Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyPgAppName(dbUrl string) string
- func DefaultDbUrl() string
- func GetDefaultDbName() string
- func MigrateUp(ctx context.Context, migrateVia interface{}, migrationsFS fs.FS) error
- func MigrateUpEnt(ctx context.Context, clientSchema ent.EntClientSchema) error
- func Open(driverName, dialectName, dsn string) (db *sql.DB, err error)
- func OpenDefault() (db *sql.DB, driverName, dialectName string, err error)
- func OpenSqlForEnt() (*entsql.Driver, error)
- func ParseDefault() (driverName, dialectName, dsn string, err error)
- func PostgreSQLDSN(suffix string) string
- func SQLiteDSN(filename string, fileScheme, memory bool) string
- func SetDefaultDbName(name string)
- func TryCreateDB(ctx context.Context, driverName, dialect, dsn, createVia string) error
- func Up(ctx context.Context, migrateVia interface{}, migrator *migrate.Migrator) error
- func WaitForDB(ctx context.Context) error
- type SQLError
Constants ¶
View Source
const SQLiteDriverName = "sqlite3"
in CGO mode, use the github.com/mattn/go-sqlite3 driver
Variables ¶
View Source
var ( PostgresDialect = "postgres" SqliteDialect = "sqlite3" )
Functions ¶
func ApplyPgAppName ¶ added in v0.3.35
func DefaultDbUrl ¶
func DefaultDbUrl() string
func GetDefaultDbName ¶
func GetDefaultDbName() string
func MigrateUpEnt ¶
func MigrateUpEnt( ctx context.Context, clientSchema ent.EntClientSchema, ) error
func OpenSqlForEnt ¶
func ParseDefault ¶
func PostgreSQLDSN ¶
func SetDefaultDbName ¶
func SetDefaultDbName(name string)
func TryCreateDB ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.