Implements [json_array](https://sqlite.org/json1.html#jarray).
As a side quest, this PR also fixes an issue with the `CHAR` function
which didn't work properly if the parameters were non-leaf AST nodes.
The PR is quite big, because as I mentioned in https://github.com/tursod
atabase/limbo/issues/127#issuecomment-2541307979 we had to modify
`OwnedValue::Text` to support a `subtype` parameter, which is what
SQLite does.
Closes#504
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
#479
This is my first draft for implementing `sqlite3_get_table()`, it is
highly inspired on the actual implementation found [here](https://raw.gi
thubusercontent.com/rusqlite/rusqlite/92fdc11fea0ecea6400dfcb74c1c3ca362
14a7d4/libsqlite3-sys/sqlite3/sqlite3.c), I made some basic manual
testing in `example.c` and it works fine but an extensive test suite is
recommended.
Closes#519
The only instances of the &(*x) dereferencing pattern in the codebase,
is used with Completion smart pointers. Changed it to use as_ref(). No
functional changes.
Closes#516
Somehow the `make` command does not work because of the name
mismatching. This PR will fix only this issue.
For reproducing the issue:
```
$ make
Checking requirements files...
mkdir -p .tmp
pip-compile pyproject.toml --quiet --output-file=.tmp/requirements.txt
pip-compile pyproject.toml --quiet --extra=dev --output-file=.tmp/requirements-dev.txt
diff -u requirements.txt .tmp/requirements.txt || (echo "requirements.txt doesn't match pyproject.toml" && exit 1)
--- requirements.txt 2024-12-17 02:19:29.887227723 +0000
+++ .tmp/requirements.txt 2024-12-17 02:19:38.046065295 +0000
@@ -1,2 +1,2 @@
typing-extensions==4.12.2
- # via limbo (pyproject.toml)
+ # via pylimbo (pyproject.toml)
requirements.txt doesn't match pyproject.toml
make: *** [Makefile:28: check-requirements] Error 1
```
## Another issue...
`maturin` is still not in requirements dev list. Shall we continue to
install it manually or add it to dev list?
Closes#495
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.
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>
Closes#512
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.
This change refactors how PRAGMA statements are handled, introducing a
more organized and extensible structure to simplify adding new PRAGMA
properties in the future.
Previously, only the `cache_size` PRAGMA was supported. With this
update, support for the `journal_mode` PRAGMA has been added.
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>
Closes#501
This change refactors how PRAGMA statements are handled, introducing a
more organized and extensible structure to simplify adding new PRAGMA
properties in the future.
Previously, only the `cache_size` PRAGMA was supported. With this
update, support for the `journal_mode` PRAGMA has been added.
This PR adds the `.tables` command. I use it a lot in sqlite and I
noticed it was missing from here so I decided to contribute.
Let me know if any changes or improvements are required.
Reviewed-by: Preston Thorpe <alpkeles99@gmail.com>
Closes#503
This PR mainly adds custom logic to check equality in ast expressions.
Not sure if this belongs in the `vendored` parser or not, let me know
and I'll bring it out. Also replaces `Vec` arguments with slice refs
where possible, as well as some clippy warnings in the same `emitter`
file.
I'll write some more tests tomorrow to make sure this is as thorough as
possible.
EDIT: failed test same issue referenced in #484. Marking as draft until
more tests + cases added
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#488
Add support for math scalar functions of SQLite:
https://sqlite.org/lang_mathfunc.html
Since SQLite CLI and Limbo CLI present floating point numbers with
different precision, I added `do_execsql_test_tolerance` which tests
that floating point results close enough of the expected value. However,
we probably could make Limbo's floating point presentation match to
SQLite.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#460