I don't know when and why we dropped log::* in favor of tracing but when it was done, it made relevant logs not appear any more while debugging so... I added test_log::test which helps by automatically adding info logs from trace package.
This is an umbrella PR for multi threading where I modify the following:
* Loaded extensions (`syms`) are now moved to `Connection` as loading
extensions in SQLite is per connection and not per database.
* `Schema` is not a `RWLock` so that it behaves equally to SQLite where
schema changes block preparing new statements.
* Sprinkled a bunch of `unsafe impl Send` and `unsafe impl Sync` on top
of all `IO` implementations and inner structures for now in order to
allow multi threading. Ideally this will be enforced with transaction
locks and internal locks instead of throwing a bunch of mutexes like
rust would like us to do -- this means the work is not finished and
rather started for future improvements.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes#1091
This makes it work like in SQLite where only one schema writer is permitted and readers will return error while preparing statement if the schema is changing.
This PR adds tab completion to the CLI app. To achieve that I
implemented a simplified, but similar, Vtable that given a prefix and a
line, it outputs rows of candidates. Currently, it only supports auto
completion for SQLite keywords, but in the future we can autocomplete
database names and columns when `PRAGMA database_list` is implemented.
Also, some work will need to be done for detecting whether some syntax
would be legal in certain scenarios, but I think this is better
delegated to a future PR.
Closes#1050
Move page allocation to pager so that we don't need to instantiate a
cursor to create a B-Tree.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1093
Clean up the cursor lookup code in VDBE in preparation for multi-version
cursor support.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1090
This PR cleans up some comments in the extension API and prevents
extensions themselves from calling 'free' on Value types that are
exposed to the user facing traits, as well as changes the `from_ffi`
method for OwnedValues to take ownership and automatically free the
values to prevent memory leaks.
This PR also finds the name of the `args: &[Value]` argument for scalar
functions in extensions, and uses that in the proc macro, instead of
relying on documentation to communicate that the parameter must be named
`args`.
Closes#1054
Relatively simple one, although I notice we don't have a lot of testing
here. The extensions have all their tests in the python cli extension
tests. Do we want to keep it that way or motivate inline rust tests for
these modules?
Closes#1081
These 2 were missing from the help menu and are both pretty useful.
Noticed `.exit` is also missing, ambivalent about this one since it's
rarely needed.
Also removed all ending periods to make these consistent (sqlite uses
this punctuation style as well)
Closes#1072
### Purpose
- Do some minor nits
- Implement logic that returns updated count when running
executeUpdate
- Implement version related functions
### Reference
- https://github.com/tursodatabase/limbo/issues/615Closes#1086