DBIO-Firebird

 view release on metacpan or  search on metacpan

docs/adr/0009-database-level-ddl-via-native-api.md  view on Meta::CPAN


The mechanism is forced, not chosen: DSQL cannot prepare DATABASE-level DDL in
DBD::Firebird (-530 / -104), so the only way to create and drop the scratch DB
is the driver's out-of-band native calls. The earlier `do("CREATE DATABASE")` /
`do("DROP DATABASE")` spelling was never reachable on a live server; the whole
deploy/upgrade/install path was inert until this was fixed.

Server-side co-location is the simplest placement that is guaranteed reachable:
the live DSN already names a server and a directory that the server can write
(it holds the live DB there), so the scratch DB beside it inherits the same
reachability and credentials without any extra configuration. Deriving the path
from the live DSN rather than a fixed temp dir keeps the strategy working for
both local and remote (`host/port:`) servers with no per-deployment tuning.

## Consequences

- `_create_temp_db` / `_drop_temp_db` must never be "simplified" back into
  `$dbh->do("CREATE DATABASE")` / `do("DROP DATABASE")` — those do not prepare
  on a live server (-530 / -104). There is no AutoCommit toggle or `COMMIT` in
  `_create_temp_db`, because `create_database` is out-of-band and opens no
  transaction.



( run in 0.638 second using v1.01-cache-2.11-cpan-f4a522933cf )