Commit Graph

134 Commits

Author SHA1 Message Date
Glauber Costa
a3387cfd5f implement the pragma page_count
To do that, we also have to implement the vdbe opcode Pagecount.
2025-02-01 19:39:46 -05:00
Pekka Enberg
20d3399c71 Merge 'implement is and is not where constraints' from Glauber Costa
The main difference between = and != is how null values are handled.
SQLite passes a flag "NULLEQ" to Eq and Ne to disambiguate that.
In the presence of that flag, NULL = NULL.
Some prep work is done to make sure we can pass a flag instead of a
boolean to Eq and Ne. I looked into the bitflags crate but got a bit
scared with the list of dependencies.
Warning:
The following query produces a different result for Limbo:
```
select * from demo where value is null or id == 2;
```
I strongly suspect the issue is with the OR implementation, though. The
bytecode generated is quite different.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #847
2025-02-01 17:24:11 +02:00
Glauber Costa
3c77797811 also mark IS DISTINCT FROM as supported
This seems to really be just an alias for IS:

"The IS NOT DISTINCT FROM operator is an alternative spelling for the IS
operator. Likewise, the IS DISTINCT FROM operator means the same thing
as IS NOT. Standard SQL does not support the compact IS and IS NOT
notation. Those compact forms are an SQLite extension. You have to use
the prolix and much less readable IS NOT DISTINCT FROM and IS DISTINCT
FROM operators on other SQL database engines."
2025-02-01 09:30:06 -05:00
Pekka Enberg
43d6c2760d Merge 'update compat list' from Glauber Costa
Those two expr seem to be supported

Closes #846
2025-02-01 09:24:27 +02:00
Glauber Costa
96987db6ca implement is and is not where constraints
The main difference between = and != is how null values are handled.
SQLite passes a flag "NULLEQ" to Eq and Ne to disambiguate that.
In the presence of that flag, NULL = NULL.

Some prep work is done to make sure we can pass a flag instead of a
boolean to Eq and Ne. I looked into the bitflags crate but got a bit
scared with the list of dependencies.
2025-01-31 23:01:49 -05:00
Glauber Costa
7e8b190b9a update compat list
Those two expr seem to be supported
2025-01-31 16:56:19 -05:00
Pekka Enberg
44e5402464 Merge branch 'main' into feature/noop 2025-01-31 18:49:39 +02:00
Glauber Costa
a7cc367c1f implement pragma pragma_list
List all available pragmas (Except pragma_list)
2025-01-31 06:44:56 -05:00
Pekka Enberg
7f0274e48f Merge 'Table info' from Glauber Costa
This implements the table_info pragma, allowing us to fetch information
about columns present in a table.

Closes #837
2025-01-31 08:46:27 +02:00
Glauber Costa
016b815b59 implement pragma table_info
Both () and = variants covered. It is important to make sure that
the transaction is a read transaction, so we cannot hide all that logic
inside update_pragma, and have to make our decision before that.
2025-01-30 20:00:20 -05:00
Glauber Costa
598f793581 add compat statement about CreateBTree opcode
It is partially supported - only on the existing database.
2025-01-30 12:52:04 -05:00
Ihor Andrianov
c500c16eca fix COMPAT.md message 2025-01-30 03:32:39 +02:00
Ihor Andrianov
7455d9718a update COMPAT.md 2025-01-30 03:28:55 +02:00
Pekka Enberg
f086c1b32f Update COMPAT.md 2025-01-29 19:57:04 +02:00
Pekka Enberg
cfc585813b Merge 'implement sqlite_source_id function' from Glauber Costa
Closes #811
2025-01-29 09:45:00 +02:00
Pekka Enberg
53cb1ffe38 Merge 'update COMPAT matrix for journal_mod pragma' from Glauber Costa
it seems like it is supported now

Closes #809
2025-01-29 09:44:28 +02:00
Glauber Costa
8f24d18ad8 implement sqlite_source_id function 2025-01-28 14:55:38 -05:00
Glauber Costa
cd58d6c37e update COMPAT matrix for journal_mod pragma
it seems like it is supported now
2025-01-28 14:04:23 -05:00
Pekka Enberg
a9d2ef3878 Update COMPAT.md 2025-01-28 14:26:09 +02:00
sonhmai
f59379e0c9 fix wrong replacement in compat 2025-01-28 11:35:49 +07:00
sonhmai
fc4192362d add journaling modes to compat 2025-01-28 11:13:37 +07:00
pedrocarlo
515e281480 implement noop 2025-01-26 20:49:23 -03:00
Harin
0903b9b019 Implemented JSON valid function 2025-01-26 23:35:47 +05:30
Pedro Muniz
9d858f5cb3 Merge branch 'tursodatabase:main' into feature/strftime 2025-01-25 16:23:32 -03:00
pedrocarlo
a316ab51ac feature: implement strftime function 2025-01-25 16:22:53 -03:00
Diego Reis
e7d95399e3 Add Or bytecode
Take the logical OR of the values in register P1 and P2 and store the answer in register P3. If either P1 or P2 is nonzero (true) then the result is 1 (true) even if the other input is NULL. A NULL and false or two NULLs give a NULL output.
2025-01-25 02:54:14 -03:00
Diego Reis
aff454b5f6 Implement And bytecode
Take the logical AND of the values in registers P1 and P2 and write the result into register P3. If either P1 or P2 is 0 (false) then the result is 0 even if the other input is NULL. A NULL and true or two NULLs give a NULL output.
2025-01-25 02:12:50 -03:00
Pekka Enberg
c282b23e6b Merge 'Implement Concat opcode' from Harin
This adds the Concat opcode to the VDBE.

Closes #758
2025-01-21 07:45:16 +02:00
sonhmai
dd436d3fc5 add PRAGMA statements in COMPAT doc 2025-01-21 11:27:22 +07:00
Harin
da53cc3821 Added Concat Opcode 2025-01-21 00:29:23 +05:30
Pekka Enberg
bda1e4e6ab Merge 'Add support for json_object function' from Jorge Hermo
Relates to #127.  This PR is still in draft and I have a few left things
to do (tests, improve implementation), just opening it so anyone can
track this work meanwhile.

Closes #664
2025-01-20 09:36:56 +02:00
Pekka Enberg
c25d9a1824 Merge 'Implement Not' from Vrishabh
This PR adds support for Not operator and Opcode.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #748
2025-01-20 09:17:45 +02:00
ben594
2ec52d14f1 Update compatibility status 2025-01-19 20:51:16 -05:00
psvri
e616bd5361 Implement Not 2025-01-20 00:21:23 +05:30
psvri
e16b3491c4 Fix null compares giving incorrect results 2025-01-19 00:44:38 +05:30
Pekka Enberg
20837d217b Update COMPAT.md 2025-01-17 19:50:43 +02:00
psvri
e43271f53b Implement regexp extension 2025-01-16 23:15:59 +05:30
Pekka Enberg
465c923db1 Update COMPAT.md 2025-01-16 09:14:46 +02:00
Jorge Hermo
fa8eb9549a Merge with main 2025-01-15 22:10:35 +01:00
psvri
d3f28c51f4 Implement ShiftRight 2025-01-15 21:21:51 +05:30
psvri
5b4d82abbf Implement ShiftLeft 2025-01-15 18:54:07 +05:30
PThorpe92
23d9d09b70 Add load_extension function, resolve shared lib extensions 2025-01-14 12:01:07 -05:00
Jorge Hermo
b3d3c8cf65 docs: update COMPAT.md 2025-01-14 00:04:54 +01:00
Pekka Enberg
1e94dbffcc Merge branch 'main' into json-error-position 2025-01-13 18:21:37 +02:00
Peter Sooley
b5fed15997 implement json_error_position 2025-01-10 11:12:30 -08:00
Kacper Madej
1a85601261 Update docs 2025-01-10 13:41:47 +07:00
Kacper Madej
eebf9bfaac Implement json_type 2025-01-09 11:29:17 +07:00
PThorpe92
ca428b3dda Julianday function and additional tests/comments 2025-01-04 10:42:34 -05:00
PThorpe92
7c4a780cc2 Add DateTime func and support more modifiers 2025-01-04 08:41:03 -05:00
Kacper Madej
2e730ead25 Merge branch 'main' into json-extract 2024-12-31 15:41:18 +07:00