Commit 45544bd
committed
libsql-sqlite3: Add libsql_wal_get_frame() API
This patch adds a libsql_wal_get_frame() API to read the raw WAL frame
from a database.
You can use the API as follows (omitting error handling) to obtain all
the WAL frames in a database:
```c
static int sync_db(sqlite3 *db_primary, sqlite3 *db_backup){
unsigned int max_frame;
libsql_wal_frame_count(db_primary, &max_frame);
for(int i=1; i<=max_frame; i++){
char frame[4096+24];
libsql_wal_get_frame(db_primary, i, frame, sizeof(frame));
}
}
```1 parent 61558b2 commit 45544bd
4 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2475 | 2475 | | |
2476 | 2476 | | |
2477 | 2477 | | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
2478 | 2507 | | |
2479 | 2508 | | |
2480 | 2509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7784 | 7784 | | |
7785 | 7785 | | |
7786 | 7786 | | |
| 7787 | + | |
| 7788 | + | |
| 7789 | + | |
| 7790 | + | |
| 7791 | + | |
| 7792 | + | |
| 7793 | + | |
| 7794 | + | |
| 7795 | + | |
| 7796 | + | |
| 7797 | + | |
| 7798 | + | |
| 7799 | + | |
| 7800 | + | |
| 7801 | + | |
7787 | 7802 | | |
7788 | 7803 | | |
7789 | 7804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10573 | 10573 | | |
10574 | 10574 | | |
10575 | 10575 | | |
| 10576 | + | |
| 10577 | + | |
| 10578 | + | |
| 10579 | + | |
| 10580 | + | |
| 10581 | + | |
| 10582 | + | |
| 10583 | + | |
| 10584 | + | |
| 10585 | + | |
| 10586 | + | |
10576 | 10587 | | |
10577 | 10588 | | |
10578 | 10589 | | |
| |||
0 commit comments