Commit Graph

429 Commits

Author SHA1 Message Date
Pekka Enberg
a290b2f102 core: Open WAL file and parse header 2024-08-03 12:48:16 +03:00
Pekka Enberg
ed4116e7c2 core: Introduce Wal trait
We're going to need it for WebAssembly anyway, which does not have
standard filesystem support.
2024-08-03 12:34:10 +03:00
Pekka Enberg
18883b5a7e core: Document top-level storage module 2024-08-03 10:44:19 +03:00
Pekka Enberg
090a577dd5 core: Move DatabaseStorage to storage/database.rs 2024-08-03 10:41:10 +03:00
Pekka Enberg
83650a797a core: Document DatabaseStorage purpose 2024-08-03 10:37:41 +03:00
Pekka Enberg
3f7c788e5b core: Rename DatabaseStorage methods
Let's call them read_page() and write_page().
2024-08-03 10:35:14 +03:00
Pekka Enberg
8a54e31803 core: Rename PageIO to DatabaseStorage 2024-08-03 10:33:52 +03:00
Pekka Enberg
4349b946e5 core: Eliminate PageSource wrapper
The PageSource wrapper is useless. Let's inline it and use PageIO
directly.
2024-08-03 10:27:20 +03:00
Lauri Virtanen
145af04c7e Fix serial type decoding for BLOB and TEXT
Replace `>` with `>=` to match the SQLite documentation. Serial type
value `12` is for 0-size BLOB, and `13` is for 0-size TEXT.
2024-08-02 21:50:50 +03:00
Pekka Enberg
0affdada2a core: Move datetime.rs to vdbe/
The file contains SQL functions invoked by the VDBE so let's move the
file there.
2024-08-02 17:34:10 +03:00
Pekka Enberg
9c479734be core: Rename to exec_time()
Follow the same naming convention as other SQL functions.
2024-08-02 17:34:10 +03:00
Pekka Enberg
465dfa3cb5 core: Rename to exec_date()
Follow the same naming convention as other SQL functions.
2024-08-02 17:34:10 +03:00
Pekka Enberg
69eb851120 core/datetime: Move get_max_datetime_exclusive() to bottom
Move the function so that it's callers are above the function definition
for smoother flow when reading the code.
2024-08-02 16:15:22 +03:00
Pekka Enberg
6ffb03216f core/datetime: Simplify error handling 2024-08-02 16:15:22 +03:00
Pekka Enberg
3412b65b8a core/datetime: Remove TimeUnit
...it's not used for anything much.
2024-08-02 16:04:09 +03:00
Pekka Enberg
763bf17c9e core/datetime: Use "cfg(test)" annotation for tests 2024-08-02 16:03:53 +03:00
Pekka Enberg
f8492c85ae core/datetime: Remove trace calls
We should trace in high-level code like VDBE interpreter loop, but not
in error handling path of specific SQL functions.
2024-08-02 16:03:46 +03:00
jussisaurio
20c085614f Add ability to annotate instructions with comments 2024-08-01 20:34:45 +03:00
jussisaurio
02cae50324 use move_to() in btree_seek_rowid() 2024-08-01 18:32:01 +03:00
jussisaurio
f344e07868 extract method 2024-08-01 17:54:29 +03:00
jussisaurio
7e88ad64da Rename and comment 2024-08-01 17:53:21 +03:00
jussisaurio
f46b13690f augment comment 2024-08-01 17:47:13 +03:00
jussisaurio
6860329940 rename and add comments 2024-08-01 17:45:40 +03:00
jussisaurio
81c2f2eca6 Add comment 2024-08-01 17:40:39 +03:00
jussisaurio
583fe31667 rebase fix 2024-08-01 17:26:00 +03:00
jussisaurio
551b11303f Broaden the type of expr that qualifies as seekrowid candidate 2024-08-01 17:23:59 +03:00
jussisaurio
64f7e48f1b Cleanup 2024-08-01 17:23:59 +03:00
jussisaurio
8feb443048 Use SeekRowid instruction on expr1 = expr2 constraints if they contain primary keys 2024-08-01 17:23:59 +03:00
jussisaurio
97dfae437c SeekRowid VM instruction 2024-08-01 17:23:59 +03:00
jussisaurio
d965998cdf btree_seek_rowid() implementation 2024-08-01 17:23:59 +03:00
Pekka Enberg
0bf12ec1b3 core: Move buffer_pool.rs to storage module 2024-08-01 11:53:14 +03:00
Pekka Enberg
ed1c23bfe6 core: Move wal.rs to storage module 2024-08-01 11:52:50 +03:00
Pekka Enberg
f8a43361db core: Move pager.rs to storage module 2024-08-01 11:52:50 +03:00
Pekka Enberg
7abc48303f core: Move btree.rs to storage module 2024-08-01 11:52:50 +03:00
Pekka Enberg
307cd71b11 core: Rename storage.rs to storage/mod.rs
Prepare for moving more code under storage module.
2024-08-01 11:52:50 +03:00
Pekka Enberg
957cc383c8 core: Fix module documentation format in sqlite3_ondisk.rs 2024-08-01 11:52:18 +03:00
Pekka Enberg
73bdf1671f Initial pass on WAL reader
These are mostly just stubs for now, but at least we have some code in
place as reminder what we need.
2024-08-01 11:31:17 +03:00
Pekka Enberg
e88e57f9ba Merge 'Random clippy cleanups' from Pekka Enberg
Closes #253
2024-08-01 10:22:25 +03:00
Pekka Enberg
8c474870c1 core: Eliminate redundant casts 2024-08-01 09:25:25 +03:00
Pekka Enberg
82ff5b9c9b core: Remove useless use of format!() 2024-08-01 09:16:02 +03:00
sonhmai
789ae4becf feat: add time() scalar function partial support without modifier #158 2024-08-01 13:06:07 +07:00
Pekka Enberg
8f6a2fc814 core: Fix I/O compliation on Windows
...just steal the generic implementation of pread() and pwrite().
2024-07-31 19:58:37 +03:00
Pekka Enberg
e00690bf9b core: Fix I/O build on Darwin 2024-07-31 19:52:59 +03:00
Pere Diaz Bou
b8e08dcdc4 core: more2 fix completion darwin io 2024-07-31 18:07:22 +02:00
Pere Diaz Bou
10da6a673d core: more fix completion darwin io 2024-07-31 18:04:26 +02:00
Pere Diaz Bou
38c407a286 core: fix completion darwin io 2024-07-31 18:01:38 +02:00
Pere Diaz Bou
82ee0e4a00 core: fix completion generic io 2024-07-31 17:58:45 +02:00
Pere Diaz Bou
2b221d2b3c fix conflicts
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2024-07-31 17:38:33 +02:00
Pere Diaz Bou
8810a5c11e core: fix move_to replace cursor current page
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2024-07-31 17:27:02 +02:00
Pere Diaz Bou
8c654adc50 core: fix propagation of key to top
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2024-07-31 17:27:02 +02:00