Commit Graph

557 Commits

Author SHA1 Message Date
PThorpe92
ed95007298 Separate exec insns to individual functions 2024-12-31 07:55:40 -05:00
PThorpe92
d572089b80 Refactor out repetitive agg_func code in vdbe 2024-12-31 07:53:55 -05:00
Jussi Saurio
2066475e03 feat: subqueries in FROM clause 2024-12-31 14:18:29 +02:00
Pekka Enberg
0aabcddf18 ext/uuid: Convert uuid4() to external function 2024-12-31 13:56:32 +02:00
Pekka Enberg
33dbd6c892 core: External functions 2024-12-31 13:56:32 +02:00
Kacper Madej
692301e72c Merge branch 'main' into json-extract 2024-12-31 15:53:08 +07:00
Kacper Madej
2e730ead25 Merge branch 'main' into json-extract 2024-12-31 15:41:18 +07:00
Pekka Enberg
80e12dfbf7 Merge 'Fixes glob giving wrong results in some cases ' from Vrishabh
Fixes #577
With the previous implementation we weren't escaping the regex meta
characters . And in certain cases glob had a different meaning than
regex.
For e.g , the below shows a glob pattern with its regex equivalent
- `[][]` translates to `[\]\[]`
- `[^][]` translates to `[^\]\[]`

Closes #578
2024-12-31 10:31:49 +02:00
Kacper Madej
ad9acf7400 Add support for json_extract 2024-12-31 15:11:36 +07:00
psvri
3ac3fdf0a2 Fix glob 2024-12-30 17:02:31 +05:30
Lauri Virtanen
10065bda35 Don't use inaccurate pi values, make clippy happy 2024-12-29 19:22:45 +02:00
Lauri Virtanen
854005b977 Run cargo clippy --fix && cargo fmt 2024-12-29 19:22:28 +02:00
PThorpe92
f6cd707544 Add clippy CI, fix or ignore warnings where appropriate 2024-12-29 10:25:41 -05:00
Pekka Enberg
f87dc7cacc Merge 'Support like function with escape' from Vrishabh
I have added support for like function with escape i.e like(X,Y,Z) .
There is good opportunity to refactor/cleanup the like operations which
can be done in another PR, as I wanted to keep the changes small .

Closes #568
2024-12-29 16:58:06 +02:00
adamnemecek
97647ff056 Clean up code to use Self
Closes #556
2024-12-29 10:07:38 +02:00
psvri
1922b8ea38 Support like function with escape 2024-12-28 13:55:12 +05:30
PThorpe92
f08d62b446 Add Remainder vdbe oppcode 2024-12-27 15:39:02 -05:00
Pekka Enberg
5b8f00cb8d Merge 'Fixes like function when pattern has regex meta chars' from Vrishabh
Fixes #552
In our construct regex function, we were not escaping the required
characters properly which was causing the failure.
Limbo output with this branch
```
limbo> select like('\%A', '\A');
1
limbo> select like('A$%', 'A$');
1
limbo> select like('%a.a', 'aaaa');
0
```

Closes #553
2024-12-27 18:35:47 +02:00
김선우
ad2d515ffd Merge branch 'main' into feature/delete-planning 2024-12-27 23:21:35 +09:00
Peter Sooley
28244b10d6 implement json_array_length 2024-12-26 15:08:11 -08:00
psvri
12e49da1d0 fmt fixes 2024-12-26 22:42:46 +05:30
psvri
4368e8767b Fix like function giving wrong results 2024-12-26 22:38:54 +05:30
Pekka Enberg
37e1f35df8 Fix Cargo.toml in macros crate 2024-12-25 11:54:16 +02:00
Pere Diaz Bou
aed14117c9 core: transaction support 2024-12-24 18:04:30 +01:00
김선우
56165fb0d6 Merge branch 'main' into feature/delete-planning 2024-12-24 12:29:19 +09:00
김선우
57c7a56e35 Apply fmt, clippy 2024-12-22 14:27:21 +09:00
김선우
9a8b94ef93 First successful implementation of delete planning 2024-12-22 13:16:16 +09:00
PThorpe92
c06c4115f1 Adapt OwnedValues in uuid ext to new LimboText 2024-12-21 09:17:53 -05:00
PThorpe92
2fcae80902 Create ext directory for outside funcs, add uuid to ext dir 2024-12-21 09:16:04 -05:00
PThorpe92
c1561ecbb0 Tests for uuid funcitons, add compat docs 2024-12-21 09:13:48 -05:00
PThorpe92
b207f7ded5 Give uuidv7 optional unix time arg 2024-12-21 09:13:48 -05:00
PThorpe92
fcab0ae299 Add uuid support for v4 and v7 2024-12-21 09:13:46 -05:00
vignesh-j-shetty
a43a1d204c renamed macro crate 2024-12-21 13:19:04 +05:30
vignesh-j-shetty
1e72fee343 Implemented proc_macro_derive extract description from rust docs and generate get_description function 2024-12-21 12:23:04 +05:30
jussisaurio
5b4ef4412b Merge 'Implement json_array' from Kacper Madej
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
2024-12-20 16:35:40 +02:00
Kacper Madej
cdb24d3de1 Handle issues with nested arguments 2024-12-20 11:32:57 +01:00
Kacper Madej
19ae42dfa3 Implement json_array 2024-12-20 11:15:48 +01: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
Lauri Virtanen
fe42930239 Take log function argument count from function context 2024-12-17 00:14:26 +02:00
Lauri Virtanen
f5c82503f9 Be more explicit with pi() being the only nullary math function 2024-12-17 00:14:25 +02:00
Lauri Virtanen
e69ee80fac Support log(X) and log(B,X) math functions 2024-12-17 00:14:25 +02:00
Lauri Virtanen
89d0289444 Support pi() function 2024-12-17 00:14:25 +02:00
Lauri Virtanen
5e426a7624 Support binary math functions 2024-12-16 22:29:05 +02:00
Lauri Virtanen
f69fdc1645 Support unary math functions 2024-12-16 19:31:20 +02:00
Lauri Virtanen
9720f63a55 Add types for mathematical functions 2024-12-16 19:31:20 +02:00
Kacper Kołodziej
c04839d9e0 functions: add unhex(x, y) version
For `unhex(x, y)` handle trimming `y` characters from the beginning and
end of `x` value before decoding.

Part of solutions of #144.
2024-12-14 00:55:44 +01:00
alpaylan
4f395623ab fix the comment on replace panic in case of text cast failure 2024-12-12 15:03:35 -05:00
Alperen Keleş
841a4fe2f8 Merge branch 'tursodatabase:main' into main 2024-12-12 13:13:41 -05:00
Pekka Enberg
5796b418b9 Merge 'Add support for soundex() function' from flaneur
add [soundex](https://www.sqlite.org/lang_corefunc.html#soundex) scalar
function.
it seems that sqlite did not enable `soundex()` function by default
unless build it with `SQLITE_SOUNDEX`, while the sqlite in the ci
workflow did not enable it. this pr skipped the test over `soundex()`
temporarily in the `scalar-function.test` file.

Closes #453
2024-12-12 18:10:46 +02:00
Pekka Enberg
91764b85e6 Merge 'Add bitwise vdbe ops' from Preston Thorpe
Love the project, been following your blog posts for quite a while now.
I asked on Discord prior to submitting this, just because I didn't see a
specific issue for this feature... but if this PR is out of scope for
contributors, feel free to close it as I just had a good time hacking on
it.
This PR adds support for `BitAnd`, `BitOr`, and `BitNot` operators in
the vdbe, as well as unary expressions applied to aggregate functions;
which was needed in order to have `BitNot` support the same tests that
the other operators had.
*Also added unary negation of function calls, because since unary ops
were added, I figured adding support for the other existing unary
operator might be in scope, but lmk if not.
Let me know if there is any more tests or documentation to add/improve.

Closes #445
2024-12-12 17:35:12 +02:00