@zukhruf/sqlite-changefeed 0.8.8 → 0.8.10
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.
- package/README.md +15 -5
- package/dist/batch.d.ts +18 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/batch.js +24 -0
- package/dist/batch.js.map +1 -0
- package/dist/change-event.d.ts +8 -1
- package/dist/change-event.d.ts.map +1 -1
- package/dist/changefeed.d.ts +10 -7
- package/dist/changefeed.d.ts.map +1 -1
- package/dist/changefeed.js +1 -1
- package/dist/changefeed.js.map +1 -1
- package/dist/column-hashes.d.ts +18 -0
- package/dist/column-hashes.d.ts.map +1 -0
- package/dist/column-hashes.js +51 -0
- package/dist/column-hashes.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/page-owners.d.ts +16 -0
- package/dist/page-owners.d.ts.map +1 -0
- package/dist/page-owners.js +56 -0
- package/dist/page-owners.js.map +1 -0
- package/dist/pass.d.ts.map +1 -1
- package/dist/pass.js +27 -6
- package/dist/pass.js.map +1 -1
- package/dist/position-file.d.ts +9 -5
- package/dist/position-file.d.ts.map +1 -1
- package/dist/position-file.js +52 -9
- package/dist/position-file.js.map +1 -1
- package/dist/position-in-memory.d.ts +8 -4
- package/dist/position-in-memory.d.ts.map +1 -1
- package/dist/position-in-memory.js +11 -4
- package/dist/position-in-memory.js.map +1 -1
- package/dist/position.d.ts +14 -3
- package/dist/position.d.ts.map +1 -1
- package/dist/table-changes.d.ts +2 -1
- package/dist/table-changes.d.ts.map +1 -1
- package/dist/table-changes.js +14 -4
- package/dist/table-changes.js.map +1 -1
- package/dist/tables.d.ts +2 -0
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +10 -3
- package/dist/tables.js.map +1 -1
- package/dist/touched-tables.d.ts +10 -0
- package/dist/touched-tables.d.ts.map +1 -0
- package/dist/touched-tables.js +31 -0
- package/dist/touched-tables.js.map +1 -0
- package/dist/wal-frames.d.ts +33 -0
- package/dist/wal-frames.d.ts.map +1 -0
- package/dist/wal-frames.js +75 -0
- package/dist/wal-frames.js.map +1 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ With `ReadEveryRow`, the first run gives a `read` event for each row of each tab
|
|
|
86
86
|
{ table: 'notes', op: 'read', key: { id: 1n }, after: { id: 1n, folder_id: 7n, title: 'Plan', body: '…' } }
|
|
87
87
|
{ table: 'tags', op: 'read', key: { rowid: 3n }, after: { note_id: 1n, tag: 'q4' } }
|
|
88
88
|
…
|
|
89
|
-
{ table: 'notes', op: 'update', key: { id: 1n }, after: { id: 1n, folder_id: 7n, title: 'Plan v2', body: '…' } }
|
|
89
|
+
{ table: 'notes', op: 'update', key: { id: 1n }, after: { id: 1n, folder_id: 7n, title: 'Plan v2', body: '…' }, changed: ['title'] }
|
|
90
90
|
{ table: 'tags', op: 'delete', key: { rowid: 3n } }
|
|
91
91
|
{ table: 'drafts', op: 'truncate' }
|
|
92
92
|
```
|
|
@@ -105,6 +105,7 @@ The table `tags` has no primary key, so its key is the `rowid`. The owner droppe
|
|
|
105
105
|
- `VACUUM` can change the `rowid` of each row of a table with no primary key. The feed compares the rows by `rowid`, so it then gives an event for each `rowid` whose row changed: an `insert` for a new `rowid`, an `update` for a `rowid` that now holds a different row, and a `delete` for a `rowid` that is gone. The SQLite documentation advises an `INTEGER PRIMARY KEY` for a stable `rowid`.
|
|
106
106
|
- A pass copies each row into a plain object, because `node:sqlite` gives rows with no prototype. `after` keeps the values that SQLite gives: a `bigint` for an `INTEGER`, a number for a `REAL`, a string, `null`, or a `Uint8Array` for a `BLOB`. A key value is a `bigint` for an `INTEGER` too, such as each `rowid`. [ADR 0008](./docs/adr/0008-every-integer-is-a-bigint.md) tells why.
|
|
107
107
|
- A change event is `{ table, op, key, after? }`, or `{ table, op: 'truncate' }`. `op` is `read`, `insert`, `update`, `delete` or `truncate`. `after` is the full row for `read`, `insert` and `update`. There is no `before`. [ADR 0003](./docs/adr/0003-the-change-event.md) tells why.
|
|
108
|
+
- An `update` also has `changed`: the columns whose values changed, never empty. The position keeps one 8-byte hash for each column of each row, so the feed can name them with no copy of the row. A new column, or a dropped one, is the change of each row of its table. Thus a host can tell a change of a state column, such as `is_read`, from a change of the content. [ADR 0009](./docs/adr/0009-an-update-names-its-changed-columns.md) tells why.
|
|
108
109
|
- `read` is each row of a table that the position does not have: each row at the first run, and each row of a new table.
|
|
109
110
|
- `truncate` tells that the owner dropped a table, or changed the columns of its primary key. Remove all rows of that table from your copy. When the primary key changed, a `read` for each row comes after the `truncate`.
|
|
110
111
|
- A change to the other columns of a table, for example a new column, changes the `after` of its rows. Each row then gives an `update`.
|
|
@@ -116,9 +117,9 @@ The table `tags` has no primary key, so its key is the `rowid`. The owner droppe
|
|
|
116
117
|
- `new ReadEveryRow()` gives each row as `read`.
|
|
117
118
|
- `new Baseline()` keeps the fingerprint of each row, and gives no events. The feed then gives only the changes after the baseline.
|
|
118
119
|
- After the first save, a table that the position does not have gives a `read` for each row, with each start. Thus a table that the owner creates after a baseline gives its rows.
|
|
119
|
-
- `watch({ interval, signal })` gives batches. A batch
|
|
120
|
+
- `watch({ interval, signal })` gives batches. A batch (`Batch`) holds the change events of one pass in `events`, and `for (const event of batch)` iterates them. The position sets the kind of the batch: a `PositionFile` gives a `SequencedBatch`, whose `sequence` is the number of the save that keeps it. A batch that comes again after a stop has the same `sequence`. A `PositionInMemory` gives a `Batch` with no `sequence`, because its numbers would not last past the run. [ADR 0010](./docs/adr/0010-a-batch-of-a-durable-position-has-a-sequence.md) tells why. The feed makes a first pass at once. Then it polls the data version each `interval` milliseconds, and makes a pass only when the data version changed. A pass that finds no change gives no batch, and the feed saves its position at once: for example, the key columns of a new table with no rows.
|
|
120
121
|
- A durable feed saves the position of a batch when the loop asks for the next batch. It writes the position in one transaction. Apply each event of a batch before the loop goes on.
|
|
121
|
-
- Delivery of a durable feed is at least once. If the process stops before the loop asks for the next batch, the next run gives the same batch again. A loop that stops with `break`, an error or an abort also gives its last batch again at the next run. Apply each event so that a second apply has no effect: a `put` by key, a `remove` by key, a `clear` by table.
|
|
122
|
+
- Delivery of a durable feed is at least once. If the process stops before the loop asks for the next batch, the next run gives the same batch again. A loop that stops with `break`, an error or an abort also gives its last batch again at the next run. Apply each event so that a second apply has no effect: a `put` by key, a `remove` by key, a `clear` by table. Or keep the `sequence` of the last batch that you applied in the transaction of your own work, and skip a batch whose `sequence` you have (an idempotent consumer).
|
|
122
123
|
- An abort of `signal` stops the poll, and the loop rejects with `signal.reason`.
|
|
123
124
|
- A pass holds its read transaction only while it reads. It closes the snapshot before it gives the batch. The poll holds no read transaction. [ADR 0005](./docs/adr/0005-one-snapshot-for-each-pass.md) tells why.
|
|
124
125
|
- Dispose closes the connections of the feed. Use `using`, or call `[Symbol.dispose]()`.
|
|
@@ -126,8 +127,9 @@ The table `tags` has no primary key, so its key is the `rowid`. The owner droppe
|
|
|
126
127
|
## Limits
|
|
127
128
|
|
|
128
129
|
- You see only the net change between two passes. A row that the owner inserts and deletes between two passes gives no event. A row that the owner changes two times gives one `update`.
|
|
129
|
-
-
|
|
130
|
-
-
|
|
130
|
+
- A pass reads only the tables whose b-tree pages the owner's WAL frames wrote since the last pass, when the WAL still holds all those frames. It finds the table of each page from the interior pages of the b-trees only, which it reads from the file and the WAL. Else it reads each table in full: at the first pass, after a reset of the WAL, when a frame wrote a page of the schema, or when the owner has no WAL. An owner that checkpoints its WAL when it closes its last connection, such as elt's SQLite destination at the end of each pass, leaves no frames, so its passes read each table. [ADR 0011](./docs/adr/0011-a-pass-reads-the-tables-that-the-wal-frames-wrote.md) tells why.
|
|
131
|
+
- A full pass reads each table in full. Its cost grows with the size of the database, also when the commit changed one row.
|
|
132
|
+
- The position keeps one 8-byte hash for each column of each row of each table. It grows with the number of rows and columns. A `PositionFile` keeps it on disk. A `PositionInMemory` keeps it in memory.
|
|
131
133
|
- A feed with a `PositionInMemory` does not see the changes that the owner made while no feed ran.
|
|
132
134
|
- A batch holds all the change events of one pass, with the full rows. A first run with `ReadEveryRow`, a new table, or a new primary key of a large table gives a large batch. A `Baseline` keeps no rows, only the fingerprints.
|
|
133
135
|
- Precedent for scale: Fivetran's Teleport Sync, which also compares data sets, gives a warning when more than 50,000 records change between two syncs.
|
|
@@ -176,6 +178,9 @@ This package needed four changes in other packages. All four are done:
|
|
|
176
178
|
- [0006 Every table, keyed by its primary key](./docs/adr/0006-every-table-keyed-by-its-primary-key.md)
|
|
177
179
|
- [0007 The host gives the position and the start](./docs/adr/0007-the-host-gives-the-position-and-the-start.md)
|
|
178
180
|
- [0008 Every integer is a bigint](./docs/adr/0008-every-integer-is-a-bigint.md)
|
|
181
|
+
- [0009 An update names its changed columns](./docs/adr/0009-an-update-names-its-changed-columns.md)
|
|
182
|
+
- [0010 A batch of a durable position has a sequence](./docs/adr/0010-a-batch-of-a-durable-position-has-a-sequence.md)
|
|
183
|
+
- [0011 A pass reads the tables that the WAL frames wrote](./docs/adr/0011-a-pass-reads-the-tables-that-the-wal-frames-wrote.md)
|
|
179
184
|
|
|
180
185
|
## Development
|
|
181
186
|
|
|
@@ -189,7 +194,12 @@ npx nx run sqlite-changefeed:typecheck # formats, lints, then type checks
|
|
|
189
194
|
```
|
|
190
195
|
src/
|
|
191
196
|
changefeed.ts Changefeed: the connections, the runs of watch, and the save of a batch
|
|
197
|
+
batch.ts Batch and SequencedBatch: the events of one pass
|
|
192
198
|
pass.ts one pass in one snapshot, and the WAL check
|
|
199
|
+
wal-frames.ts the frames of the owner's WAL since the saved progress
|
|
200
|
+
page-owners.ts the table of each b-tree page, from the interior pages
|
|
201
|
+
touched-tables.ts the tables that the new frames wrote
|
|
202
|
+
column-hashes.ts the hash of each column of a row, and the changed columns
|
|
193
203
|
tables.ts the tables of PRAGMA table_list, the key of each table, and its rows
|
|
194
204
|
table-changes.ts the change events of one table, and its snapshot with no events
|
|
195
205
|
position.ts Position, and what a pass changes in it
|
package/dist/batch.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChangeEvent } from './change-event.ts';
|
|
2
|
+
/** The change events of one pass. A loop iterates it as it iterates an array. */
|
|
3
|
+
export declare class Batch implements Iterable<ChangeEvent> {
|
|
4
|
+
readonly events: readonly ChangeEvent[];
|
|
5
|
+
constructor(events: readonly ChangeEvent[]);
|
|
6
|
+
[Symbol.iterator](): Iterator<ChangeEvent>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A batch of a durable position: its sequence is the number of the save that
|
|
10
|
+
* keeps it. A batch given again after a stop has the same sequence, so a host
|
|
11
|
+
* that keeps the last sequence it applied, in the transaction of its own
|
|
12
|
+
* work, applies each batch one time (an idempotent consumer).
|
|
13
|
+
*/
|
|
14
|
+
export declare class SequencedBatch extends Batch {
|
|
15
|
+
readonly sequence: number;
|
|
16
|
+
constructor(events: readonly ChangeEvent[], sequence: number);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../src/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,iFAAiF;AACjF,qBAAa,KAAM,YAAW,QAAQ,CAAC,WAAW,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;gBAE5B,MAAM,EAAE,SAAS,WAAW,EAAE;IAI1C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC;CAG3C;AAED;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM;CAI7D"}
|
package/dist/batch.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The change events of one pass. A loop iterates it as it iterates an array. */
|
|
2
|
+
export class Batch {
|
|
3
|
+
events;
|
|
4
|
+
constructor(events) {
|
|
5
|
+
this.events = events;
|
|
6
|
+
}
|
|
7
|
+
[Symbol.iterator]() {
|
|
8
|
+
return this.events[Symbol.iterator]();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A batch of a durable position: its sequence is the number of the save that
|
|
13
|
+
* keeps it. A batch given again after a stop has the same sequence, so a host
|
|
14
|
+
* that keeps the last sequence it applied, in the transaction of its own
|
|
15
|
+
* work, applies each batch one time (an idempotent consumer).
|
|
16
|
+
*/
|
|
17
|
+
export class SequencedBatch extends Batch {
|
|
18
|
+
sequence;
|
|
19
|
+
constructor(events, sequence) {
|
|
20
|
+
super(events);
|
|
21
|
+
this.sequence = sequence;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.js","sourceRoot":"","sources":["../src/batch.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,OAAO,KAAK;IACP,MAAM,CAAyB;IAExC,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACxC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,QAAQ,CAAS;IAE1B,YAAY,MAA8B,EAAE,QAAgB;QAC1D,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/change-event.d.ts
CHANGED
|
@@ -4,9 +4,16 @@ export type Key = Readonly<Record<string, KeyValue>>;
|
|
|
4
4
|
export type Row = Readonly<Record<string, SQLOutputValue>>;
|
|
5
5
|
export type ChangeEvent = {
|
|
6
6
|
readonly table: string;
|
|
7
|
-
readonly op: 'read' | 'insert'
|
|
7
|
+
readonly op: 'read' | 'insert';
|
|
8
8
|
readonly key: Key;
|
|
9
9
|
readonly after: Row;
|
|
10
|
+
} | {
|
|
11
|
+
readonly table: string;
|
|
12
|
+
readonly op: 'update';
|
|
13
|
+
readonly key: Key;
|
|
14
|
+
readonly after: Row;
|
|
15
|
+
/** The columns whose values changed: never empty. */
|
|
16
|
+
readonly changed: readonly [string, ...string[]];
|
|
10
17
|
} | {
|
|
11
18
|
readonly table: string;
|
|
12
19
|
readonly op: 'delete';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-event.d.ts","sourceRoot":"","sources":["../src/change-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGrD,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAI3D,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"change-event.d.ts","sourceRoot":"","sources":["../src/change-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGrD,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAI3D,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;CACrB,GACD;IACE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IACpB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAClD,GACD;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;CAAE,GACpE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;CAAE,CAAC"}
|
package/dist/changefeed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type WallClock } from '@zukhruf/async';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Batch } from './batch.ts';
|
|
3
3
|
import type { Position } from './position.ts';
|
|
4
4
|
import type { Start } from './start.ts';
|
|
5
5
|
export type WatchOptions = {
|
|
@@ -10,9 +10,12 @@ export type WatchOptions = {
|
|
|
10
10
|
/** The clock of the poll: `globalThis` in production, a fake clock in a test. */
|
|
11
11
|
readonly clock: WallClock;
|
|
12
12
|
};
|
|
13
|
-
export type ChangefeedOptions = {
|
|
14
|
-
/**
|
|
15
|
-
|
|
13
|
+
export type ChangefeedOptions<B extends Batch = Batch> = {
|
|
14
|
+
/**
|
|
15
|
+
* Where the feed keeps what it saw. The feed owns it, and disposes it. Its
|
|
16
|
+
* kind sets the batches: a PositionFile gives a SequencedBatch.
|
|
17
|
+
*/
|
|
18
|
+
readonly position: Position<B>;
|
|
16
19
|
/** What the first pass gives, until the position is saved once. */
|
|
17
20
|
readonly start: Start;
|
|
18
21
|
};
|
|
@@ -20,14 +23,14 @@ export type ChangefeedOptions = {
|
|
|
20
23
|
* A change event for each changed row of each table of a SQLite database
|
|
21
24
|
* that another process owns.
|
|
22
25
|
*/
|
|
23
|
-
export declare class Changefeed implements Disposable {
|
|
26
|
+
export declare class Changefeed<B extends Batch = Batch> implements Disposable {
|
|
24
27
|
#private;
|
|
25
|
-
constructor(databasePath: string, { position, start }: ChangefeedOptions);
|
|
28
|
+
constructor(databasePath: string, { position, start }: ChangefeedOptions<B>);
|
|
26
29
|
/**
|
|
27
30
|
* Batches of change events. The feed saves the position of a batch when
|
|
28
31
|
* the loop asks for the next one.
|
|
29
32
|
*/
|
|
30
|
-
watch({ interval, signal, clock, }: WatchOptions): AsyncGenerator<
|
|
33
|
+
watch({ interval, signal, clock, }: WatchOptions): AsyncGenerator<B, void, undefined>;
|
|
31
34
|
[Symbol.dispose](): void;
|
|
32
35
|
}
|
|
33
36
|
//# sourceMappingURL=changefeed.d.ts.map
|
package/dist/changefeed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changefeed.d.ts","sourceRoot":"","sources":["../src/changefeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI/D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"changefeed.d.ts","sourceRoot":"","sources":["../src/changefeed.ts"],"names":[],"mappings":"AAA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
|
2
|
+
/**
|
|
3
|
+
* The fingerprint of a row: one hash for each column, in the order of the
|
|
4
|
+
* table's columns, so an update can name the columns whose values changed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function columnHashes(after: Row, columns: readonly string[]): string;
|
|
7
|
+
/** The hashes of a row with the column names that they are in the order of. */
|
|
8
|
+
export type ColumnHashes = {
|
|
9
|
+
readonly hashes: string;
|
|
10
|
+
readonly columns: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The columns whose hashes differ between two fingerprints of one row, also a
|
|
14
|
+
* column that only one of them has. Two fingerprints that differ always name
|
|
15
|
+
* at least one column.
|
|
16
|
+
*/
|
|
17
|
+
export declare function changedColumns(saved: ColumnHashes, current: ColumnHashes): readonly [string, ...string[]];
|
|
18
|
+
//# sourceMappingURL=column-hashes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-hashes.d.ts","sourceRoot":"","sources":["../src/column-hashes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAM7C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAW3E;AAED,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,YAAY,GACpB,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAahC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { hash } from 'node:crypto';
|
|
2
|
+
// Each hash is the first 8 bytes of a SHA-256: a changed column goes unseen
|
|
3
|
+
// only with a chance of 2^-64.
|
|
4
|
+
const width = 8;
|
|
5
|
+
/**
|
|
6
|
+
* The fingerprint of a row: one hash for each column, in the order of the
|
|
7
|
+
* table's columns, so an update can name the columns whose values changed.
|
|
8
|
+
*/
|
|
9
|
+
export function columnHashes(after, columns) {
|
|
10
|
+
const hashes = Buffer.allocUnsafe(width * columns.length);
|
|
11
|
+
columns.forEach((column, at) => hash('sha256', canonical(after[column]), 'buffer').copy(hashes, at * width, 0, width));
|
|
12
|
+
return hashes.toString('base64url');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The columns whose hashes differ between two fingerprints of one row, also a
|
|
16
|
+
* column that only one of them has. Two fingerprints that differ always name
|
|
17
|
+
* at least one column.
|
|
18
|
+
*/
|
|
19
|
+
export function changedColumns(saved, current) {
|
|
20
|
+
const before = byColumn(saved);
|
|
21
|
+
const after = byColumn(current);
|
|
22
|
+
const changed = [
|
|
23
|
+
...current.columns.filter((column) => before.get(column) !== after.get(column)),
|
|
24
|
+
...saved.columns.filter((column) => !after.has(column)),
|
|
25
|
+
];
|
|
26
|
+
const [first, ...rest] = changed;
|
|
27
|
+
if (first === undefined)
|
|
28
|
+
throw new TypeError('An update changed no column of its row');
|
|
29
|
+
return [first, ...rest];
|
|
30
|
+
}
|
|
31
|
+
function byColumn({ hashes, columns }) {
|
|
32
|
+
const bytes = Buffer.from(hashes, 'base64url');
|
|
33
|
+
return new Map(columns.map((column, at) => [
|
|
34
|
+
column,
|
|
35
|
+
bytes.subarray(at * width, (at + 1) * width).toString('hex'),
|
|
36
|
+
]));
|
|
37
|
+
}
|
|
38
|
+
// One text for each value that SQLite gives, with no two values alike: a
|
|
39
|
+
// string is its JSON, a bigint has n, bytes have # and base64url.
|
|
40
|
+
function canonical(value) {
|
|
41
|
+
if (value === undefined || value === null)
|
|
42
|
+
return 'null';
|
|
43
|
+
if (typeof value === 'bigint')
|
|
44
|
+
return `${value}n`;
|
|
45
|
+
if (typeof value === 'number')
|
|
46
|
+
return Object.is(value, -0) ? '-0' : `${value}`;
|
|
47
|
+
if (typeof value === 'string')
|
|
48
|
+
return JSON.stringify(value);
|
|
49
|
+
return `#${Buffer.from(value).toString('base64url')}`;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=column-hashes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-hashes.js","sourceRoot":"","sources":["../src/column-hashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAInC,4EAA4E;AAC5E,+BAA+B;AAC/B,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,OAA0B;IACjE,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAC7B,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CACrD,MAAM,EACN,EAAE,GAAG,KAAK,EACV,CAAC,EACD,KAAK,CACN,CACF,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAQD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAmB,EACnB,OAAqB;IAErB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG;QACd,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CACvB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CACrD;QACD,GAAG,KAAK,C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,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Baseline } from './baseline.ts';
|
|
2
|
+
export { Batch, SequencedBatch } from './batch.ts';
|
|
2
3
|
export type { ChangeEvent, Key, Row } from './change-event.ts';
|
|
3
4
|
export { Changefeed, type ChangefeedOptions, type WatchOptions, } from './changefeed.ts';
|
|
4
5
|
export { JournalModeError } from './journal-mode-error.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EACL,UAAU,GAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChangedPages } from './wal-frames.ts';
|
|
2
|
+
/** A b-tree of the database: the table it belongs to and its root page. */
|
|
3
|
+
export type BTree = {
|
|
4
|
+
readonly table: string;
|
|
5
|
+
readonly rootpage: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The table of each page of the b-trees, by their interior pages only: each
|
|
9
|
+
* page of one level of a b-tree has the type of that level, so a walk reads
|
|
10
|
+
* one child to know a level of leaves, and lists the leaves unread. For the
|
|
11
|
+
* Mail import of Context Compiler (1,038,283 pages) it reads 1,452 pages in
|
|
12
|
+
* about 100 ms. A page that the WAL holds is read from its newest frame.
|
|
13
|
+
* Overflow and free pages belong to no b-tree, and have no table here.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pageOwners(databasePath: string, btrees: readonly BTree[], changed: ChangedPages): ReadonlyMap<number, string>;
|
|
16
|
+
//# sourceMappingURL=page-owners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-owners.d.ts","sourceRoot":"","sources":["../src/page-owners.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,MAAM,KAAK,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAK1E;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,EAAE,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CA8C7B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { closeSync, openSync, readSync } from 'node:fs';
|
|
2
|
+
const interiorTable = 0x05;
|
|
3
|
+
const interiorIndex = 0x02;
|
|
4
|
+
/**
|
|
5
|
+
* The table of each page of the b-trees, by their interior pages only: each
|
|
6
|
+
* page of one level of a b-tree has the type of that level, so a walk reads
|
|
7
|
+
* one child to know a level of leaves, and lists the leaves unread. For the
|
|
8
|
+
* Mail import of Context Compiler (1,038,283 pages) it reads 1,452 pages in
|
|
9
|
+
* about 100 ms. A page that the WAL holds is read from its newest frame.
|
|
10
|
+
* Overflow and free pages belong to no b-tree, and have no table here.
|
|
11
|
+
*/
|
|
12
|
+
export function pageOwners(databasePath, btrees, changed) {
|
|
13
|
+
const database = openSync(databasePath, 'r');
|
|
14
|
+
const wal = openSync(`${databasePath}-wal`, 'r');
|
|
15
|
+
try {
|
|
16
|
+
const page = Buffer.alloc(changed.pageSize);
|
|
17
|
+
const read = (pgno) => {
|
|
18
|
+
const frame = changed.newest.get(pgno);
|
|
19
|
+
if (frame === undefined)
|
|
20
|
+
readSync(database, page, 0, changed.pageSize, (pgno - 1) * changed.pageSize);
|
|
21
|
+
else
|
|
22
|
+
readSync(wal, page, 0, changed.pageSize, frame);
|
|
23
|
+
// Page 1 starts with the 100-byte header of the database file.
|
|
24
|
+
const header = pgno === 1 ? 100 : 0;
|
|
25
|
+
return { header, type: page[header] };
|
|
26
|
+
};
|
|
27
|
+
const owners = new Map();
|
|
28
|
+
for (const { table, rootpage } of btrees) {
|
|
29
|
+
for (let level = [rootpage];;) {
|
|
30
|
+
const [first] = level;
|
|
31
|
+
if (first === undefined)
|
|
32
|
+
break;
|
|
33
|
+
for (const pgno of level)
|
|
34
|
+
owners.set(pgno, table);
|
|
35
|
+
const { type } = read(first);
|
|
36
|
+
if (type !== interiorTable && type !== interiorIndex)
|
|
37
|
+
break;
|
|
38
|
+
const next = [];
|
|
39
|
+
for (const pgno of level) {
|
|
40
|
+
const { header } = read(pgno);
|
|
41
|
+
next.push(page.readUInt32BE(header + 8));
|
|
42
|
+
const cells = page.readUInt16BE(header + 3);
|
|
43
|
+
for (let cell = 0; cell < cells; cell++)
|
|
44
|
+
next.push(page.readUInt32BE(page.readUInt16BE(header + 12 + 2 * cell)));
|
|
45
|
+
}
|
|
46
|
+
level = next;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return owners;
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
closeSync(database);
|
|
53
|
+
closeSync(wal);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=page-owners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-owners.js","sourceRoot":"","sources":["../src/page-owners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOxD,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,YAAoB,EACpB,MAAwB,EACxB,OAAqB;IAErB,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,YAAY,MAAM,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE;YAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACvC,IAAI,KAAK,KAAK,SAAS;g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KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBAC5C,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE;wBACrC,IAAI,CAAC,IAAI,CACP,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAC7D,CAAC;gBACN,CAAC;gBACD,KAAK,GAAG,IAAI,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpB,SAAS,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/pass.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pass.d.ts","sourceRoot":"","sources":["../src/pass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAiB,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pass.d.ts","sourceRoot":"","sources":["../src/pass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAiB,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAaxC,wBAAsB,IAAI,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC;IAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC,CAkD5D;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAKnD"}
|
package/dist/pass.js
CHANGED
|
@@ -2,33 +2,54 @@ import { Snapshot } from '@zukhruf/sqlite-snapshot';
|
|
|
2
2
|
import { JournalModeError } from "./journal-mode-error.js";
|
|
3
3
|
import { tableChanges } from "./table-changes.js";
|
|
4
4
|
import { tablesOf } from "./tables.js";
|
|
5
|
-
|
|
5
|
+
import { touchedTables } from "./touched-tables.js";
|
|
6
|
+
import { walFrames } from "./wal-frames.js";
|
|
7
|
+
// A pass reads the tables in one snapshot, and compares them with the
|
|
6
8
|
// position. It holds the snapshot only while it reads. Until the position is
|
|
7
|
-
// saved once, the start gives what each table gives.
|
|
9
|
+
// saved once, the start gives what each table gives. After that, when the
|
|
10
|
+
// owner's WAL still holds every frame since the last pass, a pass reads only
|
|
11
|
+
// the tables that those frames wrote; else it reads each table. The frames
|
|
12
|
+
// are read before the snapshot, so a commit after them is in the snapshot or
|
|
13
|
+
// in the frames of the next pass.
|
|
8
14
|
export async function pass(path, position, start) {
|
|
15
|
+
const first = !position.started();
|
|
16
|
+
const frames = walFrames(path, first ? null : position.wal());
|
|
9
17
|
using snapshot = new Snapshot(path);
|
|
10
18
|
requireWal(snapshot);
|
|
11
|
-
const
|
|
19
|
+
const touched = frames.changed === null
|
|
20
|
+
? null
|
|
21
|
+
: touchedTables(path, snapshot, frames.changed, frames.progress.salt);
|
|
12
22
|
const known = position.keyColumns();
|
|
13
23
|
const events = [];
|
|
14
24
|
const tables = new Map();
|
|
15
25
|
const current = tablesOf(snapshot);
|
|
16
26
|
for (const table of current) {
|
|
17
27
|
const keyColumns = known.get(table.name);
|
|
28
|
+
// No frame wrote the table, and its shape is the one the position has.
|
|
29
|
+
if (touched !== null &&
|
|
30
|
+
keyColumns !== undefined &&
|
|
31
|
+
!touched.has(table.name))
|
|
32
|
+
continue;
|
|
18
33
|
const same = keyColumns !== undefined &&
|
|
19
34
|
JSON.stringify(keyColumns) === JSON.stringify(table.keyColumns);
|
|
20
35
|
if (keyColumns !== undefined && !same)
|
|
21
36
|
events.push({ table: table.name, op: 'truncate' });
|
|
37
|
+
const saved = same ? position.table(table.name) : null;
|
|
22
38
|
const changes = first
|
|
23
39
|
? await start.table(table)
|
|
24
|
-
: await tableChanges(table,
|
|
40
|
+
: await tableChanges(table, saved);
|
|
25
41
|
// One push for each event: a spread of a large table's events into one
|
|
26
42
|
// call overflows the stack.
|
|
27
43
|
for (const event of changes.events)
|
|
28
44
|
events.push(event);
|
|
29
|
-
|
|
45
|
+
// A table with other columns is saved also when it has no row, so the
|
|
46
|
+
// next update compares its hashes with the right columns.
|
|
47
|
+
const sameColumns = saved !== null &&
|
|
48
|
+
JSON.stringify(saved.columns) === JSON.stringify(table.columns);
|
|
49
|
+
if (!same || !sameColumns || changes.events.length > 0)
|
|
30
50
|
tables.set(table.name, {
|
|
31
51
|
keyColumns: table.keyColumns,
|
|
52
|
+
columns: table.columns,
|
|
32
53
|
state: changes.state,
|
|
33
54
|
});
|
|
34
55
|
}
|
|
@@ -36,7 +57,7 @@ export async function pass(path, position, start) {
|
|
|
36
57
|
const dropped = [...known.keys()].filter((table) => !names.has(table));
|
|
37
58
|
for (const table of dropped)
|
|
38
59
|
events.push({ table, op: 'truncate' });
|
|
39
|
-
return { events, update: { tables, dropped } };
|
|
60
|
+
return { events, update: { tables, dropped, wal: frames.progress } };
|
|
40
61
|
}
|
|
41
62
|
// The owner can replace the file, and the new file can have another mode.
|
|
42
63
|
export function requireWal(snapshot) {
|
package/dist/pass.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pass.js","sourceRoot":"","sources":["../src/pass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,M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C,YAAY,CAAC,CAAC;IACtC,IAAI,IAAI,KAAK,KAAK;QAAE,MAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/position-file.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import { SequencedBatch } from './batch.ts';
|
|
2
|
+
import type { ChangeEvent } from './change-event.ts';
|
|
3
|
+
import type { Position, PositionUpdate, TablePosition } from './position.ts';
|
|
4
|
+
import type { WalProgress } from './wal-frames.ts';
|
|
3
5
|
/**
|
|
4
6
|
* A position in a SQLite file of the feed, at the path that the host gives:
|
|
5
7
|
* the key columns of each table and one fingerprint for each (table, key). A
|
|
6
8
|
* new run of a feed goes on from it. A missing or empty file is a position
|
|
7
9
|
* that no pass saved.
|
|
8
10
|
*/
|
|
9
|
-
export declare class PositionFile implements Position {
|
|
11
|
+
export declare class PositionFile implements Position<SequencedBatch> {
|
|
10
12
|
#private;
|
|
11
13
|
constructor(path: string);
|
|
14
|
+
batch(events: readonly ChangeEvent[]): SequencedBatch;
|
|
12
15
|
started(): boolean;
|
|
16
|
+
wal(): WalProgress | null;
|
|
13
17
|
keyColumns(): ReadonlyMap<string, readonly string[]>;
|
|
14
|
-
|
|
15
|
-
save({ tables, dropped }: PositionUpdate): void;
|
|
18
|
+
table(table: string): TablePosition;
|
|
19
|
+
save({ tables, dropped, wal }: PositionUpdate): void;
|
|
16
20
|
[Symbol.dispose](): void;
|
|
17
21
|
}
|
|
18
22
|
//# sourceMappingURL=position-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position-file.d.ts","sourceRoot":"","sources":["../src/position-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"position-file.d.ts","sourceRoot":"","sources":["../src/position-file.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,QAAQ,CAAC,cAAc,CAAC;;gBAG/C,IAAI,EAAE,MAAM;IA2BxB,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,cAAc;IAIrD,OAAO,IAAI,OAAO;IAIlB,GAAG,IAAI,WAAW,GAAG,IAAI;IAUzB,UAAU,IAAI,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAYpD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IA2BnC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,IAAI;IAkDpD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
|