| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
On PostgreSQL, database.name selects the database, so two namespaces can hold schemas with the same name. On MySQL it was ignored with a warning. It now becomes a prefix that Schema adds to every schema name (name + '_'), and list_schemas lists the namespace's schemas under their plain names. A name that already carries the prefix is used as is, with a warning. The database_prefix deprecation message no longer says it is removed in 2.3; it points to database.name.
|
A few things I noticed while reading, in case they're useful for the open questions:
|
Sorry, something went wrong.
Review follow-up. On MySQL, `database.name` becomes the prefix `name + "_"` of every schema name, and `list_schemas()` lists the schemas that start with it. If the name could contain an underscore, one namespace's prefix could begin another's: `lab_` begins `lab_proj_`, so a connection in `lab` would list `lab_proj`'s schemas as `proj_*` and open them as its own. A MySQL `database.name` with an underscore now raises a DataJointError that explains this. PostgreSQL, where the name selects a database, is unchanged. A schema name that already starts with the prefix is still used as is, with a warning, so pipelines that add the prefix themselves keep reaching the same schemas. The docstring now states the consequence: with `database.name = "lab"`, `"lab_notes"` and `"notes"` name the same schema. The unit tests cover the refusal, and the namespace tests use names without underscores.
|
Thanks, @lum-agilyti. Both cases were real. bd3910e addresses them:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #1582.
Why
On PostgreSQL, database.name selects the database, so projects sharing a server keep their schemas apart while pipelines write plain names like dj.Schema("subject"). On MySQL the setting was ignored with a warning, so every pipeline had to build prefixed schema names itself. The deprecated database_prefix stores a value DataJoint never applies, and its message still says it is removed in 2.3.
This PR gives database.name the same role on MySQL: it becomes a prefix that Schema adds to schema names. A pipeline is then written the same way for both backends.
Changes
Compatibility
A MySQL user who sets database.name today gets a warning and no effect. After this change, their schema names gain the prefix. Hence the v2.4 milestone, and a line in the release notes.
PostgreSQL behaviour is unchanged.
Open questions (from #1582)
The PR implements the proposal's defaults, and each one is easy to change.
Tests
Local results: unit 457 passed; integration 694 passed, 16 skipped (testcontainers, both backends).
Docs: datajoint/datajoint-docs#301 (configure-database.md, deploy-production.md, reference/configuration.md), to land with the release.