fdl-cli 0.16.0__tar.gz → 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/CHANGELOG.md +80 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/PKG-INFO +2 -1
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/guides/building-a-host.md +1 -1
- fdl_cli-0.18.0/docs/guides/meta.ts +7 -0
- fdl_cli-0.18.0/docs/guides/reading-without-duckdb.md +41 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/guides/stores.md +1 -1
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/guides/building-a-host.md +1 -1
- fdl_cli-0.18.0/docs/ja/guides/meta.ts +7 -0
- fdl_cli-0.18.0/docs/ja/guides/reading-without-duckdb.md +41 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/guides/stores.md +1 -1
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/reference/cli.md +36 -6
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/reference/python.md +31 -2
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/data-files.md +4 -2
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/http.md +38 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/versions.md +6 -4
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/writing.md +9 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/reference/cli.md +36 -6
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/reference/python.md +31 -2
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/data-files.md +4 -2
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/http.md +38 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/versions.md +6 -4
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/writing.md +9 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/pyproject.toml +2 -1
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/catalog.py +143 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/cli.py +88 -18
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/dataset.py +91 -8
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/layout.py +4 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/refs.py +37 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/repo.py +230 -11
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/stores.py +165 -17
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/version.py +3 -3
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/tests/http_repo.py +29 -1
- fdl_cli-0.18.0/tests/test_cli.py +203 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/tests/test_dataset.py +72 -4
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/tests/test_http.py +34 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/tests/test_repo.py +100 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/tests/test_stores.py +35 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/uv.lock +3 -1
- fdl_cli-0.16.0/docs/guides/meta.ts +0 -7
- fdl_cli-0.16.0/docs/ja/guides/meta.ts +0 -7
- fdl_cli-0.16.0/tests/test_cli.py +0 -82
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.github/workflows/docs.yml +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.github/workflows/publish.yml +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.github/workflows/release.yml +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.gitignore +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.node-version +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/.python-version +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/CLAUDE.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/CONTRIBUTING.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/LICENSE +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/README.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/blume.config.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/concepts/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/concepts/repositories.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/concepts/versions-and-refs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/concepts/working-catalogs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/getting-started.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/guides/mirrors.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/guides/public-and-private.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/guides/serving-over-http.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/index.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/internals/ducklake-formats.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/internals/inside-a-repository.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/internals/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/concepts/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/concepts/repositories.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/concepts/versions-and-refs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/concepts/working-catalogs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/getting-started.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/guides/mirrors.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/guides/public-and-private.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/guides/serving-over-http.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/index.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/internals/ducklake-formats.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/internals/inside-a-repository.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/internals/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/reference/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/index.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/layout.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/reading.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/ja/spec/refs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/reference/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/index.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/layout.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/meta.ts +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/reading.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/docs/spec/refs.md +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/package-lock.json +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/package.json +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/public/CNAME +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/__init__.py +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/py.typed +0 -0
- {fdl_cli-0.16.0 → fdl_cli-0.18.0}/src/fdl/store.py +0 -0
|
@@ -1,6 +1,86 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v0.18.0 (2026-11-03)
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
- Send the file's Content-Type to signed URLs, ask again for expiring ones, plan withdrawals from
|
|
9
|
+
files.json
|
|
10
|
+
([`be180a3`](https://github.com/queria-io/fdl/commit/be180a3e23364cd28ec975bac7bcc59c2ae7b6bd))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- Fdl withdraw
|
|
15
|
+
([`2f3faf3`](https://github.com/queria-io/fdl/commit/2f3faf3cf21587f38e6322604cb0c7c83640d564))
|
|
16
|
+
|
|
17
|
+
Withdraw versions that hold data that must not be published: delete the tags that point at them, the
|
|
18
|
+
data files no kept version reads, then their catalogs, and mark them withdrawn. Without --yes it
|
|
19
|
+
only prints the plan. The spec now deletes data files before catalogs, so a stopped run can be run
|
|
20
|
+
again.
|
|
21
|
+
|
|
22
|
+
- Refs.json and fdl tag
|
|
23
|
+
([`200a613`](https://github.com/queria-io/fdl/commit/200a6137e4451af6d5789d9a741fb54863dc7486))
|
|
24
|
+
|
|
25
|
+
Rewrite refs.json after a push or a tag moves a ref, as the spec asks. A host that keeps refs.json
|
|
26
|
+
itself may refuse the write with 403. Add fdl tag to list, create and delete tags, which never
|
|
27
|
+
move.
|
|
28
|
+
|
|
29
|
+
- Upload straight to storage through a batch of signed URLs
|
|
30
|
+
([`a2b59cd`](https://github.com/queria-io/fdl/commit/a2b59cdfc2d1dd5c1f52dc013b4d8553624aeadd))
|
|
31
|
+
|
|
32
|
+
Add POST ?batch to the HTTP protocol, after Git LFS's batch API: a host hands out upload URLs for
|
|
33
|
+
files written once, and the writer sends them straight to storage. A host without batches, or a
|
|
34
|
+
file it will not sign for (413), goes through the host as before.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## v0.17.0 (2026-11-03)
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
- Compare rows by value and check the description first
|
|
42
|
+
([`5d17ae5`](https://github.com/queria-io/fdl/commit/5d17ae57ee79af2cf02ffe7ffd12f72176ecbdc0))
|
|
43
|
+
|
|
44
|
+
hash() gives NULL and empty nested values the same hash, so rows are compared with EXCEPT ALL once
|
|
45
|
+
the counts match. The dataset.json check runs before reading rows, table names are escaped, and
|
|
46
|
+
the message no longer names the checked-out version as where the branch is.
|
|
47
|
+
|
|
48
|
+
- Count a table's rows as a reader would
|
|
49
|
+
([`ca8c020`](https://github.com/queria-io/fdl/commit/ca8c02095f11763adbfb72c556fe00da1c0488a9))
|
|
50
|
+
|
|
51
|
+
dataset.json took rows from ducklake_table_stats, which keeps counting rows that were deleted or
|
|
52
|
+
updated. Rows are now the live data files' records less what their delete files remove.
|
|
53
|
+
|
|
54
|
+
### Documentation
|
|
55
|
+
|
|
56
|
+
- Add a guide to reading without DuckDB
|
|
57
|
+
([`b61328e`](https://github.com/queria-io/fdl/commit/b61328ef8ac0585dd5d547f25c8e0511370d4f28))
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
- Credential helper in fdl's config, views in dataset.json, and annotations
|
|
62
|
+
([#30](https://github.com/queria-io/fdl/pull/30),
|
|
63
|
+
[`e082f2b`](https://github.com/queria-io/fdl/commit/e082f2b189bae5491da0863bd1c48b1519e920f0))
|
|
64
|
+
|
|
65
|
+
BREAKING CHANGE: tokens saved by `fdl login` are no longer read. Set `FDL_TOKEN` or a credential
|
|
66
|
+
helper in fdl's config. `dataset.json` and `version.json` write `annotations` instead of
|
|
67
|
+
`extensions`.
|
|
68
|
+
|
|
69
|
+
- Make no version when nothing changed
|
|
70
|
+
([`fc08213`](https://github.com/queria-io/fdl/commit/fc08213f60195a474238f22bb1a513d903f8182e))
|
|
71
|
+
|
|
72
|
+
fdl commit compares the working catalog's last snapshot with the parent's. No new snapshot, or the
|
|
73
|
+
same tables, views, columns and rows (as a multiset) and the same dataset.json, prints "Nothing to
|
|
74
|
+
commit" and leaves the branch. Files are compared first, so rows are read only for tables written
|
|
75
|
+
to new files. --allow-empty makes the version anyway; rows that cannot be read are taken as
|
|
76
|
+
changed.
|
|
77
|
+
|
|
78
|
+
### Breaking Changes
|
|
79
|
+
|
|
80
|
+
- Tokens saved by `fdl login` are no longer read. Set `FDL_TOKEN` or a credential helper in fdl's
|
|
81
|
+
config. `dataset.json` and `version.json` write `annotations` instead of `extensions`.
|
|
82
|
+
|
|
83
|
+
|
|
4
84
|
## v0.16.0 (2026-11-01)
|
|
5
85
|
|
|
6
86
|
### Documentation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: fdl-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: Versions of a DuckLake catalog on object storage, kept the way Git keeps commits
|
|
5
5
|
Project-URL: Homepage, https://fdl.flo8s.com/
|
|
6
6
|
Project-URL: Documentation, https://fdl.flo8s.com/
|
|
@@ -12,6 +12,7 @@ License-File: LICENSE
|
|
|
12
12
|
Requires-Python: >=3.10
|
|
13
13
|
Requires-Dist: duckdb<2.0,>=1.5.2
|
|
14
14
|
Requires-Dist: pyyaml>=6.0
|
|
15
|
+
Requires-Dist: tomli>=1.1; python_version < '3.11'
|
|
15
16
|
Requires-Dist: typer>=0.15
|
|
16
17
|
Provides-Extra: s3
|
|
17
18
|
Requires-Dist: boto3>=1.36; extra == 's3'
|
|
@@ -43,7 +43,7 @@ A scheduled import or a form in a web app writes the same way a person does: che
|
|
|
43
43
|
What a host adds goes outside the fields FDL defines:
|
|
44
44
|
|
|
45
45
|
- extra files in a version folder (a preview), which readers ignore
|
|
46
|
-
- `
|
|
46
|
+
- `annotations` in `version.json` and `dataset.json`, keyed by the host's name
|
|
47
47
|
- its own ID for the dataset in `fdl.json`'s `id`, written at `init` and never changed
|
|
48
48
|
|
|
49
49
|
Access rules, approvals and billing stay in the host's own database. A repository copied off the host still reads correctly, with nothing in it that only the host understands.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Reading without DuckDB
|
|
3
|
+
description: Reading a table's Parquet files from JavaScript with files.json, in Workers, browsers and Node.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A reader that cannot run DuckDB, such as a Cloudflare Worker or a web page, can still read a version: `files.json` lists each table's data files, and the Parquet files can be read by range. [`@queria-io/fdl-js`](https://www.npmjs.com/package/@queria-io/fdl-js) does this in JavaScript.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @queria-io/fdl-js
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { httpStore, open, openParquet, readWhere, tableFiles } from "@queria-io/fdl-js";
|
|
14
|
+
|
|
15
|
+
const store = httpStore("https://data.example.org/towns/");
|
|
16
|
+
const version = await open(store); // HEAD, a branch, a tag or a version ID
|
|
17
|
+
const [file] = tableFiles(version, "main.towns") ?? [];
|
|
18
|
+
const rows = await readWhere(await openParquet(store, file), "town_code", "131016");
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`readWhere` reads only the row groups whose min/max can hold the value, so a table sorted by the column it is read by costs a few small requests.
|
|
22
|
+
|
|
23
|
+
## What it can read
|
|
24
|
+
|
|
25
|
+
It follows [Reading](/spec/reading) up to the catalog and then reads `files.json` in its place:
|
|
26
|
+
|
|
27
|
+
- A version without `files.json` cannot be read. Writers before fdl-cli 0.16 did not make one
|
|
28
|
+
- A table whose files have `deletes`, or whose `renamed_columns` is `true`, is refused (see [files.json](/spec/versions#filesjson))
|
|
29
|
+
- A version with `expired.json` is refused
|
|
30
|
+
|
|
31
|
+
Tables written once and replaced whole by each version, as `CREATE OR REPLACE TABLE` does, have neither deletes nor renamed columns.
|
|
32
|
+
|
|
33
|
+
## Stores
|
|
34
|
+
|
|
35
|
+
| Store | Reads from |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `httpStore(root)` | A URL, with `Range` requests |
|
|
38
|
+
| `r2Store(bucket, prefix)` | An R2 binding in a Cloudflare Worker |
|
|
39
|
+
| `fileStore(dir)` from `@queria-io/fdl-js/node` | A local folder |
|
|
40
|
+
|
|
41
|
+
Refs move, so keep the version a reader opened for a few minutes at most. Data files never change, so their Parquet footers can be cached forever.
|
|
@@ -3,7 +3,7 @@ title: Stores
|
|
|
3
3
|
description: Using a local folder, S3, R2 or another S3-compatible store as a repository, and what credentials the fdl command reads.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
A repository's URL picks the store. `s3://bucket/prefix/` is S3 or anything that speaks its API. `https://host/path/` is a host that takes [pushes over HTTP](/spec/http), with
|
|
6
|
+
A repository's URL picks the store. `s3://bucket/prefix/` is S3 or anything that speaks its API. `https://host/path/` is a host that takes [pushes over HTTP](/spec/http), with a token from `FDL_TOKEN` or a credential helper ([Tokens for HTTP](/reference/cli#tokens-for-http)). Anything else is a folder on disk.
|
|
7
7
|
|
|
8
8
|
## A folder
|
|
9
9
|
|
|
@@ -43,7 +43,7 @@ refs.write(store, "refs/heads/main", version.id, expected=current)
|
|
|
43
43
|
ホストが足すものは、FDL が決めた項目の外に置きます。
|
|
44
44
|
|
|
45
45
|
- バージョンのフォルダに置く追加のファイル(プレビューなど)。読み手は無視する
|
|
46
|
-
- `version.json` と `dataset.json` の `
|
|
46
|
+
- `version.json` と `dataset.json` の `annotations`。ホストの名前をキーにする
|
|
47
47
|
- `fdl.json` の `id` に書く、ホスト側のデータセットの ID。`init` のときに書き、変えない
|
|
48
48
|
|
|
49
49
|
権限、承認、課金はホスト自身のデータベースに置きます。ホストから持ち出したリポジトリも、ホストにしか分からないものを含まずに正しく読めます。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DuckDB を使わずに読む
|
|
3
|
+
description: files.json を使い、表の Parquet ファイルを JavaScript で読む方法。Workers・ブラウザ・Node で動きます。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Cloudflare Worker や Web ページのように DuckDB を動かせない読み手も、バージョンを読めます。`files.json` に表ごとのデータファイルが並んでいるので、Parquet ファイルを範囲指定で読めば済みます。JavaScript では [`@queria-io/fdl-js`](https://www.npmjs.com/package/@queria-io/fdl-js) がこれを行います。
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @queria-io/fdl-js
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { httpStore, open, openParquet, readWhere, tableFiles } from "@queria-io/fdl-js";
|
|
14
|
+
|
|
15
|
+
const store = httpStore("https://data.example.org/towns/");
|
|
16
|
+
const version = await open(store); // HEAD、ブランチ、タグ、バージョン ID
|
|
17
|
+
const [file] = tableFiles(version, "main.towns") ?? [];
|
|
18
|
+
const rows = await readWhere(await openParquet(store, file), "town_code", "131016");
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`readWhere` は、min/max にその値が入りうる行グループだけを読みます。読むときの列で並べた表なら、小さな読み取り数回で済みます。
|
|
22
|
+
|
|
23
|
+
## 読めるもの
|
|
24
|
+
|
|
25
|
+
[読み方](/ja/spec/reading)の手順にカタログの手前まで従い、カタログの代わりに `files.json` を読みます。
|
|
26
|
+
|
|
27
|
+
- `files.json` の無いバージョンは読めません。fdl-cli 0.16 より前の書き手は作りません
|
|
28
|
+
- ファイルに `deletes` がある表と、`renamed_columns` が `true` の表は断ります([files.json](/ja/spec/versions#filesjson) を参照)
|
|
29
|
+
- `expired.json` のあるバージョンは断ります
|
|
30
|
+
|
|
31
|
+
`CREATE OR REPLACE TABLE` のように、バージョンごとに表をまるごと作り直す書き方なら、削除も列の改名も起きません。
|
|
32
|
+
|
|
33
|
+
## 置き場
|
|
34
|
+
|
|
35
|
+
| 置き場 | 読む先 |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `httpStore(root)` | URL(`Range` リクエスト) |
|
|
38
|
+
| `r2Store(bucket, prefix)` | Cloudflare Worker の R2 バインディング |
|
|
39
|
+
| `@queria-io/fdl-js/node` の `fileStore(dir)` | 手元のフォルダ |
|
|
40
|
+
|
|
41
|
+
ref は動くので、開いたバージョンを覚えておくのは数分までにしてください。データファイルは変わらないので、Parquet のフッターはずっとキャッシュしてかまいません。
|
|
@@ -3,7 +3,7 @@ title: 置き場
|
|
|
3
3
|
description: フォルダ、S3、R2、ほかの S3 互換ストレージをリポジトリの置き場にする方法と、fdl コマンドが読む認証情報。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
リポジトリの URL で置き場が決まります。`s3://bucket/prefix/` は S3 か、S3 の API を話すストレージです。`https://host/path/` は [HTTP で push を受け付ける](/ja/spec/http)ホストで、`
|
|
6
|
+
リポジトリの URL で置き場が決まります。`s3://bucket/prefix/` は S3 か、S3 の API を話すストレージです。`https://host/path/` は [HTTP で push を受け付ける](/ja/spec/http)ホストで、`FDL_TOKEN` か credential helper のトークンを使います([HTTP のトークン](/ja/reference/cli#http-のトークン))。それ以外はディスク上のフォルダです。
|
|
7
7
|
|
|
8
8
|
## フォルダ
|
|
9
9
|
|
|
@@ -3,15 +3,23 @@ title: コマンドライン
|
|
|
3
3
|
description: fdl のコマンド、オプション、断られるとき。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`<remote>` はリポジトリで、`s3://bucket/prefix/`、`https://host/path/`、またはフォルダです。S3 の認証情報とエンドポイントは boto3 の通常の場所から読みます(`AWS_*` の環境変数、R2 などの S3 互換ストレージには `AWS_ENDPOINT_URL`)。HTTP のリポジトリには、`
|
|
6
|
+
`<remote>` はリポジトリで、`s3://bucket/prefix/`、`https://host/path/`、またはフォルダです。S3 の認証情報とエンドポイントは boto3 の通常の場所から読みます(`AWS_*` の環境変数、R2 などの S3 互換ストレージには `AWS_ENDPOINT_URL`)。HTTP のリポジトリには、`FDL_TOKEN` か credential helper でトークンを渡します([HTTP のトークン](#http-のトークン))。
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## HTTP のトークン
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
fdl はトークンを保存せず、ログインのコマンドもありません。HTTP のリポジトリには、次の順に見つけたトークンを `Authorization: Bearer` で送ります。
|
|
11
|
+
|
|
12
|
+
1. `FDL_TOKEN` があればそれ(CI 向け)
|
|
13
|
+
2. 無ければ、fdl の設定でリポジトリの URL に設定した credential helper が答えたもの。helper が無ければトークンを送りません
|
|
14
|
+
|
|
15
|
+
設定は `~/.config/fdl/config.toml`(`$XDG_CONFIG_HOME/fdl/config.toml`、または `FDL_CONFIG` で指定したファイル)です。helper は URL の前方一致で設定し、パスが一番長く一致したものを使います。
|
|
16
|
+
|
|
17
|
+
```toml
|
|
18
|
+
[credential."https://data.example.org"]
|
|
19
|
+
helper = "example-cli fdl-credential"
|
|
12
20
|
```
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
fdl は `<helper> get` を実行し、標準入力に `protocol=`・`host=`・`path=` の行と空行を渡して、出力の `password=` の行を読みます。何も出さないか、エラーで終わったら、トークンは無いものとします。トークンの保存と helper の書き込みは、ホストの側の道具が行います。
|
|
15
23
|
|
|
16
24
|
## fdl init
|
|
17
25
|
|
|
@@ -36,13 +44,15 @@ HTTP のリポジトリでは、新しいデータファイルは `<working.sqli
|
|
|
36
44
|
## fdl commit
|
|
37
45
|
|
|
38
46
|
```bash
|
|
39
|
-
fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.json]
|
|
47
|
+
fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.json] [--allow-empty]
|
|
40
48
|
```
|
|
41
49
|
|
|
42
50
|
作業カタログを、チェックアウトしたバージョンを親とする新しいバージョンに固め、アップロードし、条件付きでブランチを動かします。ブランチ、新しいバージョン ID、`seq` を表示します。
|
|
43
51
|
|
|
44
52
|
バージョンはそれぞれ `dataset.json`([バージョン](/ja/spec/versions#datasetjson)を参照)で説明します。`--dataset` で指定したファイルか、なければいまのディレクトリの `dataset.json` か `dataset.yml` から読みます。そのフォルダより下にある `*.table.yml`(または `*.table.json`)のテーブルの説明も合わせて読みます。隠しフォルダの中は読みません。コマンドはそれをカタログと照らし合わせ、列の型、行数、カタログのコメントを書き足します。
|
|
45
53
|
|
|
54
|
+
親と同じ中身になるとき([変更がないとき](/ja/spec/writing#変更がないとき))は `Nothing to commit` と表示し、ブランチを動かさずに終了コード 0 で終わります。同じ行を新しいファイルに書き直しただけの作り直しも、変更なしとみなします。`--allow-empty` を付けると、それでもバージョンを作ります。行を読めず判定できないときは、警告を出してバージョンを作ります。
|
|
55
|
+
|
|
46
56
|
次のときは断られます。
|
|
47
57
|
|
|
48
58
|
- `dataset.json` が無いとき、カタログに無い表や列を説明しているとき、形式が決めていないキーがあるとき
|
|
@@ -67,6 +77,26 @@ fdl url <remote> [--ref HEAD]
|
|
|
67
77
|
|
|
68
78
|
ref が指すバージョンのカタログの URL を表示します。読み取り専用で `ATTACH` するのに使います。
|
|
69
79
|
|
|
80
|
+
## fdl tag
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
fdl tag <remote> # タグを並べる
|
|
84
|
+
fdl tag <remote> <name> [<version>] # バージョンにタグを付ける(既定は HEAD が指すバージョン)
|
|
85
|
+
fdl tag <remote> <name> --delete
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`<version>` にはバージョン ID か、`refs/heads/main` のような ref を渡します。タグは一度作ると動かしません。別のバージョンを指す同じ名前のタグがあるときは断られます。保持期間を過ぎたバージョンにはタグを付けられません。タグを作るか消すと `refs.json` を書き直します。`fdl commit` もブランチを動かしたあとに書き直します。
|
|
89
|
+
|
|
90
|
+
## fdl withdraw
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
fdl withdraw <remote> <version>... [--yes]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
間違って公開した個人データなど、公開してはいけないデータを持つバージョンを取り下げます([取り下げ](/ja/spec/data-files#取り下げ))。先にそのデータを除いたバージョンをコミットし、該当するバージョンを指すブランチが無い状態にします。そのうえでこのコマンドが、該当するバージョンを指すタグ、そのカタログが参照し残すバージョンが読まないデータファイル、カタログを消し、`"reason": "withdrawn"` の `expired.json` を置きます。`version.json` は残します。
|
|
97
|
+
|
|
98
|
+
`--yes` を付けないと、消すものを表示するだけです。残すバージョンが読んでいるファイルは残すものとして表示します。それがそのデータを持つなら、そのバージョンも取り下げます。ブランチかリクエストが該当するバージョンを指しているあいだは断られます。
|
|
99
|
+
|
|
70
100
|
## fdl expire
|
|
71
101
|
|
|
72
102
|
```bash
|
|
@@ -33,6 +33,7 @@ for version in repo.log(store):
|
|
|
33
33
|
| `head(key)` | オブジェクトのヘッダー(`ETag` を含む)か `None` |
|
|
34
34
|
| `list(prefix)` | プレフィックスの下のキー |
|
|
35
35
|
| `delete(keys)` | 消す。既に無いキーはエラーにしない |
|
|
36
|
+
| `put_files(files, *, content_type)` | 任意。一度だけ書く `(key, path)` の組を書く。HTTP の置き場はホストにアップロード用の URL を求め([batch](/ja/spec/http#ストレージへ直接アップロードする))、ストレージへ直接送る |
|
|
36
37
|
|
|
37
38
|
## fdl.repo
|
|
38
39
|
|
|
@@ -49,13 +50,13 @@ repo.checkout(store, working, *, ref="HEAD") -> Version | None
|
|
|
49
50
|
`ref` が指すバージョンから、`working` に作業カタログを作ります。そのバージョンを返し、最初のバージョンの前は `None` を返します。
|
|
50
51
|
|
|
51
52
|
```python
|
|
52
|
-
repo.commit(working, out_dir, *, parent, data_path, author, message, inputs=(),
|
|
53
|
+
repo.commit(working, out_dir, *, parent, data_path, author, message, inputs=(), annotations=None, dataset=None) -> Version
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
作業カタログを `out_dir/<ID>/` に固めます。`dataset`(読み込んだ `dataset.json`)をカタログと照らし合わせ、カタログから書き足します。`data_path` は `repo.data_url(store)` です。アップロードはしません。
|
|
56
57
|
|
|
57
58
|
```python
|
|
58
|
-
repo.record(frozen, out_dir, *, parent, author, message, inputs=(),
|
|
59
|
+
repo.record(frozen, out_dir, *, parent, author, message, inputs=(), annotations=None, dataset=None) -> Version
|
|
59
60
|
```
|
|
60
61
|
|
|
61
62
|
固め終えたカタログからバージョンを作ります。自分でカタログを固める書き手向けです。
|
|
@@ -81,6 +82,27 @@ repo.prune(store, newest, *, keep=1, since=None, reason="retention") -> list[str
|
|
|
81
82
|
|
|
82
83
|
バージョン 1 つの保持期間を終わらせるか、`newest` より古く保持期間から外れるバージョンをまとめて終わらせます。ref が指すバージョンは残します。
|
|
83
84
|
|
|
85
|
+
```python
|
|
86
|
+
repo.tag(store, name, version_id) -> None
|
|
87
|
+
repo.delete_tag(store, name) -> None
|
|
88
|
+
repo.tags(store) -> dict[str, str]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
バージョンに `refs/tags/<name>` を作る、消す、タグと指すバージョンを並べる、の 3 つです。タグは動かしません。同じ名前のタグが別のバージョンにあれば、`tag` は `RepoError` を出します。
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
repo.update_refs_index(store) -> None
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
ref を読み直して `refs.json` を書き直します。`push`・`tag`・`delete_tag` は ref を動かしたあとにこれを呼びます。`refs.json` を自分で書くホストが 403 で断ったときは、済んだものとして扱います。
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
repo.plan_withdrawal(store, version_ids) -> Withdrawal
|
|
101
|
+
repo.withdraw(store, version_ids, *, plan=None) -> Withdrawal
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
公開してはいけないデータを持つバージョンを取り下げます。`plan_withdrawal` は何も変えずに、消すタグ、消すデータファイル、残すバージョンが読むので残すファイルを返します。`withdraw` はタグ、データファイル、カタログの順に消します。ブランチかリクエストが該当するバージョンを指しているあいだは、どちらも `RepoError` を出します。
|
|
105
|
+
|
|
84
106
|
## fdl.refs
|
|
85
107
|
|
|
86
108
|
```python
|
|
@@ -89,3 +111,10 @@ refs.write(store, name, version_id, *, expected) -> str
|
|
|
89
111
|
```
|
|
90
112
|
|
|
91
113
|
`read` は、動かすときに渡す ETag を付けて ref を返します。`write` は、`expected` が `None` なら ref を作り、そうでなければ動かします。条件が合わなければ `RefConflict` を出します。
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
refs.listed(store) -> dict[str, str]
|
|
117
|
+
refs.write_index(store) -> dict
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`listed` はブランチとタグをすべて読み直します。`write_index` はそれと `HEAD` から `refs.json` を書きます。
|
|
@@ -41,8 +41,10 @@ DuckLake 自身の片付け(`ducklake_cleanup_old_files`、`ducklake_expire_sn
|
|
|
41
41
|
|
|
42
42
|
1. そのデータを除いた新しいバージョンを作り、該当するバージョンを指しているブランチをすべてそこへ動かす。新しいバージョンの親はいまのバージョンなので、前へ動かすことになる
|
|
43
43
|
2. 該当するバージョンを指すタグを消す
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
44
|
+
3. そのデータを持つデータファイルを、すぐに消す。該当するバージョンのカタログが参照し、残すバージョンがどれもその時点のスナップショットで読んでいないファイルが対象
|
|
45
|
+
4. 該当するバージョンそれぞれに `"reason": "withdrawn"` の `expired.json` を置き、カタログを消す
|
|
46
|
+
|
|
47
|
+
データファイルをカタログより先に消すのは、途中で止まった取り下げをやり直せるようにするためです。カタログが残っていれば、どのファイルがそのデータを持つかが分かります。
|
|
46
48
|
|
|
47
49
|
```json expired.json
|
|
48
50
|
{ "expired_at": "2026-12-01T00:00:00Z", "reason": "withdrawn" }
|
|
@@ -12,6 +12,7 @@ description: 書き手が置き場の鍵を持たずに push できるよう、
|
|
|
12
12
|
| `GET`、`HEAD` `<root>/<key>` | オブジェクトを読む | `ETag` 付きの 200、または 404 |
|
|
13
13
|
| `PUT` `<root>/<key>` | `If-None-Match: *` か `If-Match: <ETag>` を付けてオブジェクトを書く | 新しい `ETag` 付きの 200 か 201。条件が合わなければ 412 |
|
|
14
14
|
| `GET` `<root>/?list&prefix=<p>[&after=<key>]` | プレフィックスの下のキーの一覧 | `{"keys": [...], "next": <key か null>}`。`next` がある間は `after` を付けて続きを求める |
|
|
15
|
+
| `POST` `<root>/?batch` | アップロード用の URL を求める。任意([下](#ストレージへ直接アップロードする)を参照) | `{"objects": [...]}` |
|
|
15
16
|
| `POST` `<root>/<key>?uploads` | 分割アップロードを始める。条件は `PUT` と同じ | `{"upload": "<id>"}` |
|
|
16
17
|
| `PUT` `<root>/<key>?upload=<id>&part=<n>` | `n` 番目(1 から)の部分を送る | `{"etag": "<部分のタグ>"}` |
|
|
17
18
|
| `POST` `<root>/<key>?upload=<id>` | `{"parts": [{"part": n, "etag": "…"}]}` を順に並べて終える | `PUT` と同じ |
|
|
@@ -19,9 +20,46 @@ description: 書き手が置き場の鍵を持たずに push できるよう、
|
|
|
19
20
|
- 書き込みには `Authorization: Bearer <token>` を付ける。使えるトークンが無ければ 401、ここに書けないトークンなら 403
|
|
20
21
|
- 最後以外の部分は同じ大きさにする。1 回のリクエストで送れる大きさ(既定で 64 MB)を超えるファイルは分割して送る
|
|
21
22
|
- どのキーを受け付けるかはホストが決める。`HEAD`、`fdl.json`、配置の外のものへの書き込みは断ってよく(ただし HTTP の `HEAD` リクエストには答える。書き手が ref の ETag を読むのに使う)、`versions/` とデータファイルは `If-None-Match: *` 付きのときだけ受け付けてよい
|
|
23
|
+
- 確かめたあとに自分で ref を動かすホストは、`refs.json` も自分で書き直す。書き手からの `refs.json` の書き込みは 403 で断ってよく、書き手はそれを済んだものとして扱う
|
|
22
24
|
- ホストが push を確かめるのは ref を動かすとき。バージョンがあること、fast-forward であること、カタログが `version.json` と合うこと、参照するデータファイルがすべてリポジトリにあることを確かめる。断るときは 409 で、理由を本文に書く
|
|
23
25
|
- `DELETE` は無い。保持期間と削除はホストの仕事
|
|
24
26
|
|
|
27
|
+
## ストレージへ直接アップロードする
|
|
28
|
+
|
|
29
|
+
ホストはアップロード用の URL を渡し、ファイルをホストを通さずストレージへ直接送らせてよい。Git LFS の batch API と同じ形にする。この経路を使うのは、一度だけ書くファイル(データファイルとバージョンのファイル)だけ。ref は常にホストを通して書く。
|
|
30
|
+
|
|
31
|
+
書き手は、アップロードするファイルを `POST <root>/?batch` で送る。
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "operation": "upload", "objects": [{ "key": "data/main/towns/a.parquet", "size": 1048576 }] }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
答えにはオブジェクトごとに 1 つずつ項目が入る。順番は問わない。
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"objects": [
|
|
42
|
+
{
|
|
43
|
+
"key": "data/main/towns/a.parquet",
|
|
44
|
+
"size": 1048576,
|
|
45
|
+
"actions": {
|
|
46
|
+
"upload": { "href": "https://storage.example.org/…", "header": { "If-None-Match": "*" }, "expires_in": 3600 }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{ "key": "data/main/towns/b.parquet", "size": 2048 },
|
|
50
|
+
{ "key": "data/main/towns/c.parquet", "size": 9, "error": { "code": 413, "message": "Too large for one request" } }
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- `actions.upload`: 書き手はファイルを本文にして `PUT <href>` を送り、ファイルの `Content-Type` と `header` のヘッダーを付ける。リポジトリの `Authorization` は付けない。そこで 412 が返れば、オブジェクトは既にある。`expires_in` を過ぎた URL を使う前に、書き手はそのオブジェクトをもう一度尋ねる
|
|
56
|
+
- `actions` も `error` も無い: オブジェクトは既にある
|
|
57
|
+
- コード 413 の `error`: ホストはこのファイルに署名しない。書き手はホストを通して(`PUT` か分割で)アップロードする
|
|
58
|
+
- それ以外の `error`: アップロードは断られた。コードと理由が入る
|
|
59
|
+
- 書き手が一度に尋ねるのは 100 個まで
|
|
60
|
+
- batch を持たないホストは 404・405・501 を返し、書き手はホストを通してアップロードする
|
|
61
|
+
- アップロードしただけではバージョンにならない。ホストが push を確かめるのは、これまでどおり ref を動かすとき
|
|
62
|
+
|
|
25
63
|
## 書き方
|
|
26
64
|
|
|
27
65
|
DuckDB は HTTP の URL にデータファイルを書けないので、こうしたリポジトリの作業カタログは 2 つの場所を持ちます。
|
|
@@ -59,7 +59,7 @@ description: バージョン ID、version.json の項目、固めたカタログ
|
|
|
59
59
|
"url": "https://example.org/population-2025.csv"
|
|
60
60
|
}
|
|
61
61
|
],
|
|
62
|
-
"
|
|
62
|
+
"annotations": {}
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -78,7 +78,7 @@ description: バージョン ID、version.json の項目、固めたカタログ
|
|
|
78
78
|
| `files` | may | カタログの隣の `files.json` を書いたときの、そのファイル名、大きさ、sha256([files.json](#filesjson)) |
|
|
79
79
|
| `changes` | may | 親との列の違い。`breaking` は、親に向けて書いた SQL が失敗しうるか(列の削除・改名・作り直し) |
|
|
80
80
|
| `inputs` | may | 使った元のファイル。`source_id` の付け方は書き手が決める |
|
|
81
|
-
| `
|
|
81
|
+
| `annotations` | may | 形式が解釈しない情報。読む側(ホストやツール)の名前をキーにする |
|
|
82
82
|
|
|
83
83
|
読み手は、知らない項目を無視しなければなりません。
|
|
84
84
|
|
|
@@ -175,7 +175,7 @@ DuckLake を使わずに Parquet ファイルを読む読み手は、`deletes`
|
|
|
175
175
|
]
|
|
176
176
|
}
|
|
177
177
|
],
|
|
178
|
-
"
|
|
178
|
+
"annotations": {}
|
|
179
179
|
}
|
|
180
180
|
```
|
|
181
181
|
|
|
@@ -183,8 +183,10 @@ DuckLake を使わずに Parquet ファイルを読む読み手は、`deletes`
|
|
|
183
183
|
- 書き手は説明を YAML(`dataset.yml`)で持ってもよく、テーブルごとに別のファイル(`<name>.table.yml`、`tables` の 1 項目)に分けてもよい。バージョンには常に説明全体が 1 つの JSON で入る
|
|
184
184
|
- `licenses` の各要素は SPDX の識別子か、`id` に書き手が足したいもの(`spdx`・`url`・`title`)を添えたオブジェクト
|
|
185
185
|
- `tables` には、カタログの最後のスナップショットにある表をすべて並べる。書き手が説明しなかった表は、書き手のツールがカタログから分かることで足す。カタログに無い表や列を説明していたら断る
|
|
186
|
+
- カタログのビューは表のあとに `"kind": "view"` を付けて並べ、`sql` はカタログのものを入れる。カタログはビューの列を記録しないので、ビューの `fields` は書き手が書いたままで、`type`・`nullable`・`rows` を持たない。表には `kind` を付けない
|
|
186
187
|
- カタログから取るもの: 表ごとの `rows`、列ごとの `type`(DuckLake の型名)と `nullable`。書き手が `description` を書かなかったところには、カタログのコメント(`COMMENT ON`)を使う
|
|
187
|
-
-
|
|
188
|
+
- この仕様が決めていないキーは断る。形式が解釈しない情報は、最上位・表・列それぞれの `annotations` に、読む側の名前をキーにして置く。書き手は書かれたまま残す
|
|
189
|
+
- `annotations` という名前になる前のバージョンは、同じものを `extensions` に持つ。読み手は `extensions` を `annotations` として読む
|
|
188
190
|
- ライセンスや出典に書いたことは書き手の主張で、ホストは公開する前に確かめてよい
|
|
189
191
|
|
|
190
192
|
## ほかの形式のカタログ
|
|
@@ -27,6 +27,15 @@ description: チェックアウト、コミット、push。作業カタログ、
|
|
|
27
27
|
- 固めたカタログの `data_path` を `<root><data_dir>` の絶対 URL にする
|
|
28
28
|
- 絶対パスで記録されたデータファイルや、`data_dir` の外のデータファイルがあれば断る
|
|
29
29
|
|
|
30
|
+
## 変更がないとき
|
|
31
|
+
|
|
32
|
+
書き手は、親と同じ中身のバージョンを作らないようにするべきです。Git が親と同じ tree のコミットを作らないのと同じです。次のどちらかなら、親と同じ中身です。
|
|
33
|
+
|
|
34
|
+
- 最後のスナップショットが親のもの(`ducklake.snapshot_id`)と同じ
|
|
35
|
+
- 同じ表とビューがあり、どの表も列の名前と型が同じで、行が同じ(重複を数え、順番は問わない)。さらに `dataset.json` の sha256 が親と同じ
|
|
36
|
+
|
|
37
|
+
同じ入力から作り直した表は新しいデータファイルに書かれるので、ファイルやカタログのバイトを比べても判定できません。書き手はまずファイルを比べ、ファイルが違う表だけ行を読みます。行を読めないときはバージョンを作ります。頼まれたときは、`git commit --allow-empty` と同じく、変更がなくても作ってかまいません。
|
|
38
|
+
|
|
30
39
|
## 書き込みの順番
|
|
31
40
|
|
|
32
41
|
1. データファイル
|
|
@@ -3,15 +3,23 @@ title: Command line
|
|
|
3
3
|
description: The fdl commands, their options and when they refuse.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`<remote>` is a repository: `s3://bucket/prefix/`, `https://host/path/` or a folder. Credentials and the endpoint for S3 come from boto3's usual places (`AWS_*` environment variables, `AWS_ENDPOINT_URL` for R2 and other S3-compatible stores). A repository over HTTP takes
|
|
6
|
+
`<remote>` is a repository: `s3://bucket/prefix/`, `https://host/path/` or a folder. Credentials and the endpoint for S3 come from boto3's usual places (`AWS_*` environment variables, `AWS_ENDPOINT_URL` for R2 and other S3-compatible stores). A repository over HTTP takes a token from `FDL_TOKEN` or a credential helper (see [Tokens for HTTP](#tokens-for-http)).
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Tokens for HTTP
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
fdl keeps no tokens and has no login. For a repository over HTTP it sends, as `Authorization: Bearer`:
|
|
11
|
+
|
|
12
|
+
1. `FDL_TOKEN`, when set (for CI)
|
|
13
|
+
2. Otherwise what the credential helper set for the repository's URL in fdl's config answers. With no helper set, fdl sends no token
|
|
14
|
+
|
|
15
|
+
The config is `~/.config/fdl/config.toml` (`$XDG_CONFIG_HOME/fdl/config.toml`, or the file `FDL_CONFIG` names). A helper is set per URL prefix; the one with the longest matching path wins:
|
|
16
|
+
|
|
17
|
+
```toml
|
|
18
|
+
[credential."https://data.example.org"]
|
|
19
|
+
helper = "example-cli fdl-credential"
|
|
12
20
|
```
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
fdl runs `<helper> get`, writes `protocol=`, `host=` and `path=` lines and a blank line to its stdin, and reads the `password=` line it prints. A helper that prints nothing, or exits with an error, means no token. The host's own tool stores the token and writes its helper here.
|
|
15
23
|
|
|
16
24
|
## fdl init
|
|
17
25
|
|
|
@@ -36,13 +44,15 @@ Refused when the version is past retention.
|
|
|
36
44
|
## fdl commit
|
|
37
45
|
|
|
38
46
|
```bash
|
|
39
|
-
fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.json]
|
|
47
|
+
fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.json] [--allow-empty]
|
|
40
48
|
```
|
|
41
49
|
|
|
42
50
|
Freezes the working catalog into a new version whose parent is the version it was checked out at, uploads it, and moves the branch on condition. It prints the branch, the new version ID and its `seq`.
|
|
43
51
|
|
|
44
52
|
Every version is described by a `dataset.json` (see [Versions](/spec/versions#datasetjson)), read from `--dataset` or else from `dataset.json` or `dataset.yml` in the current directory. Tables described in `*.table.yml` (or `*.table.json`) files below that folder are added to it; hidden folders are skipped. The command checks it against the catalog and fills in the column types, row counts and catalog comments.
|
|
45
53
|
|
|
54
|
+
When the version would hold what its parent holds (see [When nothing changed](/spec/writing#when-nothing-changed)), it prints `Nothing to commit`, leaves the branch where it is and exits 0. A rebuild that writes the same rows to new files counts as unchanged. `--allow-empty` makes the version anyway. If the rows cannot be read to tell, it warns and makes the version.
|
|
55
|
+
|
|
46
56
|
Refused when:
|
|
47
57
|
|
|
48
58
|
- there is no `dataset.json`, or it describes a table or column the catalog lacks, or has keys the format does not define
|
|
@@ -67,6 +77,26 @@ fdl url <remote> [--ref HEAD]
|
|
|
67
77
|
|
|
68
78
|
Prints the URL of the catalog of the version the ref holds, to `ATTACH` read-only.
|
|
69
79
|
|
|
80
|
+
## fdl tag
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
fdl tag <remote> # list the tags
|
|
84
|
+
fdl tag <remote> <name> [<version>] # tag a version (default: the one HEAD holds)
|
|
85
|
+
fdl tag <remote> <name> --delete
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`<version>` is a version ID or a ref such as `refs/heads/main`. A tag is created once and never moved: tagging a name that is already there at another version is refused. A version past retention cannot be tagged. Creating or deleting a tag rewrites `refs.json`, as `fdl commit` does after moving a branch.
|
|
89
|
+
|
|
90
|
+
## fdl withdraw
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
fdl withdraw <remote> <version>... [--yes]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Removes versions that hold data that must not be published, such as personal data published by mistake (see [Withdrawal](/spec/data-files#withdrawal)). First commit a version without the data, so that no branch points at an affected version. The command then deletes the tags that point at the versions, the data files their catalogs name that no kept version reads, and their catalogs, and puts `expired.json` with `"reason": "withdrawn"`. `version.json` stays.
|
|
97
|
+
|
|
98
|
+
Without `--yes` it only prints what it would delete. Files a kept version still reads are listed as kept; if they hold the data, withdraw that version too. Refused while a branch or a request points at one of the versions.
|
|
99
|
+
|
|
70
100
|
## fdl expire
|
|
71
101
|
|
|
72
102
|
```bash
|