Commit Graph

73 Commits

Author SHA1 Message Date
Piotr Rzysko
f5efcbe745 Add support for window functions
Adds initial support for window functions. For now, only existing
aggregate functions can be used as window functions—no specialized
window-specific functions are supported yet.

Currently, only the default frame definition is implemented:
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS.
2025-09-13 11:12:44 +02:00
PThorpe92
6619b6e5a0 Add upsert test module to tcl tests 2025-08-29 20:58:43 -04:00
Piotr Rzysko
20ea079679 Add framework for testing extensions in TCL
There is a distinction between tests that verify extension-specific
behavior and tests that verify interactions between the database engine
and extensions. Previously, both types of tests were kept in extensions.py.
With this new framework, we can extract the latter type of tests from
extensions.py into TCL. This cleans up extensions.py and provides
compatibility testing with SQLite at no extra cost.

To demonstrate the framework’s usage, tests verifying the handling of
virtual tables were extracted to TCL.

In the future, we may consider moving extension-specific tests to TCL as
well, especially those that have counterparts in SQLite or sqlean.
2025-08-15 21:06:27 +02:00
Glauber Costa
5ab6f78f6b Implement views
Views (non materialized) are relatively simple, since they are just
query aliases.

We can expand them as if they were subqueries.
2025-08-13 14:14:03 -05:00
Jussi Saurio
2095e5dde1 test/tcl: run alter_table.test in all.test 2025-07-22 11:12:02 +03:00
Pere Diaz Bou
cde7202981 Revert "Merge 'core: Disable ROLLBACK statement' from Pekka Enberg"
This reverts commit 8a13e4b02f, reversing
changes made to cc935f97cc.
2025-07-03 12:36:48 +02:00
Pekka Enberg
2542cb2d03 core: Disable ROLLBACK statement
There's bad interaction with schema changes and `ROLLBACK`:

https://github.com/tursodatabase/turso/issues/1890

Disable the statement for now to avoid people hitting the issue.
2025-06-30 17:30:01 +03:00
Pere Diaz Bou
b3e0ba030d add rollback tcl tests 2025-06-25 14:01:53 +02:00
Pere Diaz Bou
81d566cd1c integrity test with tcl 2025-06-11 18:39:06 +02:00
meteorgan
34e05ef974 make values work in subquery 2025-05-23 00:30:04 +08:00
pedrocarlo
d0a63429a6 Naive implementation of collate for queries. Not implemented for column constraints 2025-05-19 15:22:14 -03:00
pedrocarlo
c8b768f1ea add tests 2025-05-18 12:43:11 -03:00
meteorgan
5185f4bf9e Support isnull and notnull expr 2025-05-11 23:47:30 +08:00
Pekka Enberg
14ef25ebb8 Merge 'Add drop index' from Anton Harniakou
This commit adds suport for DROP INDEX.
Bytecode produced by this commit differs from SQLITE's bytecode, main
reason we don't do autovacuum or repacking of pages like SQLITE does.
Closes #1280

Closes #1444
2025-05-10 08:04:39 +03:00
meteorgan
ef3f004e30 refactor numeric literal 2025-05-08 18:37:17 +08:00
Anton Harniakou
9d31f5d848 Test DROP INDEX 2025-05-04 12:18:36 +03:00
pedrocarlo
af456513d1 Fix incompatibility AND Expression 2025-04-13 22:38:43 -03:00
Diego Reis
43daba9942 core/translate: Add support for default values in INSERT statements 2025-04-04 01:32:13 -03:00
Pekka Enberg
65bf33023c core: Fix Destroy opcode root page handling
The `p1` register points to the root page, not to a cursor.

Fixes #1136
2025-03-24 10:54:49 +02:00
PThorpe92
dbfe94d677 Add initial tests for update support 2025-03-23 17:08:15 -04:00
Diego Reis
590f90ad9a Fix AutoCommit handling of an ongoing halt checkpoint 2025-03-16 15:35:49 -03:00
Pekka Enberg
20e881ae0d testing: Disable transaction tests for now 2025-02-14 12:19:58 +02:00
Pekka Enberg
076331d8cf testing: Basic BEGIN + END test 2025-02-14 10:26:55 +02:00
krishvishal
8a2c5808c2 Add TCL tests for delete 2025-02-06 23:39:12 +05:30
Zaid Humayun
6a863b3da9 printf: this commit adds support for https://github.com/tursodatabase/limbo/issues/885 tracking printf functionality
this commit introduces basic support for printf functionality and doesn't include advanced modifiers like width etc.
2025-02-04 20:05:14 +05:30
ben594
847617df63 Created TCL tests for select queries with offset 2025-01-26 16:40:30 -05:00
ben594
a54222d12b Created basic tcl tests for changes and total_changes 2025-01-19 20:51:16 -05:00
psvri
bfadd30f54 Add compare tests 2025-01-18 15:51:31 +05:30
Jussi Saurio
2066475e03 feat: subqueries in FROM clause 2024-12-31 14:18:29 +02:00
Lauri Virtanen
1b2835b316 Add math operator compatibility tests 2024-11-24 22:12:23 +02:00
Pere Diaz Bou
800354144a remove extra join test 2024-11-12 23:11:04 +00:00
rjhallsted
af09f0b7f4 Add testing 2024-09-16 16:18:26 -07:00
jussisaurio
a108dea825 GROUP BY 2024-09-14 16:14:45 +03:00
sonhmai
c32bb91dd5 core: support modifiers in time function 2024-08-24 18:31:34 +07:00
Kim Seon Woo
c6402aa341 Add tcl 2024-08-18 21:00:36 +02:00
jussisaurio
d70eb6b3d7 fix seekrowid operator not emitting result when root 2024-08-17 09:16:24 +03:00
JeanArhancet
4d0a25c1b4 test: add json tcl test 2024-08-04 10:56:52 +02:00
Bennett Clement
5b4bdc8aa3 Fix .schema
- Add tests for .schema
- Make command line sql arguments to allow .commands
2024-07-22 16:00:41 +08:00
Bennett Clement
2e0d4c6fdb Implement basic ORDER BY
- Only SELECT * is supported
- Only ASC is supported
2024-07-22 00:28:00 +08:00
Brayan Jules
b7c08b8fd5 feat: abs func initial implementation 2024-07-17 22:55:41 -04:00
Bennett Clement
2f738e0c8b Implement like function 2024-07-16 15:23:52 +08:00
Pekka Enberg
190e5844e7 testing: select.test 2024-07-16 07:26:44 +03:00
Pekka Enberg
fbe71cc1d7 testing: pragma.test 2024-07-16 07:24:28 +03:00
Pekka Enberg
ce1efa35eb testing: agg-functions.test 2024-07-16 07:24:28 +03:00
Pekka Enberg
75e72a4926 testing: where.test 2024-07-16 07:24:28 +03:00
Pekka Enberg
9fc48315cc testing: coalesce.test 2024-07-16 07:20:35 +03:00
Pekka Enberg
04b96a3d6c testing: join.test 2024-07-16 07:20:34 +03:00
Pere Diaz Bou
0a7d0588d7 core: implement AND and OR + complex conditions.
this also fixes NULL print to empty string

Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2024-07-15 19:42:12 +02:00
jussisaurio
d1eded0e90 Test with sqlite3 executable in CI as well 2024-07-15 17:27:04 +03:00
Pekka Enberg
4751820b2b testing: Move test harness to tester.tcl
Move the generic test harness part into a separate file.
2024-07-15 08:19:21 +03:00