Pere Diaz Bou
081f09ce20
fix read wal max frame
2025-06-30 10:16:44 +02:00
Pere Diaz Bou
486c4b69fb
WAL record db_size frame on commit last frame
...
`db_size` is `>0` in case of last frame written of a transaction. This
is necessary as we need to know -- while recovering wal contents -- that
we have read a transaction fully instead of treating every frame as its
own transaction.
2025-06-27 16:21:48 +02:00
pedrocarlo
bac5e4b563
refactor File and Database Storage to remove Arc<Connection> and return Arc<Connection> for caller to wait for completion
2025-06-26 22:17:28 -03:00
pedrocarlo
64d9193e7b
refactor Completion to have a type field and lift common is_complete property
2025-06-26 22:17:27 -03:00
Jussi Saurio
480f0a04b5
make clippy happy about mutating database_size immediately after default construction
2025-06-24 14:41:50 -03:00
Jussi Saurio
f21cde9501
post-rebase fixes
2025-06-24 14:41:50 -03:00
Jussi Saurio
133d498724
Implement a header_accessor module so that DatabaseHeader structs arent initialized on every access
2025-06-24 14:41:50 -03:00
Jussi Saurio
ba3bfa058d
Delete unused stuff
2025-06-24 14:41:50 -03:00
Diego Reis
f0f9ad4844
core: Get rid of maybe_init_database_file
...
Initialization now only occurs in the first write transaction
2025-06-24 14:41:50 -03:00
Diego Reis
2f33c799e3
core: Set default database_size to 0
2025-06-24 14:41:49 -03:00
Jussi Saurio
cc2e14b11c
Read page 1 from pager always, no separate db_header
2025-06-24 14:41:49 -03:00
Nils Koch
2827b86917
chore: fix clippy warnings
2025-06-23 19:52:13 +01:00
pedrocarlo
8dbf09bb42
betters instrumentation for btree operations
2025-06-11 23:34:32 -03:00
Jussi Saurio
d81f5f67bd
insert spaghetti fixes
2025-06-10 14:16:26 +03:00
Pere Diaz Bou
77b6896eae
implement lazy record and rowid in cursor
...
This also comments save_context for now
2025-06-10 14:16:26 +03:00
Zaid Humayun
6e87761a34
Addresses comment https://github.com/tursodatabase/limbo/pull/1600#discussion_r2115842804 by @jussisaurio
...
this commit adds an assert into ptrmap_page_cycle_length
2025-06-06 23:14:25 +05:30
Zaid Humayun
5827a33517
Beginnings of AUTOVACUUM
...
This commit introduces AUTOVACUUM to Limbo. It introduces the concept of ptrmap pages and also adds some additional instructions that are required to make AUTOVACUUM PRAGMA work
2025-06-06 23:14:22 +05:30
meteorgan
a242bac340
Fix: ensure PRAGMA cache_size changes persist only for current session
2025-06-05 16:55:41 +08:00
Jussi Saurio
2087393d22
Merge 'Write database header via normal pager route' from meteorgan
...
Closes : #1613
Closes #1634
2025-06-04 09:39:14 +03:00
Diego Reis
09f978b239
core: Tagging some comments as TODO
2025-06-03 15:09:16 -03:00
meteorgan
f2bf6251cd
write database header via normal pager route
2025-06-03 22:06:08 +08:00
Diego Reis
16c81f471b
core/ondisk: Stop reading WAL file if a frame mismatch salt value with header
...
The salts values in the WAL header are (re)generated in every checkpoint (but in PASSIVE mode), so if we find a frame with mismatch it means it's a leftover from a previous checkpoint.
2025-06-02 23:14:51 -03:00
Pere Diaz Bou
da4190a23e
Convert u64 rowid to i64
...
Rowids can be negative, therefore let's swap to i64
2025-05-30 13:07:31 +02:00
Pekka Enberg
59d28eac93
core: Switch Completion "is_completed" to use Cell
...
Suggested by Jussi
2025-05-27 14:05:07 +03:00
Pekka Enberg
3250560eb8
sqlite3: Add libsql_wal_get_frame() API
2025-05-27 13:47:40 +03:00
Pekka Enberg
05df548b10
core/io: Add wait_for_completion() to I/O dispatcher
2025-05-27 13:47:40 +03:00
Pekka Enberg
eca9a5b703
core/io: Switch to Arc<Completion>
2025-05-27 11:28:49 +03:00
Pekka Enberg
21535018aa
core: Don't pass page to begin_read_wal_frame()
...
Make `begin_read_wal_frame()` a bit more generic by not requiring a page
to be passed.
2025-05-27 10:02:36 +03:00
Jussi Saurio
b5ac095716
Fix off-by-one error in max_frame after WAL load
2025-05-25 19:34:51 +03:00
Jussi Saurio
64ef3f1343
simplify condition
2025-05-25 10:22:46 +03:00
Jussi Saurio
fc45e0ec0d
Reconstruct WAL frame cache when WAL is opened
...
Currently we are simply unable to read any WAL frames from disk
once a fresh process w/ Limbo is opened, since we never try to read
anything from disk unless we already have it in our in-memory
frame cache.
This commit implements a crude way of reading entire WAL into memory
as a single buffer and reconstructing the frame cache.
2025-05-24 18:29:44 +03:00
Diego Reis
2f8042da22
core/pragma: Add support for update user_version
...
It also changes the type from u32 to i32 since
sqlite supports negative values
2025-05-22 20:38:27 -03:00
Pekka Enberg
e3f71259d8
Rename OwnedValue -> Value
...
We have not had enough merge conflicts for a while so let's do a
tree-wide rename.
2025-05-15 09:59:46 +03:00
Jussi Saurio
6096cfb3d8
Merge 'Add PRAGMA schema_version' from Anton Harniakou
...
This PR adds `PRAGMA schema_version` to get the value of the schema-
version integer at offset 40 in the database header.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #1427
2025-05-01 10:50:02 +03:00
Anton Harniakou
525b7fdbaa
Add PRAGMA schema_version
2025-04-30 09:41:04 +03:00
meteorgan
d2dce740f7
fix some issues about page_size
2025-04-28 16:13:07 +08:00
Jussi Saurio
75c6678a06
sqlite3_ondisk: use debug asserts for cell_table_interior_read... funcs
2025-04-26 14:50:42 +03:00
Jussi Saurio
23ae5a27c4
btree/tablebtree_move_to: micro-optimizations
2025-04-26 11:32:24 +03:00
Jussi Saurio
3553d05c32
Merge 'Give name to hard-coded page_size values' from Anton Harniakou
...
Related to #1379
I guess there are more hard-coded values.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #1404
2025-04-25 22:03:43 +03:00
Anton Harniakou
dd7c0ad1c8
Give name to hard-coded page_size values
2025-04-25 14:15:15 +03:00
Jussi Saurio
7921d7c2e0
types: refactor serialtype again to make it faster
2025-04-24 17:28:31 +03:00
Jussi Saurio
04adf8242a
faster validate
2025-04-24 16:05:12 +03:00
Jussi Saurio
af6a783f4d
core/types: remove duplicate serialtype implementation
2025-04-24 15:38:47 +03:00
Jussi Saurio
017cdb9568
btree: avoid reading entire cell when only rowid needed
2025-04-18 16:52:05 +03:00
Jussi Saurio
f79da7194f
implement Iterator for SmallVec and add const generic for array size
2025-04-14 11:23:37 +03:00
Pekka Enberg
53633e8b6f
core/btree: Add PageContent::new() helper
2025-04-10 13:14:38 +03:00
Pere Diaz Bou
d9453f6e06
fix cell_get_raw_region length calculation
2025-04-09 15:04:45 +02:00
TcMits
56fa9049c3
fix: overflow pos in write_page
2025-04-03 15:02:53 +07:00
Pere Diaz Bou
2a49fe9bd2
Remove RWLock from Shared wal state
...
WalShared state can be shared without having to wrap everything with a
lock, and instead use atomics on some places and rwlock on others -- for
now.
## Results:
From:
----
Execute `SELECT 1`/limbo_execute_select_1
time: [34.125 ns 34.218 ns 34.324 ns]
Execute `SELECT 1`/sqlite_execute_select_1
time: [28.124 ns 28.254 ns 28.385 ns]
To:
----
Gnuplot not found, using plotters backend
Execute `SELECT 1`/limbo_execute_select_1
time: [31.919 ns 32.113 ns 32.327 ns]
Execute `SELECT 1`/sqlite_execute_select_1
time: [29.662 ns 29.900 ns 30.139 ns]
2025-04-02 16:18:36 +02:00
Pere Diaz Bou
8d74f4b8ab
remove unnecessary partial ord
2025-03-30 11:07:23 +02:00