Required Variables
The database connection string used for migrations. This is the only required environment variable.See Database URLs for format examples for each supported database.
If
DATABASE_URL is not set, Geni will exit with an error: “missing DATABASE_URL env variable”Optional Variables
Migration Configuration
Specifies the directory where Geni looks for migration files.
Name of the table used to track applied migrations.
Schema Dumping
Name of the schema file that Geni creates after running migrations.The schema file provides a complete SQL representation of your database structure, useful for version control and documentation.
Disables automatic schema dumping after migrations.Set to
"true" to prevent Geni from creating a schema file. Useful in environments where schema dumping is not needed or not supported.Schema dumping requires additional tools for some databases:
- MySQL:
mysqldumpbinary - MariaDB:
mariadb-dumpbinary - PostgreSQL, SQLite, LibSQL: No additional tools required
Connection Configuration
Time in seconds to wait for the database to become available before timing out.Useful when running migrations in environments where the database might take time to start (e.g., Docker containers, CI/CD pipelines).
Authentication token for LibSQL and Turso databases.Only required when connecting to LibSQL instances or Turso that require authentication. If not specified, Geni attempts to connect without authentication.
Complete Example
Here’s a complete example with all environment variables configured:Using .env Files
You can use.env files to manage environment variables:
.env
CI/CD Usage
In CI/CD environments, setDATABASE_URL as a secret environment variable: