A single setting to disable all schema changes (DDL) at run time, Lookup contents included
メンテナーはふだん 6 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- Python
- スター
- 198
- フォーク
- 103
- 平均マージ
- 6日 1時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
datajoint/datajoint-python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
datajoint/datajoint-python#1703 ·
メンテナーはふだん 6 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
datajoint/datajoint-python#1702 ·
メンテナーはふだん 6 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
datajoint/datajoint-python#1701 ·
メンテナーはふだん 6 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
datajoint/datajoint-python#1691 ·
メンテナーはふだん 6 日以内に返信
-
dependencies needs-discussion
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
datajoint/datajoint-python#1687 ·
メンテナーはふだん 6 日以内に返信
datajoint/datajoint-python の issue をすべて見る
似ている issue
-
needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
gke-labs/kube-agents#6620 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#34719 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
cognition
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
One non-object JSON record makes the session catalog exit対応中かも @he-yufeng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
collabnix/awesome-mcp-lists#433 ·
メンテナーはふだん 4 日以内に返信