-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.go
More file actions
36 lines (29 loc) · 1.11 KB
/
Copy pathtypes.go
File metadata and controls
36 lines (29 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package kat
import (
"github.com/BolajiOlajide/kat/internal/database"
dbdriver "github.com/BolajiOlajide/kat/internal/database/driver"
"github.com/BolajiOlajide/kat/internal/loggr"
)
// Driver represents a supported database driver type.
type Driver = dbdriver.DatabaseDriver
const (
// PostgresDriver is the driver for PostgreSQL databases.
PostgresDriver = dbdriver.PostgresDriver
// SQLiteDriver is the driver for SQLite databases.
SQLiteDriver = dbdriver.SqliteDriver
)
// ParseDriver converts a driver name string into a Driver.
// Accepted values: "postgres", "postgresql", "" (defaults to postgres),
// "sqlite", "sqlite3".
func ParseDriver(name string) (Driver, error) {
return dbdriver.ParseDBDriver(name)
}
// Logger is the interface used for logging within kat.
// Implement this interface to provide custom logging behavior.
type Logger = loggr.Logger
// DBConfig holds database connection configuration options.
type DBConfig = database.DBConfig
// DefaultDBConfig returns sensible default configuration for Kat migrations.
func DefaultDBConfig(drv Driver) DBConfig {
return database.DefaultDBConfig(drv)
}