This PR brings the error handling of the js bindings one step closer to
better-sqlite3. There is still some work left for the error handling to
be 100% compatible.
This is my first non-trivial Rust PR, so if you have any comments that
can help me improve, please leave them on the PR.
-----
as part of https://github.com/tursodatabase/turso/issues/1900
Reviewed-by: Diego Reis (@el-yawd)
Closes#2009
This is a follow-up PR to
https://github.com/tursodatabase/turso/pull/1907#discussion_r2175959782.
I had my formatter set to `prettier` instead of `tsserver`, which seems
to be what the team is using.
So I:
* removed the `prettier-ignore` comments that I added in the other PR;
* formatted js files using `tsserver`;
* formatted md files using `prettier` (it just makes the tables nicer);
* fixed some typos;
* added some formatting info to `CONTRIBUTING.md`.
-----
as part of https://github.com/tursodatabase/turso/issues/1900Closes#1914
This PR adds tests for the
[`expand()`](https://github.com/WiseLibs/better-
sqlite3/blob/master/docs/api.md#expandtogglestate---this) method of the
better-sqlite3 API.
It can't be implemented in limbo right now, because the table names
aren't surfaced in the `Statement` object (in core).
Closes#1907
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;
```
The example is wrong (imports wrong package), but also duplicates text from
top-level README.md that will change. Let's drop this for now to avoid
confusion.