You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NFR]: make:database and init --database: the command, and SQLite #95
crest make:database <driver> adds a database to a project that exists. It is a project command: it reads crest.php (flavor, namespace, provider path, front controller, runtime). crest init --database=<driver> writes crest.php, then runs the same step. Thus a project from crest new with no database, and a project with no crest.php, can both get a database.
Crest changes no file that exists. It writes only the new files, and prints the lines to add to each file that exists, as make:provider and make:module do.
Scope
make:database <driver>, and init --database=none|mariadb|mysql|pgsql|sqlite with its question, as in new.
DbProvider in the provider path, for each flavor, from the stubs of new: for MVC the Phalcon\Db adapter, for ADR the DataMapper Connection with the alias db.
SQLite: storage/database.sqlite and storage/.gitkeep, when they do not exist. Crest never replaces the database file, also with --force.
The printed lines: the registration of DbProvider in the front controller (MVC: providers(); ADR: the guidance of make:provider, which knows an existing registerProviders()), /storage/database.sqlite for .gitignore, and DB_NAME for .env.
A second run stops when DbProvider.php is in the provider path. --force writes it again.
DB_NAME and DB_USERNAME come from the folder name of the project, as new uses its name.
In a project that exists, from crest new with no database and with no crest.php, --database=sqlite gives a working db service after the printed front line, in each flavor.
Activity
[#95] - adding make:database and init --database
[#95] - adding tests for make:database and init --database
[#95] - updating docs and changelog
niden commentedon Nov 27, 2026
Resolved in #98