Skip to content

T96 make database servers - #99

Merged
niden merged 3 commits into
masterfrom
T96-make-database-servers
Nov 27, 2026
Merged

niden merged 3 commits into
masterfrom
T96-make-database-servers

Conversation

@niden

@niden niden commented Nov 22, 2026

Copy link
Copy Markdown
Member

Hello!

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • composer test, composer cs and composer analyze all pass
  • I have created a PR for the documentation about this change, if user facing

make:database and init --database for MySQL, MariaDB and PostgreSQL. Crest changes no file that exists: it prints each part, with the file to put it in, from the stubs that new --database uses. Thus the printed lines and a new project agree.

With a compose file (the first of compose.yaml, compose.yml, docker-compose.yaml and docker-compose.yml), crest prints the service database with its volume, depends_on for the app service, the Dockerfile lines of the PDO extension, and the .env lines. A compose file that has a database service gets a note in place of the service: the check is the line scan of the services that init already uses (Survey::services(), now public), not a YAML parser.

With no compose file, crest prints no compose, Dockerfile or .env lines: nothing gives .env to the app, and DB_HOST=database names a compose service. It prints that PHP needs the PDO extension, and that the defaults of DbProvider connect to 127.0.0.1 and the default port.

An app service named database stops make:database, and init --database before it writes crest.php, as in new. The check moved from new to DatabaseChoice::checkService().

The database test of #95 now runs on each driver of the suite: a project from crest new with no database gets a working db service in each flavor, also through init --database, on SQLite, MySQL, MariaDB and PostgreSQL.

Stacked on #98.

Thanks

@niden niden self-assigned this Nov 22, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Base automatically changed from T95-make-database-sqlite to master November 27, 2026 15:42
@niden
niden force-pushed the T96-make-database-servers branch from 78395c0 to 7fdf147 Compare November 27, 2026 15:49
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

master (17a1457) T96-make-database-servers (7fdf147) +/-
Coverage 99.8% 99.8% +0.0%
Test Execution Time 12s 12s 0s
Details
  |                     | master (17a1457) |   T96-make-database-servers    |  +/-  |
  |                     |                  |           (7fdf147)            |       |
  |---------------------|------------------|--------------------------------|-------|
+ | Coverage            |            99.8% |                          99.8% | +0.0% |
  |   Files             |               97 |                             97 |     0 |
  |   Lines             |             3965 |                           4003 |   +38 |
+ |   Covered           |             3958 |                           3996 |   +38 |
  | Test Execution Time |              12s |                            12s |    0s |

Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
src/Command/InitCommand.php 100.0% 0.0% 100.0% modified
src/Command/NewCommand.php 100.0% 0.0% 100.0% modified
src/Generator/Project/DatabaseChoice.php 100.0% 0.0% 100.0% modified
src/Generator/Project/DatabaseSetup.php 100.0% 0.0% 100.0% modified
src/Project/Survey.php 100.0% 0.0% 100.0% modified

Reported by octocov

@niden
niden merged commit e599c9f into master Nov 27, 2026
40 checks passed
@niden
niden deleted the T96-make-database-servers branch November 27, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant