feather-cdc-postgres 0.1.0__py3-none-any.whl
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.
- feather_cdc_postgres/__init__.py +6 -0
- feather_cdc_postgres/__main__.py +9 -0
- feather_cdc_postgres/adapters/__init__.py +44 -0
- feather_cdc_postgres/adapters/featherbase.py +126 -0
- feather_cdc_postgres/cli.py +247 -0
- feather_cdc_postgres/destination.py +640 -0
- feather_cdc_postgres/discovery.py +216 -0
- feather_cdc_postgres/drift.py +207 -0
- feather_cdc_postgres/generate_dbt.py +106 -0
- feather_cdc_postgres/lifecycle.py +79 -0
- feather_cdc_postgres/manifest.py +587 -0
- feather_cdc_postgres/ownership.py +103 -0
- feather_cdc_postgres/publication.py +157 -0
- feather_cdc_postgres/runner.py +1399 -0
- feather_cdc_postgres/schema_registry.py +283 -0
- feather_cdc_postgres/selectors.py +347 -0
- feather_cdc_postgres/snapshot.py +448 -0
- feather_cdc_postgres/stream.py +162 -0
- feather_cdc_postgres/telemetry.py +172 -0
- feather_cdc_postgres-0.1.0.dist-info/METADATA +239 -0
- feather_cdc_postgres-0.1.0.dist-info/RECORD +30 -0
- feather_cdc_postgres-0.1.0.dist-info/WHEEL +4 -0
- feather_cdc_postgres-0.1.0.dist-info/entry_points.txt +2 -0
- pg_replication/LICENSE +201 -0
- pg_replication/README.md +100 -0
- pg_replication/__init__.py +106 -0
- pg_replication/decoders.py +428 -0
- pg_replication/exceptions.py +6 -0
- pg_replication/helpers.py +1405 -0
- pg_replication/schema_types.py +156 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"""Control-plane telemetry for one registration (#3079 D11).
|
|
2
|
+
|
|
3
|
+
The `_slot` probe keeps the Sweep 2e contract byte-for-byte (entity `_slot`, unit `probe`,
|
|
4
|
+
extra carrying slot/active/wal_status/restart_lsn/confirmed_flush_lsn/lag_bytes) and adds the
|
|
5
|
+
D-7 fuse read from the server (`max_slot_wal_keep_size`), the selected/published/destination
|
|
6
|
+
counts and checkpoint age. Reconciliation counts skip tables above a row threshold rather than
|
|
7
|
+
pretending to compare them; a compared table that does not tie is an EV_ERROR, not an `ok`
|
|
8
|
+
carrying a delta in `extra`.
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import datetime as _dt
|
|
13
|
+
import fnmatch
|
|
14
|
+
|
|
15
|
+
import psycopg
|
|
16
|
+
from psycopg import sql
|
|
17
|
+
|
|
18
|
+
from control_plane import status as cp_status
|
|
19
|
+
|
|
20
|
+
RECONCILE_MAX_ROWS = 1_000_000
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def slot_probe(dsn: str, slot: str) -> dict | None:
|
|
24
|
+
"""One row of slot telemetry, or None when the slot does not exist."""
|
|
25
|
+
with psycopg.connect(dsn, connect_timeout=10) as conn:
|
|
26
|
+
row = conn.execute(
|
|
27
|
+
"""
|
|
28
|
+
select active, wal_status, restart_lsn::text, confirmed_flush_lsn::text,
|
|
29
|
+
pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)::bigint as lag_bytes,
|
|
30
|
+
(confirmed_flush_lsn - '0/0')::bigint as confirmed_flush_int
|
|
31
|
+
from pg_replication_slots where slot_name = %s
|
|
32
|
+
""",
|
|
33
|
+
(slot,),
|
|
34
|
+
).fetchone()
|
|
35
|
+
fuse = conn.execute(
|
|
36
|
+
"select setting, unit from pg_settings where name = 'max_slot_wal_keep_size'"
|
|
37
|
+
).fetchone()
|
|
38
|
+
if row is None:
|
|
39
|
+
return None
|
|
40
|
+
return {
|
|
41
|
+
"slot": slot,
|
|
42
|
+
"active": row[0],
|
|
43
|
+
"wal_status": row[1],
|
|
44
|
+
"restart_lsn": row[2],
|
|
45
|
+
"confirmed_flush_lsn": row[3],
|
|
46
|
+
"lag_bytes": int(row[4]) if row[4] is not None else None,
|
|
47
|
+
"confirmed_flush_int": int(row[5]) if row[5] is not None else None,
|
|
48
|
+
"max_slot_wal_keep_size_bytes": _fuse_bytes(fuse),
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _fuse_bytes(setting) -> int | None:
|
|
53
|
+
"""pg_settings gives a number plus a unit ('MB', '8kB', …). A negative setting means NO
|
|
54
|
+
fuse, and it reports as None — the same spelling `discovery.slot_state` uses. Never -1:
|
|
55
|
+
a consumer comparing `lag > 10% of fuse` reads that as a zero fuse and alarms forever."""
|
|
56
|
+
if not setting:
|
|
57
|
+
return None
|
|
58
|
+
value, unit = setting
|
|
59
|
+
try:
|
|
60
|
+
n = int(value)
|
|
61
|
+
except (TypeError, ValueError):
|
|
62
|
+
return None
|
|
63
|
+
if n < 0:
|
|
64
|
+
return None
|
|
65
|
+
factors = {"B": 1, "kB": 1024, "8kB": 8192, "MB": 1024 ** 2, "GB": 1024 ** 3}
|
|
66
|
+
return n * factors.get(unit or "B", 1)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def emit_probe(run, probe: dict | None, counts: dict | None = None, *,
|
|
70
|
+
pull_ms: int | None = None) -> dict:
|
|
71
|
+
"""Sweep 2e reads exactly this event: entity `_slot`, unit `probe`."""
|
|
72
|
+
extra = dict(probe or {})
|
|
73
|
+
extra.update(counts or {})
|
|
74
|
+
run.event(entity="_slot", status=cp_status.EV_OK, unit="probe",
|
|
75
|
+
pull_ms=pull_ms, extra=extra)
|
|
76
|
+
return extra
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def checkpoint_age_s(committed_at) -> float | None:
|
|
80
|
+
if committed_at is None:
|
|
81
|
+
return None
|
|
82
|
+
if committed_at.tzinfo is None:
|
|
83
|
+
committed_at = committed_at.replace(tzinfo=_dt.timezone.utc)
|
|
84
|
+
return (_dt.datetime.now(_dt.timezone.utc) - committed_at).total_seconds()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
EXCLUDED_REASON = "excluded by manifest: self-written by this drainer"
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
APPEND_ONLY_REASON = ("append_only: the destination keeps every row version, so a row count "
|
|
91
|
+
"cannot tie against the source's current rows")
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def reconcile_counts(dsn: str, destination, relations, targets,
|
|
95
|
+
*, threshold: int = RECONCILE_MAX_ROWS,
|
|
96
|
+
exclude: "list[str] | None" = None,
|
|
97
|
+
append_only: "set | None" = None) -> list[dict]:
|
|
98
|
+
"""Source vs destination row counts, per relation. A table whose source count exceeds
|
|
99
|
+
`threshold`, which the manifest excludes, or which loads `append_only`, is reported as
|
|
100
|
+
skipped with a reason — never as a silent pass. `exclude` exists because a relation this
|
|
101
|
+
drainer WRITES DURING THE RUN (its own `control.run`/`control.event`) can never tie "now"
|
|
102
|
+
against "now"; `append_only` because one source UPDATE leaves two destination row versions,
|
|
103
|
+
which would pin that table to EV_ERROR for the rest of its life. `targets` maps
|
|
104
|
+
(schema, table) -> destination schema; a relation not in it is counted where it came from.
|
|
105
|
+
"""
|
|
106
|
+
out: list[dict] = []
|
|
107
|
+
target = lambda s, t: targets.get((s, t), s) # noqa: E731
|
|
108
|
+
patterns = list(exclude or [])
|
|
109
|
+
keyless = set(append_only or ())
|
|
110
|
+
compared: list[tuple] = [] # (schema, table, source_rows), counted on one dest connection
|
|
111
|
+
with psycopg.connect(dsn, connect_timeout=10) as conn:
|
|
112
|
+
for schema, table in relations:
|
|
113
|
+
if (schema, table) in keyless:
|
|
114
|
+
out.append({"schema": schema, "table": table, "skipped": True,
|
|
115
|
+
"append_only": True, "reason": APPEND_ONLY_REASON})
|
|
116
|
+
continue
|
|
117
|
+
if any(fnmatch.fnmatchcase(f"{schema}.{table}", pat) for pat in patterns):
|
|
118
|
+
out.append({"schema": schema, "table": table, "skipped": True,
|
|
119
|
+
"excluded": True, "reason": EXCLUDED_REASON})
|
|
120
|
+
continue
|
|
121
|
+
row = conn.execute(
|
|
122
|
+
"select reltuples::bigint from pg_class c join pg_namespace n "
|
|
123
|
+
"on n.oid = c.relnamespace where n.nspname = %s and c.relname = %s",
|
|
124
|
+
(schema, table)).fetchone()
|
|
125
|
+
estimate = int(row[0]) if row and row[0] is not None else 0
|
|
126
|
+
if estimate > threshold:
|
|
127
|
+
out.append({"schema": schema, "table": table, "skipped": True,
|
|
128
|
+
"reason": f"estimated {estimate} rows > threshold {threshold}"})
|
|
129
|
+
continue
|
|
130
|
+
src = conn.execute(sql.SQL("select count(*) from {}.{}").format(
|
|
131
|
+
sql.Identifier(schema), sql.Identifier(table))).fetchone()[0]
|
|
132
|
+
compared.append((schema, table, int(src)))
|
|
133
|
+
out.append(None) # placeholder keeps relation order
|
|
134
|
+
dest_counts = destination.table_row_counts(
|
|
135
|
+
[(target(s, t), t) for s, t, _ in compared]) if compared else {}
|
|
136
|
+
for schema, table, src in compared:
|
|
137
|
+
dest = dest_counts.get((target(schema, table), table))
|
|
138
|
+
out[out.index(None)] = {
|
|
139
|
+
"schema": schema, "table": table, "skipped": False,
|
|
140
|
+
"source_rows": src, "destination_rows": dest,
|
|
141
|
+
"delta": None if dest is None else src - int(dest),
|
|
142
|
+
# dlt creates a table on its FIRST row, so "0 at the source, absent at the
|
|
143
|
+
# destination" ties — reporting it as a mismatch would fire an error every tick
|
|
144
|
+
# for every still-empty selected table.
|
|
145
|
+
"match": (int(dest) == src) if dest is not None else src == 0}
|
|
146
|
+
return out
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def emit_reconcile(run, per_table_rows) -> None:
|
|
150
|
+
for row in per_table_rows:
|
|
151
|
+
entity = f"{row['schema']}.{row['table']}"
|
|
152
|
+
if row.get("skipped"):
|
|
153
|
+
extra = {"skipped": True, "reason": row.get("reason")}
|
|
154
|
+
if row.get("excluded"):
|
|
155
|
+
extra["excluded"] = True
|
|
156
|
+
if row.get("append_only"):
|
|
157
|
+
extra["append_only"] = True
|
|
158
|
+
run.event(entity=entity, status=cp_status.EV_ZERO_ROWS, unit="reconcile",
|
|
159
|
+
extra=extra)
|
|
160
|
+
else:
|
|
161
|
+
# A count that does not tie is the whole point of reconciling: it is an error-class
|
|
162
|
+
# event, never an `ok` with an interesting `extra` nobody queries.
|
|
163
|
+
matched = bool(row.get("match"))
|
|
164
|
+
run.event(entity=entity,
|
|
165
|
+
status=cp_status.EV_OK if matched else cp_status.EV_ERROR,
|
|
166
|
+
unit="reconcile", rows=row.get("source_rows"),
|
|
167
|
+
error_detail=None if matched else (
|
|
168
|
+
f"source {row.get('source_rows')} vs destination "
|
|
169
|
+
f"{row.get('destination_rows')} (delta {row.get('delta')})"),
|
|
170
|
+
extra={"source_rows": row.get("source_rows"),
|
|
171
|
+
"destination_rows": row.get("destination_rows"),
|
|
172
|
+
"delta": row.get("delta"), "match": matched})
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: feather-cdc-postgres
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Declarative PostgreSQL -> MotherDuck CDC runtime: one registration file per source database, no per-source extractor
|
|
5
|
+
Project-URL: Homepage, https://github.com/siraj-samsudeen/feather-flow
|
|
6
|
+
Project-URL: Repository, https://github.com/siraj-samsudeen/feather-flow
|
|
7
|
+
Project-URL: Issues, https://github.com/siraj-samsudeen/feather-flow/issues
|
|
8
|
+
Author-email: Siraj Samsudeen <mailsiraj@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: cdc,duckdb,etl,logical-replication,motherduck,postgresql
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Database
|
|
18
|
+
Classifier: Topic :: Database :: Database Engines/Servers
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: dlt[motherduck,sql-database]>=1.0.0
|
|
21
|
+
Requires-Dist: duckdb==1.5.2
|
|
22
|
+
Requires-Dist: feather-control-plane[postgres]<0.2,>=0.1.0
|
|
23
|
+
Requires-Dist: psycopg2-binary>=2.9.9
|
|
24
|
+
Requires-Dist: psycopg[binary]>=3.1
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# feather-cdc-postgres
|
|
29
|
+
|
|
30
|
+
Mirror a PostgreSQL database into MotherDuck from one declaration file, with no extractor
|
|
31
|
+
written for it.
|
|
32
|
+
|
|
33
|
+
Point it at a source database and a destination, say which relations you want, and it does the
|
|
34
|
+
rest: creates the replication slot and publication, takes a consistent baseline of every
|
|
35
|
+
selected table, then drains the write-ahead log on a schedule. A table with a primary key is
|
|
36
|
+
merged; a table with none is kept as an append-only history. Schema changes, renames and
|
|
37
|
+
`TRUNCATE` are followed. Columns you name are withheld before they ever leave the process.
|
|
38
|
+
|
|
39
|
+
One code artifact, one **registration** per source database, one service instance per
|
|
40
|
+
registration. Adding a source is a reviewed YAML file, not a new codebase.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install feather-cdc-postgres
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Commands
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m feather_cdc_postgres validate <registration>.yml # static + read-only checks
|
|
52
|
+
python -m feather_cdc_postgres plan <registration>.yml # every change a run would make
|
|
53
|
+
python -m feather_cdc_postgres generate-dbt <registration>.yml --out PATH
|
|
54
|
+
python -m feather_cdc_postgres run|status|resnapshot <registration>.yml
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`feather-cdc-postgres <command> ...` is installed as a console script and does the same thing.
|
|
58
|
+
|
|
59
|
+
`validate` and `plan` **mutate nothing** — they open read-only connections and print.
|
|
60
|
+
`plan` is safe to run against production; `tests/test_cli_plan_pg.py` fingerprints the source
|
|
61
|
+
catalog before and after to keep that claim true. `--json` on any command gives machine output.
|
|
62
|
+
`run`/`status`/`resnapshot` apply the same static validation first and refuse — before opening
|
|
63
|
+
any connection — on an error-severity problem (an unknown `api_version`, say).
|
|
64
|
+
|
|
65
|
+
`generate-dbt --out` is **required**: the runtime has no opinion about where your dbt project
|
|
66
|
+
lives.
|
|
67
|
+
|
|
68
|
+
Exit codes: `0` clean, `1` at least one error-severity problem or an unexpected failure (printed
|
|
69
|
+
redacted, never as a raw traceback), `2` a malformed manifest.
|
|
70
|
+
|
|
71
|
+
## Running one instance
|
|
72
|
+
|
|
73
|
+
Registrations are **yours**, not this package's: none ship here. Each instance is selected
|
|
74
|
+
entirely by environment:
|
|
75
|
+
|
|
76
|
+
| var | set to |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `<manifest source.dsn_env>` | the source PostgreSQL DSN |
|
|
79
|
+
| `<manifest destination.token_env>` | the MotherDuck token |
|
|
80
|
+
| `CDC_LOG_PG_DSN` | the PostgreSQL database this mirror's runs and events are logged to. A hard dependency unless `--dev`; `CONTROL_PG_DSN` is accepted as a fallback |
|
|
81
|
+
| `CONTROL_WAL_DIR` | a mounted (non-ephemeral) path — only needed when `control.event_durability: persistent_local_wal` |
|
|
82
|
+
| `RAILWAY_ENVIRONMENT_NAME` | where set, must equal the registration's `environment`, or `run`/`resnapshot` exit before any connection |
|
|
83
|
+
|
|
84
|
+
The source needs `wal_level = logical` and a role with `REPLICATION`.
|
|
85
|
+
|
|
86
|
+
## What a registration declares
|
|
87
|
+
|
|
88
|
+
| Block | Decides |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `environment` | `production` (default), `staging` or `dev` |
|
|
91
|
+
| `source` | which relations: `include`/`exclude`/`deny` globs on `schema.table`, plus an optional catalog `discovery.adapter` |
|
|
92
|
+
| `destination` | MotherDuck database, **`owner`** (required: the MotherDuck account the token must sign in as; `run`/`resnapshot` check `current_user()` against it before creating the database on a first run or writing anything), `schema_mapping` (default: source schemas preserved), **`table_schemas`** (per-table target schema, `[{match: "schema.table" glob, schema: target}]`, first match wins), dlt pipeline name (only with a single target schema), retirement policy |
|
|
93
|
+
| `replication` | slot, publication, cadence, key policy for unkeyed tables, replica identity, batch size |
|
|
94
|
+
| `control` | the extractor identity, run-log availability policy, event durability, `reconcile_exclude` |
|
|
95
|
+
| `classification` | optional first-match rules overriding the default `table_class` |
|
|
96
|
+
|
|
97
|
+
Secrets are **references**: `dsn_env` and `token_env` name environment variables. A manifest
|
|
98
|
+
carrying a value is rejected, and no environment value is ever printed or written into an event.
|
|
99
|
+
|
|
100
|
+
`tests/fixtures/registrations/` holds four worked examples.
|
|
101
|
+
|
|
102
|
+
## Selection semantics
|
|
103
|
+
|
|
104
|
+
- A relation is `(schema, table)`, always together — two schemas may hold the same table name.
|
|
105
|
+
- Patterns are `fnmatch` globs over the qualified name (`public._dlt_*`). `include` is a
|
|
106
|
+
conjunction (schema **and**, when given, table pattern); `exclude` and `deny` are disjunctions.
|
|
107
|
+
- **`deny` is evaluated on the compiled set**, after the adapter narrows it — a deny rule is a
|
|
108
|
+
tripwire that fires only when something really would have been replicated.
|
|
109
|
+
- **`deny.columns`** (`{"schema.table": [column, ...]}`, exact names) withholds columns:
|
|
110
|
+
they are left out of the baseline select list, dropped by name from every decoded record and
|
|
111
|
+
from dlt's hints, and kept out of the drift signature. The deny follows the table's OID and
|
|
112
|
+
the column's attnum, so a table or column rename cannot release it. Every decoded description
|
|
113
|
+
of a table that carries a deny must match, exactly, the column layout its baseline recorded;
|
|
114
|
+
any column DDL there (an added column included) quarantines the table until a resnapshot.
|
|
115
|
+
Every run checks the destination (and each `_staging` twin) and reports a denied column found
|
|
116
|
+
there as an error. It is a projection *inside the CDC process*, not a publication column list:
|
|
117
|
+
under `replica_identity: full` that list must name every column, or every UPDATE/DELETE of the
|
|
118
|
+
table fails at the source.
|
|
119
|
+
- A discovery adapter supplies policy only ("which relations, and what does the source call
|
|
120
|
+
them"). It never supplies types, keys or load behaviour. The Featherbase adapter's
|
|
121
|
+
`options.system_tables` switches on the **two-way rule**: a `table_def."system" = true` table
|
|
122
|
+
(the platform's own) is offered only when named there, a `"system" = false` (user-created)
|
|
123
|
+
table always is — so a new user table flows with no manifest edit. `plan` prints each
|
|
124
|
+
relation's `origin=` (`user_created` / `named_system`); user-created relations classify as
|
|
125
|
+
`application` whatever they are called. Absent, the adapter offers everything.
|
|
126
|
+
- One dlt pipeline per **target** schema (`<source_id>_cdc__<target_schema>`), never per
|
|
127
|
+
source schema: `_cdc_runtime.*`, lifecycle and control events keep the **source**
|
|
128
|
+
identity `schema.table`; the destination side is the relation's compiled `target_schema`.
|
|
129
|
+
- `selection_hash` covers the relation set **and** each table's key policy, so a table that
|
|
130
|
+
silently dropped from merge to append-only changes the hash.
|
|
131
|
+
|
|
132
|
+
## Key policy
|
|
133
|
+
|
|
134
|
+
Primary key → merge. Otherwise a **NOT NULL** non-partial, non-expression unique index → merge on
|
|
135
|
+
its **key** columns (`INCLUDE` columns carry no uniqueness and are never part of the key;
|
|
136
|
+
`NULL = NULL` is never true, so a nullable key would insert a duplicate on every load).
|
|
137
|
+
Otherwise `replication.tables_without_key`: `reject` (default, an error naming the table) or
|
|
138
|
+
`append_only`. `key_overrides` can force `append_only` per table. `full_row` is **rejected**
|
|
139
|
+
(`full_row_unsupported`): an all-column merge key cannot mirror an UPDATE — pgoutput emits only
|
|
140
|
+
the new tuple, so the old row is never matched and both versions would stay.
|
|
141
|
+
|
|
142
|
+
`append_only` is a load contract, not "no key": on the CDC path the relation **merges on `lsn`**
|
|
143
|
+
(unique per WAL record), so a batch replayed after a crash lands exactly once. An UPDATE lands as
|
|
144
|
+
an additional row version and a DELETE record removes nothing — updates and deletes are recorded
|
|
145
|
+
as arrivals, not applied. A re-baseline (resnapshot, a resumed interrupted snapshot, a slot-loss
|
|
146
|
+
re-init) therefore REPLACES the destination copy: a snapshot row has no `lsn` to dedup on.
|
|
147
|
+
|
|
148
|
+
**Every baseline has a boundary.** The initial snapshot reads the slot's exported snapshot, so
|
|
149
|
+
nothing below its consistent point is ever streamed. Every later baseline — a table added
|
|
150
|
+
mid-life, a resumed snapshot, a resnapshot — reads a table the publication already carries, so
|
|
151
|
+
it overlaps the WAL; `snapshot.consistent_baseline` takes it from a throwaway slot `<slot>_bl`
|
|
152
|
+
whose consistent point PostgreSQL guarantees matches its snapshot ("in the snapshot" ⟺ "commit
|
|
153
|
+
LSN < boundary", with in-flight transactions waited out), stores that boundary per relation in
|
|
154
|
+
`_cdc_runtime.baseline`, and the drain drops that relation's transactions below it. That is what
|
|
155
|
+
makes the overlap exact for `append_only`, where no key could dedup it.
|
|
156
|
+
|
|
157
|
+
**`TRUNCATE`** is published and applied: a keyed mirror is emptied before the rows that followed
|
|
158
|
+
the truncate load (batch order preserved); an `append_only` history keeps every arrival. Both
|
|
159
|
+
emit a `truncate` control event. **Partitioned tables** replicate as their partitions (`relkind
|
|
160
|
+
'r'`); the parent is a named `partitioned_parent_skipped` warning, never a relation.
|
|
161
|
+
|
|
162
|
+
**Run outcome**: the run's status is `ok` only when every selected relation drained with no
|
|
163
|
+
error-class event; `partial` when a table is drift-blocked or a reconcile count did not tie;
|
|
164
|
+
`failed` when nothing drained (slot lost under `slot_loss_policy: pause`, or a selection that
|
|
165
|
+
compiled to nothing — which `run` refuses rather than leaving an undrained slot behind).
|
|
166
|
+
|
|
167
|
+
`control.reconcile_exclude` names `schema.table` globs the reconcile counts skip — for relations
|
|
168
|
+
written while this mirror runs, which can never tie source-now against destination-now.
|
|
169
|
+
`append_only` relations are skipped too (`extra.append_only`): their destination keeps every row
|
|
170
|
+
version, so a count can never tie once the source is edited. Both still emit a `reconcile` event
|
|
171
|
+
with `skipped` and a reason, so the gap is visible rather than silently passed.
|
|
172
|
+
|
|
173
|
+
Merging on a unique index needs the source to publish those columns on DELETE — set
|
|
174
|
+
`replica_identity: full` or `ALTER TABLE ... REPLICA IDENTITY USING INDEX`. The compiler warns
|
|
175
|
+
when neither is in place.
|
|
176
|
+
|
|
177
|
+
## Type matrix
|
|
178
|
+
|
|
179
|
+
`schema_registry.compile_column` maps every OID in use on the sources it has met exactly, and
|
|
180
|
+
labels how faithful the mapping is: `exact`, `widened`, `exact_as_text` (uuid, name),
|
|
181
|
+
`lossy_text` (interval, timetz), `text_fallback`. Arrays and undeclared OIDs land as text and
|
|
182
|
+
**always** raise a warning naming `schema.table.column` and the OID — never silently.
|
|
183
|
+
|
|
184
|
+
The integer family (`int2/int4/int8/oid`) compiles to plain `BIGINT`. dlt renders
|
|
185
|
+
`{"data_type": "bigint", "precision": 32}` as `INTEGER` on duckdb while the snapshot path
|
|
186
|
+
reflects every integer as `BIGINT`, so dropping the precision hint pins one spelling, in the
|
|
187
|
+
widening direction.
|
|
188
|
+
|
|
189
|
+
## The run log
|
|
190
|
+
|
|
191
|
+
Runs, per-relation events and budget telemetry go to
|
|
192
|
+
[`feather-control-plane`](../feather-control-plane), a hard dependency of this package, writing
|
|
193
|
+
to whatever `CDC_LOG_PG_DSN` points at — deliberately **not** the database being mirrored. Pass
|
|
194
|
+
`--dev` for a local, WAL-only run that writes no run rows at all.
|
|
195
|
+
|
|
196
|
+
## Vendored code
|
|
197
|
+
|
|
198
|
+
`src/pg_replication/` is the `pg_replication` verified source from
|
|
199
|
+
[dlt-hub/verified-sources](https://github.com/dlt-hub/verified-sources), Apache-2.0, **modified**.
|
|
200
|
+
Upstream is a `dlt init` template rather than a distribution, so there is nothing on PyPI to pin.
|
|
201
|
+
See `src/pg_replication/README.md` for the attribution and `src/pg_replication/LICENSE` for the
|
|
202
|
+
licence text.
|
|
203
|
+
|
|
204
|
+
## Tests
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
cd packages/feather-cdc-postgres && uv run --package feather-cdc-postgres pytest -q
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
`--package` picks the *environment*; it does not pick the tests. pytest takes its config from the
|
|
211
|
+
nearest `pyproject.toml` above the working directory, so a bare `pytest` run from the repo root
|
|
212
|
+
collects feather-flow's own suite no matter what `--package` says. Either `cd` in or name the
|
|
213
|
+
path.
|
|
214
|
+
|
|
215
|
+
522 tests. 275 are pure logic and run anywhere; **247 need a real PostgreSQL with
|
|
216
|
+
`wal_level = logical`** and are skipped without one — they create and drop replication slots,
|
|
217
|
+
publications, schemas and tables, so never point them at a database you care about. The suite
|
|
218
|
+
finds a server in this order:
|
|
219
|
+
|
|
220
|
+
1. `PG_MD_CDC_TEST_DSN` — a superuser DSN for a server you own.
|
|
221
|
+
2. a local PostgreSQL binary (`pg_ctl` on `PATH`, else Homebrew's keg-only `postgresql@N`),
|
|
222
|
+
`initdb`'d into a temp directory on a throwaway port and torn down afterwards.
|
|
223
|
+
`PG_MD_CDC_TEST_PORT` picks the port (default 54331) so parallel sessions do not collide.
|
|
224
|
+
3. otherwise skip.
|
|
225
|
+
|
|
226
|
+
A container works for (1):
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
docker run -d -p 55432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=cdc_test \
|
|
230
|
+
-e POSTGRES_INITDB_ARGS="-c wal_level=logical -c max_replication_slots=20 -c max_wal_senders=20" \
|
|
231
|
+
postgres:17
|
|
232
|
+
PG_MD_CDC_TEST_DSN=postgresql://postgres:postgres@127.0.0.1:55432/cdc_test uv run pytest -q
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Three tests additionally need PostgreSQL 18 (`publish_generated_columns`) and skip below it.
|
|
236
|
+
|
|
237
|
+
The destination in tests is dlt's `duckdb` destination (a temp file) — the same load path
|
|
238
|
+
MotherDuck takes minus credentials, so merge, hard-delete and schema-evolution behaviour is
|
|
239
|
+
exercised for real.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
feather_cdc_postgres/__init__.py,sha256=pNlcbnkKIzDE8zb2GXROwq5cxrUQ7_CkOcihWpeAwic,363
|
|
2
|
+
feather_cdc_postgres/__main__.py,sha256=7Rgsh_puIzp0yprH9NSX6Y4ziJT7fb9F5B7hkorzwIo,171
|
|
3
|
+
feather_cdc_postgres/cli.py,sha256=WyATgCizwoRemzHDOhOZzcandkViLYbfzit6vJu4zzQ,11085
|
|
4
|
+
feather_cdc_postgres/destination.py,sha256=LxZwd9fwztY_vT5HbnTLfitL0kaabSpx_il0pURUxJU,34325
|
|
5
|
+
feather_cdc_postgres/discovery.py,sha256=Id2R0O7klv1Pt48XEaoTZKdgt2ruGpdURczm9wzJIOg,8179
|
|
6
|
+
feather_cdc_postgres/drift.py,sha256=KpcOai-6ZejtGZPbHYncrBU7f9G95r5t6RaeM7CpVqQ,10965
|
|
7
|
+
feather_cdc_postgres/generate_dbt.py,sha256=9r8H5zDJZvuZkMC8wZtJFbJZwcJYfgAMRkJ6EOjPVnE,4530
|
|
8
|
+
feather_cdc_postgres/lifecycle.py,sha256=QZhdojbybONNFQ5E2ph4Qh4oF9EVTK1e2uYQvHTQBBw,3717
|
|
9
|
+
feather_cdc_postgres/manifest.py,sha256=AK65-1SjmCH9ERb78OxmtU97USQWfRDdoA5xPA5phs0,26176
|
|
10
|
+
feather_cdc_postgres/ownership.py,sha256=0GpHD17ZMqWQScgw6RwKWZ2MVgRPEmHbtcZXh5Dsvxw,4214
|
|
11
|
+
feather_cdc_postgres/publication.py,sha256=Gh_iRRs7jlH4rHj3B2VUcKt2G1NRXUdaCaV5wD0aCng,6376
|
|
12
|
+
feather_cdc_postgres/runner.py,sha256=GAWPtDGTRuD9edPPa5X3PDQAnbKv2-cMK_lqbg-ZovU,80140
|
|
13
|
+
feather_cdc_postgres/schema_registry.py,sha256=exElvS9MnaAt1FAzgYUerrzOS5eYtSDP_YjJi9RPHOc,10878
|
|
14
|
+
feather_cdc_postgres/selectors.py,sha256=ry1-vfANIaWHnkbsd2iiA7Go4Fdu3lTE8EnMNJjk0Uk,14988
|
|
15
|
+
feather_cdc_postgres/snapshot.py,sha256=WgmOESSJxgNVGLUZ7itaUgJoSAZSHD1dKHg_wZzljCI,23405
|
|
16
|
+
feather_cdc_postgres/stream.py,sha256=pSiJ7ytXTDzvOAXSVvBWrFVTrnYDh0sYAyiYCuh9qnc,8319
|
|
17
|
+
feather_cdc_postgres/telemetry.py,sha256=2Jei8ZA2-nT3bmPA-HgBMuSbIsTv9vA8TszpCvWRMrs,8188
|
|
18
|
+
feather_cdc_postgres/adapters/__init__.py,sha256=VtKxaDKQQKXH9a16XC8qbpMt0k1RX2Kwv_zh3r3puo8,1562
|
|
19
|
+
feather_cdc_postgres/adapters/featherbase.py,sha256=pipRrtr_aQkK6fVt2QQnzyM3p1XHB2nJAZEYPBbHTP4,6305
|
|
20
|
+
pg_replication/LICENSE,sha256=_nEMRbM06DjoA_HYbxbG1oHnSoWqh0dbnBM86bQaqyk,11346
|
|
21
|
+
pg_replication/README.md,sha256=qr3UO22udVIbA7guRzflZwHXLrYYbzSBtxE7D2xEhjI,3930
|
|
22
|
+
pg_replication/__init__.py,sha256=ied2rInTydj3bLkkZDUP2dErY5VJ9tUlOlJHx_dQFoM,4693
|
|
23
|
+
pg_replication/decoders.py,sha256=4iUf5sJP0I-kKdz5yMMhwlNJNKRjSv8oICvJMc1QqYc,16586
|
|
24
|
+
pg_replication/exceptions.py,sha256=3A7u2KgVmKlgd3C4ie5Qv-GB5V49QuTXg1nJifnoFV4,115
|
|
25
|
+
pg_replication/helpers.py,sha256=Fuka7Fo9EWLQ5k7-HvRYW8cNxT55mCjA9V67cdXY0wk,69413
|
|
26
|
+
pg_replication/schema_types.py,sha256=boJkasFSMcmnA27_0QTRdS7P3o2b4XKBGxvdDowCUDM,5374
|
|
27
|
+
feather_cdc_postgres-0.1.0.dist-info/METADATA,sha256=j1imqqVtgYB1Bkxrmfp2Rkk2ggnsq6H9dp_WSTvzyzM,14085
|
|
28
|
+
feather_cdc_postgres-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
29
|
+
feather_cdc_postgres-0.1.0.dist-info/entry_points.txt,sha256=Wf0kbyRcT79PibXYN_LgGSDckCM6gOxwaf3TkqNtM2k,71
|
|
30
|
+
feather_cdc_postgres-0.1.0.dist-info/RECORD,,
|
pg_replication/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2023 The Contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|