Commit Graph

48 Commits

Author SHA1 Message Date
pedrocarlo
edae65fb5f global allocator should not be set for library, only for executables 2025-08-07 13:41:50 -03:00
Glauber Costa
32532b4feb Add a native MCP server
The SQLite command line has facilities to ingest things like csv, and
other formats. But here we are, in 2025, and I asked Claude if Turso's
CLI should, in the same vein, have a native MCP server.

Claude told me: "You're absolutely right!" "That's a great insight!"
"That's a fantastic idea!" and then proceeded to help me with the
boilerplate for this beautiful server.

Rust has a crate, mcp_server, that implements an mcp_server trait.
However, that depends on Tokio, and I think that would bloat our binary
too much.

I have also considered implementing an MCP server that operates on a
directory and allows to list many SQLite files, but figured that would
be a good job for a more advanced and specialized server, not for the
one that comes by default with the CLI. Let's go for simple.
2025-07-17 15:05:29 -05:00
Pekka Enberg
d377f4c948 Move completion extension dependency to CLI
We never need it in core anyway.
2025-06-29 13:32:17 +03:00
Pekka Enberg
53ba3ff926 Rename limbo_core crate to turso_core 2025-06-29 09:59:17 +03:00
Pekka Enberg
a87f294f24 cli: Switch to syntect development version
Fixes #1504
2025-06-27 13:21:10 +03:00
Pekka Enberg
45c1a72d0a cli: Rename CLI to Turso 2025-06-27 12:37:42 +03:00
Pekka Enberg
018b17b6f2 Rename Limbo to Turso Database 2025-06-26 21:05:02 +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
37566d29cc cli: Remove extra binary
The `cargo-dist` tool attempts to find it but because we never build it,
packaging fails. Remove the extra binary. Probably better to work
towards making experimental indexes a runtime flag instead.
2025-06-19 09:41:01 +03:00
Pekka Enberg
14da7defbf cli: Exclude experimental binary from dist package 2025-06-18 14:58:48 +03:00
Pere Diaz Bou
9ae4563bcd index_experimental flag to enable index usages
Currently indexes are the bulk of the problem with `UPDATE` and
`DELETE`, while we work on fixing those it makes sense to disable
indexing since they are not stable. We want to try to make everything
else stable before we continue with indexing.
2025-06-17 19:33:23 +02:00
pedrocarlo
b942414bb4 add anyhow to workspace dependency 2025-06-10 10:50:39 -03:00
pedrocarlo
0f2849f7e1 serde and serde_json as workspace dependencies 2025-06-09 11:38:15 -03:00
pedrocarlo
a614114591 Config Definitions 2025-05-17 15:51:17 -03:00
pedrocarlo
277f6f1083 Switch to using std::io::IsTerminal::is_terminal 2025-04-21 01:03:31 -03:00
pedrocarlo
7aaffff45f Correct for Windows 2025-04-20 18:42:01 -03:00
pedrocarlo
b550fbb3e4 Only initialize Rustyline if we are in a tty 2025-04-20 17:03:43 -03:00
PThorpe92
01184ec1d7 Add tracing-appender to log traces to file asyncronously 2025-04-08 19:36:38 -04:00
pedrocarlo
fd3335908c basic autocomplete for dot commands 2025-04-04 13:01:57 -03:00
pedrocarlo
82db51b94f remove debug clap 2025-03-30 01:46:24 -03:00
pedrocarlo
fe25035c7c display name in clap is buggy 2025-03-30 01:46:24 -03:00
pedrocarlo
8c5b631baf nu_ansi_term to facilitate stylizing strings 2025-03-06 21:44:23 -03:00
pedrocarlo
e73cad387f adding table colors 2025-03-06 15:52:20 -03:00
pedrocarlo
b123321692 build script for syntax set dump 2025-03-06 15:52:20 -03:00
pedrocarlo
f631706ea4 simple highlighting for prompt 2025-03-06 15:52:20 -03:00
Pere Diaz Bou
9a01e32c01 add tracing_subscriber and test_log::test
I don't know when and why we dropped log::* in favor of tracing but when it was done, it made relevant logs not appear any more while debugging so... I added test_log::test which helps by automatically adding info logs from trace package.
2025-03-05 15:36:06 +01:00
pedrocarlo
04d7d8ab87 autocomplete working 2025-03-04 14:43:07 -03:00
pedrocarlo
99d979eb80 first version of vtable with keyword autocomplete 2025-03-04 14:43:07 -03:00
Pekka Enberg
c612b0932e bindings/rust: Rename crate to "limbo" 2025-02-12 16:49:53 +02:00
Pekka Enberg
e406a030e6 Merge 'Rework io_uring feature' from Jorge López Tello
This makes io_uring the default in CLI, but makes it non-default in
core. Before, if one built CLI without io_uring, core still built with
it as it was a default feature. To accommodate for the change, all
bindings have been updated to select the feature, except for WASM which
has a separate fs implementation.
This also adds some #[cfg] and #[allow] to silence unused-* warnings,
which I discovered when testing with different features disabled.

Closes #942
2025-02-09 08:46:29 +02:00
Jorge López
62dea0b12b cli: select io_uring feature by default 2025-02-09 01:11:00 +01:00
wyhaya
e9046fef78 cli: Improve pretty mode table 2025-02-09 00:01:07 +08:00
sonhmai
a090fb927a centralize Rust integration and regression tests 2025-01-21 15:41:09 +07:00
sonhmai
6243ffbab4 add dev dependencies for testing wal_checkpoint 2025-01-20 08:34:13 +07:00
sonhmai
66d6291f32 add scaffolding for supporting wal checkpoint 2025-01-20 08:34:13 +07:00
Jorge López
a17464ca5c cli: Add io_uring feature to match core 2025-01-11 15:03:26 +01:00
Samyak S Sarnayak
c09a0bcbf3 Nicer parse errors using miette
I noticed that the parse errors were a bit hard to read - only the nearest token and the line/col offsets were printed.

I made a first attempt at improving the errors using [miette](https://github.com/zkat/miette).
- Added derive for `miette::Diagnostic` to both the parser's error type and LimboError.
- Added miette dependency to both sqlite3_parser and core. The `fancy` feature is only enabled for CLI.

Some future improvements that can be made further:
- Add spans to AST nodes so that errors can better point to the correct token. See upstream issue: https://github.com/gwenn/lemon-rs/issues/33
- Construct more errors with offset information. I noticed that most parser errors are constructed with `None` as the offset.

Comparisons.
Before:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T11:22:55Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error
Parse error: near "selet": syntax error at (1, 6)
```

After:
```
❯ cargo run --package limbo --bin limbo database.db --output-mode pretty
...
limbo> selet * from a;
[2025-01-05T12:25:52Z ERROR sqlite3Parser] near "Token([115, 101, 108, 101, 116])": syntax error

  × near "selet": syntax error at (1, 6)
   ╭────
 1 │ selet * from a
   ·     ▲
   ·     ╰── syntax error
   ╰────

```
2025-01-05 17:56:59 +05:30
psvri
1f21cf6a71 Feat: Import csv support 2025-01-03 15:20:22 +05:30
Pekka Enberg
617f95c7b6 Update clap to 4.5
The Github dependabot complains about anstream, which comes through `clap`:

https://github.com/tursodatabase/limbo/security/dependabot/8
2024-12-11 14:39:27 +02:00
JeanArhancet
38a1b85094 fix: ctrl-c stop current query execution 2024-08-03 22:58:52 +02:00
Pekka Enberg
a6369982fe Enable cargo dist explicitly for the CLI only 2024-07-17 20:23:41 +03:00
Pekka Enberg
a0c92f6d80 Switch to workspace versioning 2024-07-17 08:39:36 +03:00
Pekka Enberg
725eed964b Tracing improvements 2024-01-14 15:36:59 +02:00
Pekka Enberg
9098744a37 Rename to Limbo 2023-09-30 15:40:35 +03:00
Pekka Enberg
3ec9c0be7c Implement ResultRow opcode 2023-09-02 11:40:11 +03:00
Pekka Enberg
f954729fd9 Tune prompt some more 2023-09-01 21:02:52 +03:00
Pekka Enberg
591e8df377 Disable tracing by default 2023-09-01 19:49:54 +03:00
Pekka Enberg
fb72f9688b Initial commit 2023-08-27 09:59:12 +03:00