Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
4435570
chore: merge main into SpiralDB cost work
eywalker Dec 3, 2026
b7d7355
perf(spiraldb): check the writer lease on its first write
eywalker Dec 3, 2026
1d7af35
perf(spiraldb): index stored side-effect completions once per execution
eywalker Dec 3, 2026
eb0be80
perf(spiraldb): reuse the writer lease key index at flush
eywalker Dec 3, 2026
723cbf4
perf(spiraldb): release a claim without scanning its state
eywalker Dec 3, 2026
fd3f701
perf(spiraldb): share stale-table discovery across a run
eywalker Dec 3, 2026
4d2b272
perf(spiraldb): mark tables after their first successful append
eywalker Dec 3, 2026
1096bf2
perf(spiraldb): batch function result commits during node runs
eywalker Dec 3, 2026
6aeaf09
perf(spiraldb): use table IDs after name resolution
eywalker Dec 3, 2026
b71d942
fix(spiraldb): copy nested Arrow buffers before appending
eywalker Dec 3, 2026
48aa8c8
fix(spiraldb): keep run lookup capabilities independent of database i…
eywalker Dec 3, 2026
1c7e530
fix(spiraldb): keep run-shared state coherent and node batching to Sp…
eywalker Dec 3, 2026
cb56f9f
fix(spiraldb): list a table after an ambiguous first append
eywalker Dec 3, 2026
86b7d13
docs(spiraldb): state which accepted rows an ambiguous batch reply le…
eywalker Dec 3, 2026
11efa83
perf(spiraldb): find the newest writer lease generation from one data…
eywalker Dec 3, 2026
d382892
perf(spiraldb): keep what a run read under its writer lease
eywalker Dec 3, 2026
2deae0f
feat(spiraldb): take the writer lease at a run's first write (ITL-1900)
eywalker Dec 3, 2026
e82c9f2
perf(spiraldb): skip a lease verification made within 60 seconds (ITL…
eywalker Dec 3, 2026
e5d2956
perf(spiraldb): list a dataset once per run (ITL-1899)
eywalker Dec 3, 2026
c482765
fix(spiraldb): address the review of the lazy writer lease (ITL-1899)
eywalker Dec 3, 2026
449960e
refactor(spiraldb): rename the keyed connector (ITL-1903)
eywalker Dec 3, 2026
1c70cbe
refactor(spiraldb): replace keyed writer leases with write scopes
eywalker Dec 3, 2026
77ad91a
docs(spiraldb): document single-writer scopes and optional locks
eywalker Dec 3, 2026
270cb4f
merge(spiraldb): integrate main and update cache test expectations
eywalker Dec 3, 2026
a48cec4
chore: merge origin/main into writable database branch
eywalker Dec 3, 2026
9d8430c
fix(spiraldb): preserve commit dependencies during node writes
eywalker Dec 3, 2026
1ed6dd0
fix(spiraldb): guard side effects at the write boundary
eywalker Dec 3, 2026
38ebcbb
merge(spiraldb): integrate stage E commit dependency fixes
eywalker Dec 3, 2026
b0eada7
fix(spiraldb): share scopes across cached invocations
eywalker Dec 3, 2026
b244986
perf: build SpiralDB key sets on demand
eywalker Dec 3, 2026
22d9d02
fix: isolate standalone SpiralDB executions
eywalker Dec 3, 2026
8e56c86
docs(spiraldb): clarify write scope limitations
eywalker Dec 3, 2026
183b7e0
fix: restore async pod overrides and align database checks
eywalker Dec 3, 2026
d9ce39b
test(spiraldb): compare batch retries with per-row commits
eywalker Dec 3, 2026
cefb1d8
chore(spiraldb): merge writable database base updates
eywalker Dec 3, 2026
7b5c0ef
fix(spiraldb): preserve write scopes through review edge cases
eywalker Dec 3, 2026
bc14f50
fix(spiraldb): preserve write scope guarantees
eywalker Dec 3, 2026
928f25f
chore: merge main into database run optimizations
eywalker Dec 3, 2026
d6fe77a
feat(databases): add SpiralDatabase factory
eywalker Dec 3, 2026
fc931c4
feat(databases): add SpiralDatabase factory (#703)
eywalker Dec 3, 2026
6162ed9
Merge remote-tracking branch 'origin/eywalker/itl-1903-rename-the-key…
eywalker Dec 3, 2026
cba5d74
fix(databases): honor SpiralDatabase write mode
eywalker Dec 3, 2026
6f95fc0
chore: merge writable database base updates
eywalker Dec 3, 2026
f4b893e
fix(spiraldb): guard node batching and scope append retries
eywalker Dec 3, 2026
fcee739
chore(spiraldb): merge append retry and node batching fixes
eywalker Dec 3, 2026
9aa1062
fix(spiraldb): settle ordered retries before annotating errors
eywalker Dec 3, 2026
c43a983
fix(spiraldb): separate snapshot opens from append failures
eywalker Dec 3, 2026
bd084a7
fix(spiraldb): keep write scopes open during cancelled calls
eywalker Dec 3, 2026
98c96ae
fix(spiraldb): retry node batches and refresh table bindings
eywalker Dec 3, 2026
de03a25
fix(database): merge ordered node retries into write scopes
eywalker Dec 3, 2026
c761db3
fix(database): propagate write lock refusals from node execution
eywalker Dec 3, 2026
662e67f
chore: merge main into writable database changes
eywalker Dec 4, 2026
b1bf4d4
fix(database): preserve primary write scope errors
eywalker Dec 4, 2026
edb9891
chore: merge main into keyed SpiralDB rename
eywalker Dec 4, 2026
6df0d3a
chore: merge writable SpiralDB scopes into keyed rename
eywalker Dec 4, 2026
6f527df
style: organize keyed SpiralDB imports
eywalker Dec 4, 2026
41221d0
test: classify the SpiralDatabase factory for observers
eywalker Dec 4, 2026
90bd6d4
chore: merge the writable SpiralDB error handling fix
eywalker Dec 4, 2026
3927d57
chore(spiraldb): merge main into the keyed backend rename
eywalker Dec 4, 2026
c12395e
fix(spiraldb): validate retired connectors in saved caches
eywalker Dec 4, 2026
e1ceeac
fix(spiraldb): preserve migration and guide compatibility
eywalker Dec 4, 2026
8d20470
chore(spiraldb): merge stored result discovery into the keyed rename
eywalker Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -27176,7 +27176,7 @@
}
}
],
"./src/orcapod/databases/spiraldb_connector.py": [
"./src/orcapod/databases/spiraldb_keyed/connector.py": [
{
"code": "reportMissingImports",
"range": {
Expand Down Expand Up @@ -184110,7 +184110,7 @@
}
}
],
"./tests/test_databases/test_spiraldb_connector_integration.py": [
"./tests/test_databases/test_spiraldb_keyed_connector_integration.py": [
{
"code": "reportUnknownParameterType",
"range": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
SPIRAL_CLIENT_ID: ${{ secrets.SPIRAL_CLIENT_ID }}
SPIRAL_PRIVATE_KEY: ${{ secrets.SPIRAL_PRIVATE_KEY }}
# Serial (-n 0): the integration tests share one SpiralDB project (ITL-1181).
run: uv run --python "3.11" pytest -n 0 tests/test_databases/test_spiraldb_connector_integration.py -v
run: uv run --python "3.11" pytest -n 0 tests/test_databases/test_spiraldb_keyed_connector_integration.py -v

license-check:
uses: ./.github/workflows/_license-check.yml
Expand Down
4 changes: 4 additions & 0 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ This is a greenfield project pre-v0.1.0. Do NOT add backward-compatibility shims
re-exports, aliases, or deprecation wrappers when making design or implementation changes.
Just change the code and update all references directly.

The keyed backend is SpiralDBKeyedConnector (databases/spiraldb_keyed/). A saved
job uses connector_type: spiraldb_keyed. Loading the retired spiraldb connector
type raises an error naming spiraldb_keyed. The source kind stays spiraldb_table.

## No sys.modules hacks

Never manipulate sys.modules directly (e.g. sys.modules.setdefault). If a subpackage
Expand Down
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ This is a greenfield project pre-v0.1.0. Do **not** add backward-compatibility s
re-exports, aliases, or deprecation wrappers when making design or implementation changes.
Just change the code and update all references directly.

The keyed backend is `SpiralDBKeyedConnector` (`databases/spiraldb_keyed/`). A saved
job uses `connector_type: spiraldb_keyed`. Loading the retired `spiraldb` connector
type raises an error naming `spiraldb_keyed`. The source kind stays `spiraldb_table`.

## No `sys.modules` hacks

Never manipulate `sys.modules` directly (e.g. `sys.modules.setdefault`). If a subpackage
Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ job runs the connector conformance tests on a separate test project.
releases daily, of which Orcapod uses two attributes that are not public API
(`Client._native.api_url` and `Client._native.access_token`, for the documented table listing).
To move the pin: change it there, run `uv lock`, and run the conformance tests live
(`tests/test_databases/test_spiraldb_connector_integration.py`, see its docstring). A refusal or a
(`tests/test_databases/test_spiraldb_keyed_connector_integration.py`, see its docstring). A refusal or a
value that changed is a change of `tests/test_databases/fake_spiral_sdk.py` (its `RULES`) first.
From 0.16.79 spiral-sdk warns on every keyed-table open; Orcapod's connector ignores that one
message for its own opens (`spiraldb_connector._ignore_keyed_table_deprecation`), and
message for its own opens (`spiraldb_keyed.connector._ignore_keyed_table_deprecation`), and
`tests/test_databases/test_spiraldb_keyed_table_deprecation.py` fails if a new release changes
the message, the category or the module it is attributed to. The move off keyed tables is
ITL-1846.
Expand Down
2 changes: 1 addition & 1 deletion changelog.d/ITL-1023.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
- `FieldMetadataKeepingDatabaseProtocol` (`orcapod.protocols.database_protocols`): a
database states with `keeps_field_metadata` whether it keeps Arrow field metadata.
`InMemoryArrowDatabase`, `DeltaTableDatabase` and a `ConnectorArrowDatabase` over
`SpiralDBConnector` state `True`. The SQLite and PostgreSQL connector databases and
`SpiralDBKeyedConnector` state `True`. The SQLite and PostgreSQL connector databases and
`NoOpArrowDatabase` state `False`. `ExtensionAwareDatabase` states what the database
it wraps states, and a connector database what its connector states. A database
without the member is treated as not keeping field metadata.
Expand Down
4 changes: 2 additions & 2 deletions changelog.d/ITL-1186.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Breaking changes and migration

- SpiralDB is read through `spiral-sdk` (the `spiraldb` extra pins `spiral-sdk==0.16.74`), and `pyspiral` is gone. Both packages provide a module named `spiral`: install into an environment without `pyspiral`.
- A plain `SpiralDBConnector` only reads. Every write of a plain connector (`create_table_if_not_exists`, `upsert_records`, `delete_table`) and every job whose database is on one raises `SpiralDBWriteNotSupportedError`, before anything is buffered or run. A job keeps its tables in SpiralDB through a writable SpiralDB database, `SpiralDBConnector(..., writable=True)` (ITL-1844).
- A plain `SpiralDBKeyedConnector` only reads. Every write of a plain connector (`create_table_if_not_exists`, `upsert_records`, `delete_table`) and every job whose database is on one raises `SpiralDBWriteNotSupportedError`, before anything is buffered or run. A job keeps its tables in SpiralDB through a writable SpiralDB database, `SpiralDBKeyedConnector(..., writable=True)` (ITL-1844).
- A table's non-nullable columns and Arrow metadata are read from its dataset's schema table, `__orcapod_schemas__`, not from the table's metadata. Datasets written by an earlier release must be migrated once with `scripts/migrate_spiral_schemas.py` (`RELEASING.md`); then schemas, hashes and source ids are as before. Until then their tables read with every column nullable, with `UnrecordedTableSchemaWarning`, and their hashes differ.
- `read_nullability_record` and `write_nullability_record` are removed, and `NullabilityRecordError` is replaced by `TableSchemaError`.
- Row counts are counted from the keys: `row_count_estimate` is exact and reads every key, the `max_rows` check reads at most `max_rows + 1` keys, and a preview of more than 100,000 rows shows no total.
Expand All @@ -21,4 +21,4 @@
### Known limitations

- A saved SpiralDB login that has expired is not detected: the client may print a sign-in prompt and wait. Run `uv run spiral login` again.
- A `SpiralDBConnector` cannot be used in a forked process (`spawn` works); it is refused there.
- A `SpiralDBKeyedConnector` cannot be used in a forked process (`spawn` works); it is refused there.
6 changes: 3 additions & 3 deletions changelog.d/ITL-1334.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
aggregate) reads every column nullable. (ITL-1276)
- **`SQLiteConnector` refuses a `double` column holding a NaN or `-0.0`:** SQLite reads a
NaN back as NULL and `-0.0` as `0.0`. (ITL-1334)
- **`SpiralDBConnector` refuses a logical (extension) type:** `File`, `Directory`,
- **`SpiralDBKeyedConnector` refuses a logical (extension) type:** `File`, `Directory`,
`Path`, `UPath`, `UUID`, `list[T]` and `set[T]` of them, user classes and the library
value types read back from SpiralDB as their plain storage type (SpiralDB drops the
field metadata that names them). They are refused with `UnstorableColumnError` before
Expand Down Expand Up @@ -76,7 +76,7 @@
an append makes nullable reads back nullable. (ITL-1334)
- **`DeltaTableDatabase` refuses a struct with no fields at any depth:** a Parquet file
stores values in leaf columns only, so the flush failed. (ITL-1334)
- **`SpiralDBConnector` refuses field metadata below a map, and Arrow's canonical extension
- **`SpiralDBKeyedConnector` refuses field metadata below a map, and Arrow's canonical extension
types:** its metadata record does not descend into a map, so metadata on a map's key or
item, or inside them, read back dropped. A `uuid` or `json` column (Arrow's own extension
types) read back as its storage type. (ITL-1334)
Expand Down Expand Up @@ -108,7 +108,7 @@
the recorded type or a logical column's extension name, so afterwards a list read back
with its item named `element`, and a logical list (`set[int]`, `list[Path]`) as its
plain storage type. (ITL-1334)
- **`SpiralDBConnector` reads back a fixed-size list with non-null items and a null row:**
- **`SpiralDBKeyedConnector` reads back a fixed-size list with non-null items and a null row:**
the read cast every column to the restored schema, and pyarrow refuses that cast when a
null row hides null item slots; only columns whose type changes are cast now.
(ITL-1334)
2 changes: 1 addition & 1 deletion changelog.d/ITL-1350.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- A `SpiralDBTableSource` looks its table up once when it is built and once per new-data
check (ITL-1350). Every lookup of a table by name is a round trip to SpiralDB; the
source used to look the table up for each item it needed (key, id, schema and
version: four lookups to build, three per check). `SpiralDBConnector.lookup_table`
version: four lookups to build, three per check). `SpiralDBKeyedConnector.lookup_table`
returns the table once, with its id and key columns, and reads its schema and version
when asked, in the same order and under the same conditions as before, so a check
still finds a table dropped and created again since. Measured on a live project:
Expand Down
2 changes: 1 addition & 1 deletion changelog.d/ITL-1840.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Known limitations

- A writable SpiralDB database (`SpiralDBConnector(..., writable=True)`, ITL-1844) keeps every stored
- A writable SpiralDB database (`SpiralDBKeyedConnector(..., writable=True)`, ITL-1844) keeps every stored
table kind through `ConnectorArrowDatabase`: one table per path, its identity and
manifest in the table's metadata. Its format is provisional, outside the 0.4.0 freeze.
(ITL-1840)
26 changes: 8 additions & 18 deletions changelog.d/ITL-1844.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
### Added

- A SpiralDB dataset can be a job's database: a writable SpiralDB database,
`SpiralDBConnector(project_id, dataset, writable=True)` under `ConnectorArrowDatabase`, stores every table a job writes (function results and
`SpiralDBKeyedConnector(project_id, dataset, writable=True)` under `ConnectorArrowDatabase`, stores every table a job writes (function results and
pipeline records, operator caches, cached sources, side-effect logs), also as a separate
result database. Provisional in 0.4.0: the database's table format and its writer lease may
change in a later version, which may not read tables written now. Nothing of the
database enters a hash. See "SpiralDB as a Job's Database" in the concepts.
- One writer per writable SpiralDB database: `job.run()`, `job.run_async()` and a job node's `run()`
take the dataset's writer lease before checking a source or writing anything, and release
it when they end, also when they fail. A second writer is refused then with
`LeaseBusyError`, before anything of its run happens. A stale lease is cleared by its
project, dataset and table id with
`spiraldb_lease.clear(client, project_id, dataset, table_id, confirm_writer_stopped=True)`.
result database. The table format is provisional in 0.4.0 and later versions may
be unable to read tables written now. Nothing of the database enters a hash.
See [Keyed SpiralDB as a Job's Database](docs/concepts/spiraldb-keyed-database.md).
- A job saved on a writable SpiralDB database records `writable: true` and no credential; `PipelineJob.load`
takes the connector again and refuses a SpiralDB connector of the other kind.

### Known limitations

- Only a job run writes a writable SpiralDB database, through the writable connectors it
holds the lease with: a write through any other writable connector (a cached source read outside a run, a
`ConnectorArrowDatabase` over a connector of its own flushed directly) raises
`SpiralDBLeaseRequiredError`, also while a run holds the lease. A write through a
running job's own databases from outside the run is not told apart from the run's own.
A way to hold the lease outside a run is later work (ITL-1849).
- The writer lease is refuse-only: no waiting, no takeover, no expiry. Each run leaves one
small lease table in the dataset, which is kept.
- Writable SpiralDB databases assume one writer process per keyed dataset at a time.
The caller manages cross-process exclusion. The default `NoWriteLock` performs
no cross-process coordination. A direct write outside a run opens a write scope
for that call.
- A writable SpiralDB database reads a table's whole key column to tell which rows it holds, and whole tables
to read stored rows, so a run's cost grows with the tables' history.
- The database does not take over tables it did not write, and status and logging observers
Expand Down
2 changes: 1 addition & 1 deletion changelog.d/ITL-1899.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

### Added

- Writable `SpiralDBConnector` accepts a `WriteLock` provider from
- Writable `SpiralDBKeyedConnector` accepts a `WriteLock` provider from
`orcapod.databases.write_lock`. The default
`NoWriteLock` performs no cross-process coordination. A scope acquires its
lock before the first write or side effect and releases its handle when the
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/ITL-1903.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Added

- `orcapod.databases.SpiralDatabase(project_id, dataset, ...)` opens a writable SpiralDB
database for a job. Saved jobs record the concrete backend and its configuration.

### Changed

- The keyed backend is now `SpiralDBKeyedConnector`. Saved jobs now use the
`spiraldb_keyed` connector type. Loading the retired `spiraldb` type raises an
error naming `spiraldb_keyed`. The `spiraldb_table` source kind and source IDs
stay the same.
2 changes: 1 addition & 1 deletion changelog.d/ITL-998.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
a=2)` and `where(a=2, b=1)` save the same bytes. Saved jobs and configs written before
load to the same condition; their bytes change only when two or more columns had been
given out of that order. No hash, stored path or identity reads a saved condition.
- The `where` parameter of `SpiralDBConnector.scan_batches` is PROVISIONAL and takes a
- The `where` parameter of `SpiralDBKeyedConnector.scan_batches` is PROVISIONAL and takes a
`Condition` (equalities and ranges). To pass a mapping, wrap it in `Condition.of(...)`.
- For now, `SpiralDBTableSource.where(...)` and `where=` refuse an equality of a float
column to `-0.0` or a NaN (`TypeError`, pointing to `filter`). SpiralDB matches them by their bits,
Expand Down
12 changes: 7 additions & 5 deletions docs/api/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ introduction. Every signature and docstring on the published page comes from the
code. See site/README.md.
-->

Database backends store pipeline results. The SQLite and PostgreSQL connectors support
reads and writes through `ConnectorArrowDatabase`. The SpiralDB connector reads, and writes
only when opened writable (`writable=True`, provisional; see
[SpiralDB as a Job's Database](../concepts/spiraldb-database.md)).
Database backends store pipeline results. `SpiralDatabase` opens a writable database on
Orcapod's default SpiralDB backend. See
[Keyed SpiralDB as a Job's Database](../concepts/spiraldb-keyed-database.md).
The SQLite and PostgreSQL connectors support reads and writes through `ConnectorArrowDatabase`.

**Provisional.** `ExtensionAwareDatabase` is expected to be integrated more closely with
the underlying database classes (ITL-1539), so its public form may change.
Expand All @@ -20,6 +20,8 @@ the underlying database classes (ITL-1539), so its public form may change.

::: orcapod.databases.NoOpArrowDatabase

::: orcapod.databases.SpiralDatabase

::: orcapod.databases.ConnectorArrowDatabase

::: orcapod.databases.ExtensionAwareDatabase
Expand All @@ -28,7 +30,7 @@ the underlying database classes (ITL-1539), so its public form may change.

::: orcapod.databases.PostgreSQLConnector

::: orcapod.databases.SpiralDBConnector
::: orcapod.databases.SpiralDBKeyedConnector

::: orcapod.databases.write_lock.WriteLock

Expand Down
6 changes: 2 additions & 4 deletions docs/concepts/pipeline-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,8 @@ structs, dates or timestamps on SQLite, narrower integers and floats, logical ty
refused. PostgreSQL also refuses column names and explicit table identifiers longer than
63 bytes, which it would truncate (`UnstorableTableNameError` for a table).
SQLite and PostgreSQL stores generate table names within 63 bytes from the node's
path, using a readable hint and a digest of the full path. A database on
`SpiralDBConnector` refuses every write (`SpiralDBWriteNotSupportedError`) unless it is opened
writable, `SpiralDBConnector(..., writable=True)`: see
[SpiralDB as a Job's Database](spiraldb-database.md). The full list,
path, using a readable hint and a digest of the full path. Use `SpiralDatabase` to
store job tables in SpiralDB. See [Keyed SpiralDB as a Job's Database](spiraldb-keyed-database.md). The full list,
type by type, is [Data types per database](../reference/database-types.md).

Orcapod's own stored tables hold such columns. A function node's result table holds
Expand Down
14 changes: 7 additions & 7 deletions docs/concepts/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,19 @@ again only when the version moved. A changed environment or saved login, or a cl
whose calls failed, gives the next new source a new client. Closing a source affects no other;
the client goes with the last source that uses it, and a forked process starts with none.

A plain `SpiralDBConnector` only reads: a write through it (or a job whose database is on
one) raises `SpiralDBWriteNotSupportedError`. A job can keep its tables in SpiralDB through
a writable SpiralDB database, `SpiralDBConnector(..., writable=True)`: see
[SpiralDB as a Job's Database](spiraldb-database.md).
A plain `SpiralDBKeyedConnector` only reads: a write through it (or a job whose database is on
one) raises `SpiralDBWriteNotSupportedError`. Use `SpiralDatabase` to store job tables
in SpiralDB. See
[Keyed SpiralDB as a Job's Database](spiraldb-keyed-database.md).

Replace the example project, dataset and table names with identifiers you can access.
To find the tables of a dataset and their key columns:

<!-- docs-test: skip -->
```python
from orcapod.databases import SpiralDBConnector
from orcapod.databases import SpiralDBKeyedConnector

with SpiralDBConnector("my-project-123456", dataset="my_dataset") as spiral:
with SpiralDBKeyedConnector("my-project-123456", dataset="my_dataset") as spiral:
print(spiral.get_table_names())
print(spiral.get_pk_columns("sensor_reading"))
```
Expand Down Expand Up @@ -907,7 +907,7 @@ print(Condition.of(day=day, started=started, recorded=recorded))

- **One mechanism.** `where()` adds to the conditions given with `where=` (a mapping or a
`Condition`) when the source was built (`Condition.combined`), and SpiralDB applies them
in the scan. If you call `SpiralDBConnector.scan_batches` directly, its PROVISIONAL
in the scan. If you call `SpiralDBKeyedConnector.scan_batches` directly, its PROVISIONAL
`where` parameter takes a `Condition`. Use `Condition.of(...)` to wrap a mapping.
A column already restricted to another value is refused, as is a column the table
does not have, `None` (a null equals nothing) and
Expand Down
Loading
Loading