Commit Graph

84 Commits

Author SHA1 Message Date
Mikaël Francoeur
2ee0132afe rename functions 2025-08-15 17:08:53 -04:00
Nikita Sivukhin
857f9147f6 enable indices in the python SDK 2025-08-13 16:10:27 +04:00
Glauber Costa
145d6eede7 Implement very basic views using DBSP
This is just the bare minimum that I needed to convince myself that this
approach will work. The only views that we support are slices of the
main table: no aggregations, no joins, no projections.

drop view is implemented.
view population is implemented.
deletes, inserts and updates are implemented.

much like indexes before, a flag must be passed to enable views.
2025-08-10 23:34:04 -05:00
Jussi Saurio
86b1232268 chore: enable indexes by default 2025-08-01 15:44:56 +03:00
Pekka Enberg
993079e39d bindings/python: Add "experimental_indexes" parameter to connect() 2025-07-21 12:49:38 +03:00
Jussi Saurio
a48b6d049a Another post-rebase clippy round with 1.88.0 2025-07-12 19:10:56 +03:00
Pekka Enberg
5216e67d53 bindings/python: Start transaction implicitly in execute()
We need to start transaction implicitly in execute() for DML statements
to make sure first transaction is actually started.

Fixes #2002
2025-07-09 10:59:52 +03:00
Pekka Enberg
b895381ae6 Revert "Merge 'Reachable assertions in Antithesis Python Test for better logging' from Pedro Muniz"
This reverts commit dbbc3f5190, reversing
changes made to 1cd5a49705. We're missing
some mandatory parameters, causing these to fail under Antithesis.
2025-07-08 17:51:12 +03:00
Pere Diaz Bou
91107d364a only close connection in case of reference count is 1
Due to how `execute` is implemented, it returns a `Connection` clone
which internally shares a turso_core::Connection with every other
Connection. Since `execute` returns `Connection` and immediatly it is
dropped, it will close connection, checkpoint and leave database in
weird state.
2025-07-08 15:19:20 +02:00
pedrocarlo
e9361c0eba add more logging to antithesis tests
format python tests
2025-07-07 19:11:55 -03:00
pedrocarlo
711b1ef114 make all run_once be run under statement or connection so that rollback is called 2025-07-07 11:51:25 -03:00
Pekka Enberg
9303244f9d bindings/python: Explicit transaction control support 2025-07-03 16:50:21 +03:00
Pekka Enberg
603e57aff8 bindings/python: Fix ROLLBACK 2025-07-03 16:36:18 +03:00
Pekka Enberg
df257d3048 Merge 'Turso, not Limbo, in pyproject.toml' from Simon Willison
https://pypi.org/project/pyturso/0.1.1/ is still showing the old name:
![CleanShot 2025-07-01 at 07 30 11@2x](https://github.com/user-
attachments/assets/a80441ec-507c-4ff7-a698-3cb88625c2cc)

Closes #1912
2025-07-02 19:33:05 +03:00
Simon Willison
a46818fda0 Turso, not Limbo, in pyproject.toml 2025-07-01 07:29:06 -07:00
PThorpe92
bbee10ba2c Add mvcc and index config to connection open api 2025-06-30 22:04:56 -04:00
PThorpe92
c2670dbd67 Use connection::from_uri method in Python bindings 2025-06-30 22:03:51 -04:00
Pekka Enberg
9c1b7897ac Fix URLs to point to github.com/tursodatabase/turso 2025-06-30 11:23:53 +03:00
Pekka Enberg
53ba3ff926 Rename limbo_core crate to turso_core 2025-06-29 09:59:17 +03:00
Pekka Enberg
a5b539f1bf bindings/python: Rename package to pyturso 2025-06-27 11:27:08 +03:00
Pekka Enberg
2fc5c0ce5c Switch to runtime flag for enabling indexes
Makes it easier to test the feature:

```
$ cargo run --  --experimental-indexes
Limbo v0.0.22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
limbo> CREATE TABLE t(x);
limbo> CREATE INDEX t_idx ON t(x);
limbo> DROP INDEX t_idx;
```
2025-06-26 10:07:28 +03:00
Pekka Enberg
2123858770 bindings/python: Add Connection.rollback() 2025-06-25 20:02:09 +03:00
Nils Koch
2827b86917 chore: fix clippy warnings 2025-06-23 19:52:13 +01:00
pedrocarlo
8b8f43334e remove python makefile as it is obsolete with UV 2025-06-20 15:59:03 -03:00
pedrocarlo
80ccca8827 ruff lint fix 2025-06-20 15:59:03 -03:00
pedrocarlo
50c8b2ca2e extract ruff lint rules to workspace 2025-06-20 15:59:03 -03:00
pedrocarlo
46135e43ce use uv in github actions 2025-06-20 15:59:03 -03:00
Pere Diaz Bou
4514bd5681 use integer primary key on test_in_memory_fetchone_select_all_users 2025-06-17 19:33:23 +02:00
Pekka Enberg
90c1e3fc06 Switch Connection to use Arc instead of Rc
Connection needs to be Arc so that bindings can wrap it with `Mutex` for
multi-threading.
2025-06-16 10:43:19 +03:00
Pekka Enberg
e3f71259d8 Rename OwnedValue -> Value
We have not had enough merge conflicts for a while so let's do a
tree-wide rename.
2025-05-15 09:59:46 +03:00
dependabot[bot]
a56e6ebc7d build(deps): bump pyo3 from 0.24.0 to 0.24.1
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.24.0 to 0.24.1.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/v0.24.1/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.24.0...v0.24.1)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.24.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-11 07:01:07 +00:00
Pere Diaz Bou
ee55116ca6 return row as reference to registers 2025-03-29 22:04:08 +01:00
Pere Diaz Bou
5b7fcd27bd make column reuse blob/text fields 2025-03-29 22:02:49 +01:00
Pere Diaz Bou
bf37fd3314 wip 2025-03-29 22:02:49 +01:00
Pere Diaz Bou
9291f60722 Introduce Register struct
OwnedValue has become a powerhouse of madness, mainly because I decided
to do it like that when I first introduced AggContext. I decided it was
enough and I introduced a `Register` struct that contains `OwnedValue`,
`Record` and `Aggregation`, this way we don't use `OwnedValue` for
everything make everyone's life harder.

This is the next step towards making ImmutableRecords the default
because I want to remove unnecessary allocations. Right now we clone
OwnedValues when we generate a record more than needed.
2025-03-27 17:53:02 +01:00
Diego Reis
160d48d34e ext/python: Workaround to file permission error
To get more info see:
https://github.com/tursodatabase/limbo/actions/runs/14039536389/job/39312362848
2025-03-24 16:39:24 -03:00
Diego Reis
6edf3dd3b1 ext/python: Makes linter happy 2025-03-24 12:40:59 -03:00
Diego Reis
9a8970b6a8 ext/python: Update example 2025-03-24 12:21:30 -03:00
Diego Reis
ab8187f4e6 ext/python: Gracefully close connection by closing it at Drop 2025-03-24 12:21:15 -03:00
Diego Reis
4ca5b11bed ext/python: Add support for Context Manager 2025-03-24 12:20:13 -03:00
Diego Reis
2ee934577f ext/python: Close connection after each test 2025-03-21 12:02:27 -03:00
Diego Reis
3c2bb6c3a8 ext/python: Fix flaky tests by creating a new db for each test and removing it after the test 2025-03-21 11:33:24 -03:00
Diego Reis
f966f7ad0e ext/python: Makes Linter happy 2025-03-20 17:40:31 -03:00
Diego Reis
16b9325830 ext/python: Basic support for placeholding insert 2025-03-20 17:10:12 -03:00
Diego Reis
2481d73d70 ext/python: Partially implements commit()
It was based on https://docs.python.org/3/library/sqlite3.html but some more work is needed specially in LEGACY_TRANSACTION_CONTROL and isolation levels.

See: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.autocommit
2025-03-20 17:09:55 -03:00
Pekka Enberg
a81ed4a523 bindings/python: Update PyO3 dependency to 0.24.0 2025-03-17 10:58:33 +02:00
Pekka Enberg
96175cccf7 cli: Add --experimental-mvcc option to enable MVCC 2025-03-06 10:16:42 +02:00
Pere Diaz Bou
8daf7666d1 Make database Sync + Send 2025-03-05 14:07:48 +01:00
Pekka Enberg
936ae307b7 core: Kill value type
We currently have two value types, `Value` and `OwnedValue`. The
original thinking was that `Value` is external type and `OwnedValue` is
internal type. However, this just results in unnecessary transformation
between the types as data crosses the Limbo library boundary.

Let's just follow SQLite here and consolidate on a single value type
(where `sqlite3_value` is just an alias for the internal `Mem` type).
The way this will eventually work is that we can have bunch of
pre-allocated `OwnedValue` objects in `ProgramState` and basically
return a reference to them all the way to the application itself, which
extracts the actual value.
2025-02-26 10:57:45 +02:00
Pekka Enberg
d0b5aca0b5 build: Don't publish some bindings crates
...attempt to fix "cargo dist" failure.
2025-02-18 19:00:11 +02:00