Summary
noorm db create ignores env-only connection configuration and uses the active persisted config instead, creating a database the caller did not ask for. noorm run build honours the same variables correctly.
Repro
- Have a persisted config active — say
cp9_scratch, pointing at database noorm_cp9.
- Set env-only connection vars targeting a different database:
export NOORM_CONNECTION_DIALECT=mssql
export NOORM_CONNECTION_HOST=localhost
export NOORM_CONNECTION_PORT=1433
export NOORM_CONNECTION_DATABASE=owl_scratch10
export NOORM_CONNECTION_USER=SA
export NOORM_CONNECTION_PASSWORD='<pw>'
noorm db create
SELECT name FROM sys.databases;
Expected
owl_scratch10 created — env-only mode is the documented approach for CI/CD, where there is no persisted config to fall back to.
Actual
noorm_cp9 created. owl_scratch10 does not exist. No warning that the env vars were disregarded.
noorm run build under the identical environment targets owl_scratch10 correctly — verified by pointing it at a non-existent database name and getting the expected "does not exist" error. So the two commands disagree about where the connection comes from.
Impact
In CI this creates a database named by whatever config happens to be checked in, not by the pipeline's environment. Locally it silently resurrects scratch databases you thought you had finished with.
Environment
- noorm CLI
0.0.0, core 1.0.0-alpha.39
- OS: macOS (darwin 25.5.0)
- Runtime: Node v24.13.0
- Dialect: mssql
Context
Found while wiring a developer tool's db verb to build a schema through noorm. The workaround was to create the database with sqlcmd and let noorm run build populate it.
Summary
noorm db createignores env-only connection configuration and uses the active persisted config instead, creating a database the caller did not ask for.noorm run buildhonours the same variables correctly.Repro
cp9_scratch, pointing at databasenoorm_cp9.noorm db createSELECT name FROM sys.databases;Expected
owl_scratch10created — env-only mode is the documented approach for CI/CD, where there is no persisted config to fall back to.Actual
noorm_cp9created.owl_scratch10does not exist. No warning that the env vars were disregarded.noorm run buildunder the identical environment targetsowl_scratch10correctly — verified by pointing it at a non-existent database name and getting the expected "does not exist" error. So the two commands disagree about where the connection comes from.Impact
In CI this creates a database named by whatever config happens to be checked in, not by the pipeline's environment. Locally it silently resurrects scratch databases you thought you had finished with.
Environment
0.0.0, core1.0.0-alpha.39Context
Found while wiring a developer tool's
dbverb to build a schema through noorm. The workaround was to create the database withsqlcmdand letnoorm run buildpopulate it.