A single setting to disable all schema changes (DDL) at run time, Lookup contents included
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
Direzione di ricerca
Start with schemas.py around lines 329-340 (Lookup contents insertion) and Schema.call / _decorate_table, then autopopulate.py lines 186-187 and jobs.py lines 383-384, where jobs tables are declared. The open design question is where a single allow_ddl check should sit, and whether it must cover alter() and drop(). Done means that with the setting false, each of these paths raises a clear error naming the setting, and an explicit declare_all() path exists for deployments.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What the library does today
Schema changes happen implicitly whenever a process activates a schema with a privileged login:
- Activating a schema declares every table that doesn't exist yet (
Schema.__call__→_decorate_table, whencreate_tablesis true, the default). - Declaring a Lookup table inserts any
contentsrows that are missing (schemas.py:329–340). populate()andjobs.refresh()declare a table's~~jobstable on first use (autopopulate.py:186–187,jobs.py:383–384), even whencreate_tablesis false.alter()anddrop()run whenever they're called.
So setting create_tables=False, as the production guide advises, still leaves schema changes at run time, through the jobs tables and Lookup contents. Nothing turns them all off at once.
Proposal
A single setting, for example database.allow_ddl (env DJ_ALLOW_DDL), default true. With it set to false, nothing changes the schema:
- no table, part or jobs-table declaration;
- no Lookup
contentsinserted, updated or deleted; - no
alter(),drop()or schema creation.
An attempt raises a clear error naming the setting, rather than silently doing nothing. A missing table is reported as missing, not declared, and populate() and refresh() fail clearly if a jobs table doesn't exist.
Why
In a controlled deployment, schema changes are a deployment step: planned, reviewed and applied together, before the new code runs. Run-time processes (workers, notebooks, dashboards) then read and write rows but never change the schema. This setting lets an operator enforce that in the library, not only through database privileges.
Also needed
An explicit way for the deployment step to apply schema changes (declare missing tables, their jobs tables and Lookup contents) with the setting on, e.g. a schema.declare_all(), or the setting being overridable for one call.
Expected behavior
With allow_ddl=false, a pipeline whose tables all exist runs as before; one with a missing table, a missing jobs table or changed Lookup contents fails at activation or populate, with a message that says what's missing.
Related
#1552 proposes declaring draft tables on the server beside the pipeline's tables. With schema changes treated as a deployment step, should drafting stay entirely in memory instead?
- Lingua principale
- Python
- Stelle
- 198
- Fork
- 103
- Merge medio
- 6g 1h
- PR unite (30g)
- 10
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di datajoint/datajoint-python
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
datajoint/datajoint-python#1703 ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
datajoint/datajoint-python#1702 ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
datajoint/datajoint-python#1701 ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
datajoint/datajoint-python#1691 ·
I maintainer di solito rispondono entro 6 giorni
-
dependencies needs-discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
datajoint/datajoint-python#1687 ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di datajoint/datajoint-python
Issue simili
-
cognition
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
collabnix/awesome-mcp-lists#433 ·
I maintainer di solito rispondono entro 4 giorni
-
CrossEntropyFilter raises on zero probabilities and single-class resultsForse già presa @NopeCharon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Archmonger/ServeStatic#129 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni