When compiling with features disabled, there are lots of clippy
warnings. This PR silences them.
For the utils file, I am using a bit of a hammer and just allowing
unused stuff in the whole file. Due to the box of utilities nature of
this file, it'll always be the case that things will be unused depending
on the feature-set.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes#2236
When compiling with features disabled, there are lots of clippy
warnings. This PR silences them.
For the utils file, I am using a bit of a hammer and just allowing
unused stuff in the whole file. Due to the box of utilities nature of
this file, it'll always be the case that things will be unused depending
on the feature-set.
There's no such thing as a read-only connection.
In a normal connection, you can have many attached databases. Some r/o,
some r/w.
To properly fix that, we also need to fix the OpenWrite opcode. Right
now we are passing a name, which is the name of the table. That
parameter is not used anywhere. That is also not what the SQLite opcode
specifies. Same as OpenRead, the p3 register should be the database
index.
With that change, we can - for now - pass the index 0, which is all we
support anyway, and then use that to test if we are r/o.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes#2232
Makes invalid states impossible, removes magic numbers. Functionally
equivalent.
> [!NOTE]
> ~`DbState` is implemented as a transparent wrapper over `usize` to
avoid undefined behavior with `mem::transmute`~
> Switched to a regular enum, by @Shourya742's suggestion.
Reviewed-by: bit-aloo (@Shourya742)
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes#2174
There's no such thing as a read-only connection.
In a normal connection, you can have many attached databases. Some
r/o, some r/w.
To properly fix that, we also need to fix the OpenWrite opcode. Right
now we are passing a name, which is the name of the table. That
parameter is not used anywhere. That is also not what the SQLite opcode
specifies. Same as OpenRead, the p3 register should be the database
index.
With that change, we can - for now - pass the index 0, which is all
we support anyway, and then use that to test if we are r/o.
This PR fixes `wal_read_frame_raw` API
Before, implementation of raw read API read only page content - which is
not enough as we also need page_no and size_after fields from the
header. This PR fixes that and also make few adjustments in the
signatures.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes#2229
Make `cacheflush` / `commit_dirty_pages` functions deterministic. This
can help to mitigate some simulator non-reproducible seeds + simplify
life a bit.
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>
Closes#2228
`BTreeTable::to_sql` makes us incompatible with SQLite by losing e.g.
the original whitespace provided during the CREATE TABLE command. For
example:
`CREATE TABLE t (x)` gets saved as `CREATE TABLE t (x)`.
Sqlite preserves the user-provided whitespace.
For now let's fix our tests by regex-replacing every CREATE TABLE in the
entire repo to have exactly 1 space after the table name in the CREATE
TABLE statement.
I also added a FIXME in the doc comment for `BTreeTable::to_sql`, and
opened https://github.com/tursodatabase/turso/issues/2224Closes#2223
`BTreeTable::to_sql` makes us incompatible with SQLite by losing e.g. the original whitespace provided during the CREATE TABLE command.
For now let's fix our tests by regex-replacing every CREATE TABLE in
the entire repo to have exactly 1 space after the table name in the
CREATE TABLE statement.
A write txn can only start if the current snapshot held by writer is
consistent with the one in shared state
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#2204
This package is for serverless access to the Turso Cloud using SQL over
HTTP protocol. The purpose of this package is to provide the same
interface as `@tursodatabase/turso`, but for serverless environments
that cannot host the database engine.
The package also provides a `@libsql/client` compatibility layer in the
`@tursodatabase/serverless/compat` module for drop-in replacement for
existing clients.
Closes#2209
This package is for serverless access to the Turso Cloud using SQL over
HTTP protocol. The purpose of this package is to provide the same
interface as `@tursodatabase/turso`, but for serverless environments
that cannot host the database engine.
The package also provides a `@libsql/client` compatibility layer in the
`@tursodatabase/serverless/compat` module for drop-in replacement for
existing clients.
- enable indexes, otherwise it doesnt work at all
- rename limbo to tursodb
- use mode=list instead of mode=pretty for less bulky tursodb results
Closes#1925Closes#2200
maybe_shared_wal's lock is held for a limited time increasing the chance
of initializing the shared wal twice.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#2201