Commit Graph

59 Commits

Author SHA1 Message Date
Pere Diaz Bou
ee55116ca6 return row as reference to registers 2025-03-29 22:04:08 +01:00
Pere Diaz Bou
bf37fd3314 wip 2025-03-29 22:02:49 +01:00
Pere Diaz Bou
9291f60722 Introduce Register struct
OwnedValue has become a powerhouse of madness, mainly because I decided
to do it like that when I first introduced AggContext. I decided it was
enough and I introduced a `Register` struct that contains `OwnedValue`,
`Record` and `Aggregation`, this way we don't use `OwnedValue` for
everything make everyone's life harder.

This is the next step towards making ImmutableRecords the default
because I want to remove unnecessary allocations. Right now we clone
OwnedValues when we generate a record more than needed.
2025-03-27 17:53:02 +01:00
Pekka Enberg
7fc61b7b3d sqlite3: Add trace logging to sqlite3_exec() 2025-03-17 16:17:18 +02:00
Pekka Enberg
7ae1da0f3c Ignore some failing Rust SQLite test cases
...they fail on CI, but not locally so disable them until we got them sorted out.
2025-03-12 18:56:32 +02:00
Pere Diaz Bou
f7c8d4cc69 test_open_existing fix 2025-03-12 16:06:52 +01:00
Pere Diaz Bou
e65d76f51f fmt 2025-03-12 16:06:29 +01:00
Pere Diaz Bou
40a78c32b6 fix sqlite3 lib db test path 2025-03-12 16:00:46 +01:00
Pekka Enberg
cb68b2ec1b sqlite3: cargo fmt 2025-03-10 12:22:01 +02:00
karan
34876c4711 fixing erro code for sqlite open
Signed-off-by: karan <karanjanthe@gmail.com>
2025-03-08 09:52:43 +05:30
Pekka Enberg
96175cccf7 cli: Add --experimental-mvcc option to enable MVCC 2025-03-06 10:16:42 +02:00
Pere Diaz Bou
8daf7666d1 Make database Sync + Send 2025-03-05 14:07:48 +01:00
Pekka Enberg
936ae307b7 core: Kill value type
We currently have two value types, `Value` and `OwnedValue`. The
original thinking was that `Value` is external type and `OwnedValue` is
internal type. However, this just results in unnecessary transformation
between the types as data crosses the Limbo library boundary.

Let's just follow SQLite here and consolidate on a single value type
(where `sqlite3_value` is just an alias for the internal `Mem` type).
The way this will eventually work is that we can have bunch of
pre-allocated `OwnedValue` objects in `ProgramState` and basically
return a reference to them all the way to the application itself, which
extracts the actual value.
2025-02-26 10:57:45 +02:00
Tiago Ribeiro
d807b533f7 Update sqlite3 c binding to use the new retrieval methods to access Record values. 2025-02-10 00:27:52 -07:00
Pekka Enberg
c210821100 core: Move result row to ProgramState
Move result row to `ProgramState` to mimic what SQLite does where `Vdbe`
struct has a `pResultRow` member. This makes it easier to deal with result
lifetime, but more importantly, eventually lazily parse values at the edges of
the API.
2025-02-06 11:52:26 +02:00
Jorge López
86a4714711 syntactic changes: remove unneeded paths when the type is already imported 2025-01-18 18:29:12 +01:00
Pekka Enberg
276819369c sqlite3: Add in-memory support to sqlite3_open() 2025-01-04 10:58:51 +02:00
Daniel Kaluza
3b85015f55 Fix inconsistent SQLITE_NOTFOUND error code 2025-01-03 11:19:21 +01:00
PThorpe92
f6cd707544 Add clippy CI, fix or ignore warnings where appropriate 2024-12-29 10:25:41 -05:00
Pekka Enberg
f2ecebc357 Rename RowResult to StepResult
The name "row result" is confusing because it really *is* a result from
a step() call. The only difference is how a row is represented as we
return from VDBE or from a statement.

Therefore, rename RowResult to StepResult.
2024-12-27 10:20:41 +02:00
Pere Diaz Bou
5cd84a407f fmt 2024-12-24 18:42:58 +01:00
Pere Diaz Bou
aed14117c9 core: transaction support 2024-12-24 18:04:30 +01:00
Pekka Enberg
8387e7903c sqlite: Fix source formatting 2024-12-20 09:30:03 +02:00
Pekka Enberg
56710b0187 sqlite3: Implement sqlite3_free_table() 2024-12-20 09:18:31 +02:00
Pekka Enberg
d0fa9e07f7 Merge 'sqlite3: Add sqlite3_wal_checkpoint_*() API' from Pekka Enberg
This wires up checkpointing to the SQLite C API. We don't respect the
checkpointing mode because core does not have that nor do we report back
some stats.

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #480
2024-12-20 09:06:04 +02:00
Diego Reis
3a0e56bca5 Implement basic sqlite3_get_table() API 2024-12-19 23:13:51 -03:00
Pekka Enberg
e93ac38e55 Add statement interruption support
This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
2024-12-19 12:30:32 +02:00
Pekka Enberg
f1937ee47f sqlite3: Add sqlite3_wal_checkpoint_*() API
This wires up checkpointing to the SQLite C API. We don't respect the
checkpointing mode because core does not have that nor do we report back
some stats.

Refs: #478
2024-12-15 10:58:52 +02:00
Pere Diaz Bou
3e59da439c fmt 2024-12-13 13:10:33 +01:00
Pere Diaz Bou
97dd95abea core: change Rc<RefCell<Page>> to Arc<Page>
This includes an inner struct in Page wrapped with Unsafe cell to access
it. This is done intentionally because concurrency control of pages is
handled by pages and not by the page itself.
2024-12-13 13:09:13 +01:00
Pere Diaz Bou
a4297702bd extract page cache to be multi threaded 2024-12-13 13:09:13 +01:00
jussisaurio
9bc3ccc394 fmt 2024-12-03 19:11:08 +02:00
Pere Diaz Bou
a4b473ba59 fmt 2024-11-13 19:17:49 +01:00
Pere Diaz Bou
c46bd63b5a core: drop mutex on contents
There is no need to have mutexes on buffers, we will introduce mutexes
if we want later on a file level to introduce serializability.
2024-11-13 19:13:15 +01:00
Pere Diaz Bou
c0e51c4ca6 wip wal 2024-11-05 15:29:53 +01:00
Pekka Enberg
f23c668488 Revert part of "Fix source formatting with cargo fmt"
Looks like there's difference in `cargo fmt` across toolchain versions.
Perhaps it's time to add `rust-toolchain.toml` to the project...
2024-09-22 08:58:48 -04:00
Pekka Enberg
5aeb18f474 Fix source formatting with cargo fmt 2024-09-22 08:52:32 -04:00
김선우
f08dc9e2c0 Revert sqlite3/src/lib 2024-09-15 16:32:12 +09:00
김선우
28884181be Fix clippy 2024-09-15 16:23:27 +09:00
rjhallsted
9791e2074f Fix cargo fmt complaint 2024-09-10 14:32:25 -07:00
Pekka Enberg
6e8a1117fe sqlite3: Format source code with cargo fmt 2024-08-22 17:54:25 +03:00
Pekka Enberg
c69b2ab4f6 sqlite3: Fix LFS feature flag 2024-08-22 17:53:07 +03:00
jussisaurio
84cf4033d5 Refactor join processing
- Make all constraints a list of WhereTerms in a ProcessedWhereClause
- Support multiple joins instead of just one
2024-07-23 15:04:40 +03:00
Joan Martinez
642603b6c7 perf-latency: fix enabling to build multitenancy 2024-07-21 19:13:02 +02:00
Joan Martinez
4bcae54aa9 fix: use Arc to handle IO 2024-07-21 19:01:58 +02:00
Pekka Enberg
17727ef1af sqlite3: Make stub function failures more explicit 2024-07-21 13:34:39 +03:00
mazchew
c90f7b8222 add cpython compatibility for error codes and messages
edits

minor edit
2024-07-21 17:56:05 +08:00
Pekka Enberg
af7b8b6768 sqlite3: Implement some auxiliary functions
This adds `sqlite3_libversion()`, `sqlite3_libversion_number()`, and
`libsql3_threadsafe()`.
2024-07-17 13:00:35 +03:00
Pekka Enberg
4efa6e5efa sqlite3: API function tracing 2024-07-17 12:59:54 +03:00
Pekka Enberg
8fb50cc9bc sqlite3: Auto initialize in sqlite3_open() 2024-07-17 12:34:29 +03:00