fix database issues

This commit is contained in:
rogee
2023-02-07 00:14:30 +08:00
parent 47e8139f47
commit 032cfbc283
10 changed files with 129 additions and 102 deletions

View File

@@ -7,9 +7,10 @@ import (
// Database database config
type Database struct {
Driver string
MySQL MySQL
Redis Redis
PostgreSQL PostgreSQL
MySQL *MySQL
SQLite *SQLite
Redis *Redis
PostgreSQL *PostgreSQL
}
// MySQL database config
@@ -91,3 +92,14 @@ func (m *Redis) DSN() string {
dsnTpl := "%s:%d"
return fmt.Sprintf(dsnTpl, m.Host, m.Port)
}
type SQLite struct {
File string
}
func (m *SQLite) CreateDatabaseSql() string {
return ""
}
func (m *SQLite) EmptyDsn() string {
return m.File
}