Move completion extension dependency to CLI

We never need it in core anyway.
This commit is contained in:
Pekka Enberg 2025-06-29 13:19:45 +03:00
parent 592ad81c86
commit d377f4c948
6 changed files with 14 additions and 16 deletions

2
Cargo.lock generated
View file

@ -3683,6 +3683,7 @@ dependencies = [
"dirs 5.0.1",
"env_logger 0.10.2",
"libc",
"limbo_completion",
"miette",
"nu-ansi-term 0.50.1",
"rustyline",
@ -3719,7 +3720,6 @@ dependencies = [
"libc",
"libloading",
"libm",
"limbo_completion",
"limbo_crypto",
"limbo_csv",
"limbo_ipaddr",

View file

@ -28,9 +28,8 @@ ctrlc = "3.4.4"
dirs = "5.0.1"
env_logger = "0.10.1"
libc = "0.2.172"
turso_core = { path = "../core", default-features = true, features = [
"completion",
] }
turso_core = { path = "../core", default-features = true, features = [] }
limbo_completion = { path = "../extensions/completion", features = ["static"] }
miette = { version = "7.4.0", features = ["fancy"] }
nu-ansi-term = {version = "0.50.1", features = ["serde", "derive_serde_style"]}
rustyline = { version = "15.0.0", default-features = true, features = [

View file

@ -10,12 +10,9 @@ use crate::{
opcodes_dictionary::OPCODE_DESCRIPTIONS,
HISTORY_FILE,
};
use comfy_table::{Attribute, Cell, CellAlignment, ContentArrangement, Row, Table};
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use turso_core::{Database, LimboError, Statement, StepResult, Value};
use anyhow::anyhow;
use clap::Parser;
use comfy_table::{Attribute, Cell, CellAlignment, ContentArrangement, Row, Table};
use rustyline::{error::ReadlineError, history::DefaultHistory, Editor};
use std::{
fmt,
@ -27,6 +24,9 @@ use std::{
},
time::{Duration, Instant},
};
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use turso_core::{Database, LimboError, Statement, StepResult, Value};
#[derive(Parser)]
#[command(name = "limbo")]
@ -140,6 +140,12 @@ impl Limbo {
)
};
let conn = db.connect()?;
let mut ext_api = conn.build_turso_ext();
if unsafe { !limbo_completion::register_extension_static(&mut ext_api).is_ok() } {
return Err(anyhow!(
"Failed to register completion extension".to_string()
));
}
let interrupt_count = Arc::new(AtomicUsize::new(0));
{
let interrupt_count: Arc<AtomicUsize> = Arc::clone(&interrupt_count);

View file

@ -26,7 +26,6 @@ time = ["limbo_time/static"]
crypto = ["limbo_crypto/static"]
series = ["limbo_series/static"]
ipaddr = ["limbo_ipaddr/static"]
completion = ["limbo_completion/static"]
static = ["turso_ext/static"]
fuzz = []
csv = ["limbo_csv/static"]
@ -71,7 +70,6 @@ limbo_time = { workspace = true, optional = true, features = ["static"] }
limbo_crypto = { workspace = true, optional = true, features = ["static"] }
limbo_series = { workspace = true, optional = true, features = ["static"] }
limbo_ipaddr = { workspace = true, optional = true, features = ["static"] }
limbo_completion = { workspace = true, optional = true, features = ["static"] }
limbo_csv = { workspace = true, optional = true, features = ["static"] }
miette = "7.6.0"
strum = { workspace = true }

View file

@ -200,10 +200,6 @@ impl Connection {
if unsafe { !limbo_ipaddr::register_extension_static(&mut ext_api).is_ok() } {
return Err("Failed to register ipaddr extension".to_string());
}
#[cfg(feature = "completion")]
if unsafe { !limbo_completion::register_extension_static(&mut ext_api).is_ok() } {
return Err("Failed to register completion extension".to_string());
}
#[cfg(feature = "csv")]
if unsafe { !limbo_csv::register_extension_static(&mut ext_api).is_ok() } {
return Err("Failed to register csv extension".to_string());

View file

@ -2,7 +2,6 @@
cargo publish -p turso_macros
cargo publish -p turso_ext
cargo publish -p limbo_completion
cargo publish -p limbo_crypto
cargo publish -p limbo_csv
cargo publish -p limbo_percentile