Commit Graph

774 Commits

Author SHA1 Message Date
jussisaurio
69f549d2b9 remove unnecessary unwrap_or 2024-08-17 09:07:29 +03:00
jussisaurio
2e7f240bb5 use table_columns() for seekrowid result_columns() 2024-08-17 09:04:27 +03:00
jussisaurio
25033d280c more accurate variable name 2024-08-16 19:58:59 +03:00
jussisaurio
17cc3717c8 rebase 2024-08-16 19:43:29 +03:00
jussisaurio
069826820e Finish renaming node -> operator 2024-08-16 19:42:03 +03:00
jussisaurio
97dc98336c fix comment 2024-08-16 19:42:03 +03:00
jussisaurio
e7cc04e157 Operator comments 2024-08-16 19:42:03 +03:00
jussisaurio
4c016b042b comment about bitmasks 2024-08-16 19:42:03 +03:00
jussisaurio
1130ccf203 mutable out parameter 2024-08-16 19:42:03 +03:00
jussisaurio
2d35641b86 whitespace 2024-08-16 19:42:03 +03:00
jussisaurio
989066eedf remove duplicate test after rebase 2024-08-16 19:42:03 +03:00
jussisaurio
9ab08ee2e6 is_rowid_alias instead of primary_key 2024-08-16 19:42:03 +03:00
jussisaurio
2e32ca0bdb More structured query planner 2024-08-16 19:42:03 +03:00
Pekka Enberg
c2944f6eeb Merge 'Add support for concat scalar function' from Kim Seon Woo
Add support for concat scalar function

### EXPLAIN SELECT concat('a', 1.5, 'b')
![image](https://github.com/user-attachments/assets/628e0e81-91bc-4533-9091-ded99dd20e0e)

## Related issue
https://github.com/penberg/limbo/issues/144

Closes #291
2024-08-16 16:37:38 +03:00
Kim Seon Woo
48d3c05fb0 Rebase 2024-08-16 21:40:30 +09:00
Pekka Enberg
a5bdfb62b8 Bump cargo-dist to 0.21.0 2024-08-16 14:42:24 +03:00
Pekka Enberg
cad0cd66d0 Update CHANGELOG.md 2024-08-16 14:38:53 +03:00
Pekka Enberg
c9c0d2808c Merge 'Add support for ifnull scalar function' from Kim Seon Woo
Add support for `ifnull` scalar function

### EXPLAIN SELECT ifnull(null, 20);
![image](https://github.com/user-attachments/assets/e367638f-9d70-4dfc-989d-7290b842c2ec)

### Related issue
https://github.com/penberg/limbo/issues/144

Closes #290
2024-08-16 14:37:08 +03:00
Pekka Enberg
ba3acedbc8 Merge 'Add support for substr scalar function' from Kim Seon Woo
Add support for `substr` scalar function. We can reuse the `substring` logic which is already implemted.

## Related issue
https://github.com/penberg/limbo/issues/144

Closes #289
2024-08-16 14:36:55 +03:00
Pekka Enberg
4992d81a32 Merge 'Implement char function support' from Kim Seon Woo
Implement (scalar) char function support

### EXPLAIN SELECT char(108, 105);
![image](https://github.com/user-attachments/assets/c2270bbe-8a0b-43a0-af39-1198f6cbf88d)

### EXPLAIN SELECT char();
![image](https://github.com/user-attachments/assets/a705bd3b-bce8-4524-9d6d-a8b72e950a43)

### EXPLAIN SELECT char(null);
![image](https://github.com/user-attachments/assets/c65c395e-f2dd-42f8-b64a-45f20711d1ac)

### EXPLAIN SELECT char('a');
![image](https://github.com/user-attachments/assets/e7bfc05b-17b3-4c1b-9d8e-fe4c89614afc)

## Related Issue
https://github.com/penberg/limbo/issues/144

Closes #288
2024-08-16 14:36:32 +03:00
김선우
10d452de2a Nit 2024-08-16 09:27:38 +09:00
김선우
8fbcd10e0e Add support for ifnull scalar function 2024-08-16 09:25:04 +09:00
김선우
27d9af2bf4 Add support for substr scalar function 2024-08-16 08:26:42 +09:00
김선우
fe526e118e Nit 2024-08-16 06:43:55 +09:00
김선우
ced664621f Allow char function to have empty args 2024-08-16 06:33:18 +09:00
김선우
77c3d130f3 Add char function support 2024-08-16 06:26:06 +09:00
Pekka Enberg
39e77bac9f Merge 'Implement scala function substring(...) ' from Kim Seon Woo
Implement scala function `substring(x, y, z)` and `substring(x, y)`

### EXPLAIN SELECT substring('limbo', 3);
![image](https://github.com/user-attachments/assets/0138d802-c40e-4990-8657-05a0d54ee00f)

### EXPLAIN SELECT substring('limbo', 1, 2);
![image](https://github.com/user-attachments/assets/1babeb1b-f5ca-4b8f-ae19-c4f06b51d4b6)

### Related issue
https://github.com/penberg/limbo/issues/144

Closes #286
2024-08-15 19:45:22 +03:00
Pekka Enberg
a57870ed03 Merge 'Fix typo ' from Kim Seon Woo
Closes #287
2024-08-15 19:43:13 +03:00
Pekka Enberg
e30b5f1082 Commit updated Cargo.lock and sqlite3.h
Turns out the new cbindgen version generates slightly different
sqlite3.h so commit that to the tree. The version in Cargo.lock also
changed so let's check in that too.
2024-08-15 19:42:10 +03:00
김선우
ac440495bd Nit 2024-08-15 18:59:46 +09:00
김선우
28bd0275c0 Run cargo fmt, clippy 2024-08-15 18:56:02 +09:00
김선우
aff13de125 Nit 2024-08-15 18:50:40 +09:00
김선우
dc48c2e71d Add substring scala function with 2 arg 2024-08-15 18:47:32 +09:00
김선우
3fa3c5c002 Add substr scala function 2024-08-15 18:27:18 +09:00
Pekka Enberg
08c1e13679 Merge 'Handle count(*)' from Vegard Stikbakke
This PR adds support for `count(*)`. I did not find any other functions than `count` which expect a `*` argument yet, but I'm sure there are some?

Surprisingly (to me) I did not need to make any changes to `translate_expr`, only to `analyze_expr`.

```
limbo> SELECT count(id) FROM users;
2
limbo> SELECT count(*) FROM users;
2
limbo> SELECT count(*) FROM users where id = 1;
1
limbo> SELECT count(id) FROM users where id = 1;
1
```

Other aggregation functions such as sum fail, since they expect a specific column:
```
limbo> select sum(*) from users;
Parse error: sum bad number of arguments
```

Closes #285
2024-08-11 16:57:18 +03:00
Vegard Stikbakke
e54fd83f49 Handle FunctionCallStar in analyze_expr 2024-08-11 13:59:49 +02:00
Pekka Enberg
f75b43f28e Merge 'Add to sqlite3 static lib to cargo dist bundle' from Pekka Enberg
Closes #222
2024-08-11 12:22:28 +03:00
Pekka Enberg
f633fc91cf sqlite3: Add to cargo dist bundle 2024-08-11 12:14:43 +03:00
Pekka Enberg
3f96b1d798 Merge 'Initial pass on Python API' from Jean Arhancet
This pull request introduces the initial setup for the Python bindings
(#248).

- Setup Configuration: Added the Python binding stack, including the
  `pyo3 `crates, `pyproject.toml`, `build.rs`, and other necessary
  files.

- Database Class: Implemented the Database class with a constructor to
  establish a connection and a query function to execute SQL queries.

- Testing: Created `database.db` with a sample users table and two
  entries, as outlined in README.md, and added three pytest functions to
  validate the Python output.

Closes #276
2024-08-11 12:09:27 +03:00
JeanArhancet
7c362b129f feat: impl python binding
refactor: pep-0249

refactor: rust comment and requirements-dev.txt

fix: name conflict
2024-08-11 08:58:18 +02:00
Pekka Enberg
fc1f61acf9 Merge 'Use limbo instead of cargo run in command in README' from Vegard Stikbakke
Use `limbo` instead of `cargo run` in the example command in the README
since we've already installed the program and have it on our path.

Closes #284
2024-08-10 21:34:20 +03:00
Vegard Stikbakke
16f1e9c40b Use limbo instead of cargo run in command in README
Use `limbo` instead of `cargo run` in the example command in the README since we've already installed the program and have it on our path.
2024-08-10 20:24:02 +02:00
Pekka Enberg
5083ba8ae9 Merge 'Update cbindgen dependency' from Pekka Enberg
Fixes #63

Closes #282
2024-08-10 14:53:07 +03:00
Pekka Enberg
5219fc7258 Update cbindgen dependency
Fixes #63
2024-08-10 14:29:20 +03:00
Pekka Enberg
896651229a Merge 'github: Cache Rust build dependencies' from Pekka Enberg
Let's use a Github action to cache build dependencies in hopes to reduce
disk utilization.

Closes #280
2024-08-10 08:40:49 +03:00
Pekka Enberg
f3fc55eb8d github: Cache Rust build dependencies
Let's use a Github action to cache build dependencies in hopes to reduce
disk utilization.
2024-08-10 08:34:11 +03:00
Pekka Enberg
6b78573f79 Merge 'Implement NewRowid' from GV
Fixes https://github.com/penberg/limbo/issues/275

Closes #278
2024-08-09 21:18:10 +03:00
gandeevanr
23a7d389b1 added unit tests for NewRowid 2024-08-08 19:04:10 -07:00
gandeevanr
a9cb8157b5 initial pass at implementing NewRowId 2024-08-07 09:04:09 -07:00
Pekka Enberg
0cb45d4ebb Merge 'core: add datetime modifiers helpers.' from Sonny
Adding the foundational helpers for integrating with supporting datetime Functions modifiers later.
part of https://github.com/penberg/limbo/issues/158.

Integrating with date time functions in `vdbe` `Program.step` will come in other PRs later.
reference to sqlite eaa560f3fc/src/date.c (L723)

Closes #277
2024-08-07 16:20:53 +03:00