add support for SQLite as an alternative database backend
Some checks failed
Build & Publish Docker Image / build-and-push (push) Failing after 33s
Some checks failed
Build & Publish Docker Image / build-and-push (push) Failing after 33s
Implement SQLite support using the pure Go `modernc.org/sqlite` driver and update the migration system to handle driver-specific schemas. Users can now choose between MySQL and SQLite by setting the `DB_DRIVER` environment variable.
This commit is contained in:
@@ -6,13 +6,20 @@ API_DOMAIN=api.esempio.com
|
||||
ACME_EMAIL=tua@email.com
|
||||
MYSQL_ROOT_PASSWORD=password-sicura
|
||||
|
||||
# DB Settings (usato per sviluppo locale; in Docker il DSN è costruito dal compose)
|
||||
# DB Settings
|
||||
# DB_DRIVER: "mysql" (default) o "sqlite"
|
||||
DB_DRIVER=mysql
|
||||
|
||||
# MySQL
|
||||
DB_DSN=root:secret@tcp(127.0.0.1:3306)/emly?parseTime=true&loc=UTC
|
||||
DB_MAX_OPEN_CONNS=25
|
||||
DB_MAX_IDLE_CONNS=5
|
||||
DB_CONN_MAX_LIFETIME=5
|
||||
DATABASE_NAME=emly
|
||||
|
||||
# SQLite (usare invece di MySQL: DB_DRIVER=sqlite, DB_DSN=./data.db, DATABASE_NAME non necessario)
|
||||
# DB_DSN=./data.db
|
||||
|
||||
# API Keys
|
||||
API_KEY=key-one
|
||||
ADMIN_KEY=admin-key-one
|
||||
|
||||
Reference in New Issue
Block a user