Skip to content

Commit 66230e6

Browse files
authored
Merge pull request #9 from zeeker-sg/claude/build-lifecycle
feat: single-fetch build lifecycle, fragments_on_skip, idempotent FTS, sibling imports (zeeker 0.8.0)
2 parents e5ec7ad + 15e84ef commit 66230e6

9 files changed

Lines changed: 869 additions & 64 deletions

File tree

‎CLAUDE.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ zeeker/{cli.py,commands/{assets.py,metadata.py,helpers.py}}
3333
`async fetch_data(existing_table)` (concurrent I/O)
3434
`fetch_fragments_data(existing_fragments_table, main_data_context=None)` (main_data_context avoids duplicate API calls)
3535
`transform_data()` (optional)
36+
Sibling imports work: resource modules can `import helper` for helpers in `resources/` — import at module top level only (dir is appended to sys.path just for the load, lowest precedence, then removed; stdlib/site-packages always win name clashes)
37+
`--setup-fts` is idempotent (safe on incremental `--sync-from-s3` builds)
3638

3739
## CRITICAL: Duplicate Handling
3840
MUST filter existing IDs to avoid UNIQUE constraint errors:
@@ -58,6 +60,8 @@ CRITICAL: Use `float` for potential decimals, consistent types, no type mixing
5860

5961
## Fragments
6062
`--fragments`: Two tables (main: metadata, fragments: chunks). Context passing via `main_data_context` avoids duplicate API calls.
63+
**Single-fetch lifecycle**: `fetch_data()` runs ONCE per build — the resource module is loaded once (also under `--parallel`) and its raw fetch output (pre-`transform_data`, snapshotted) is threaded to the fragments phase as `main_data_context` (no module reload, no second fetch). Resources may rely on this (no PID sentinels/marker files needed).
64+
**`fragments_on_skip = true`** (per-resource in zeeker.toml, opt-in): run the fragments phase even when `fetch_data()` returns no new rows (steady-state builds), with `main_data_context=[]`. Default (flag absent): fragments only run when new main rows were inserted (unchanged behavior).
6165
```python
6266
def fetch_fragments_data(existing_fragments_table, main_data_context=None):
6367
if main_data_context:

‎packages/zeeker/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "zeeker"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
description = "Database management tool for Datasette-based systems"
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)