Changeset 0.17.1 (#76)

This commit is contained in:
2026-02-28 01:40:31 +00:00
parent c9141a6896
commit 856dc9b0ac
64 changed files with 8037 additions and 1657 deletions

View File

@@ -0,0 +1,31 @@
package database
// Dialect identifies the active database backend.
type Dialect int
const (
DialectPostgres Dialect = iota
DialectSQLite
)
// CurrentDialect is set during Connect() and read by store constructors
// to select the appropriate SQL flavour.
var CurrentDialect Dialect
// String returns a human-readable label.
func (d Dialect) String() string {
switch d {
case DialectPostgres:
return "postgres"
case DialectSQLite:
return "sqlite"
default:
return "unknown"
}
}
// IsPostgres returns true when connected to PostgreSQL.
func IsPostgres() bool { return CurrentDialect == DialectPostgres }
// IsSQLite returns true when connected to SQLite.
func IsSQLite() bool { return CurrentDialect == DialectSQLite }