mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Move completion extension dependency to CLI
We never need it in core anyway.
This commit is contained in:
parent
592ad81c86
commit
d377f4c948
6 changed files with 14 additions and 16 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -3683,6 +3683,7 @@ dependencies = [
|
||||||
"dirs 5.0.1",
|
"dirs 5.0.1",
|
||||||
"env_logger 0.10.2",
|
"env_logger 0.10.2",
|
||||||
"libc",
|
"libc",
|
||||||
|
"limbo_completion",
|
||||||
"miette",
|
"miette",
|
||||||
"nu-ansi-term 0.50.1",
|
"nu-ansi-term 0.50.1",
|
||||||
"rustyline",
|
"rustyline",
|
||||||
|
@ -3719,7 +3720,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"libloading",
|
"libloading",
|
||||||
"libm",
|
"libm",
|
||||||
"limbo_completion",
|
|
||||||
"limbo_crypto",
|
"limbo_crypto",
|
||||||
"limbo_csv",
|
"limbo_csv",
|
||||||
"limbo_ipaddr",
|
"limbo_ipaddr",
|
||||||
|
|
|
@ -28,9 +28,8 @@ ctrlc = "3.4.4"
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
env_logger = "0.10.1"
|
env_logger = "0.10.1"
|
||||||
libc = "0.2.172"
|
libc = "0.2.172"
|
||||||
turso_core = { path = "../core", default-features = true, features = [
|
turso_core = { path = "../core", default-features = true, features = [] }
|
||||||
"completion",
|
limbo_completion = { path = "../extensions/completion", features = ["static"] }
|
||||||
] }
|
|
||||||
miette = { version = "7.4.0", features = ["fancy"] }
|
miette = { version = "7.4.0", features = ["fancy"] }
|
||||||
nu-ansi-term = {version = "0.50.1", features = ["serde", "derive_serde_style"]}
|
nu-ansi-term = {version = "0.50.1", features = ["serde", "derive_serde_style"]}
|
||||||
rustyline = { version = "15.0.0", default-features = true, features = [
|
rustyline = { version = "15.0.0", default-features = true, features = [
|
||||||
|
|
16
cli/app.rs
16
cli/app.rs
|
@ -10,12 +10,9 @@ use crate::{
|
||||||
opcodes_dictionary::OPCODE_DESCRIPTIONS,
|
opcodes_dictionary::OPCODE_DESCRIPTIONS,
|
||||||
HISTORY_FILE,
|
HISTORY_FILE,
|
||||||
};
|
};
|
||||||
use comfy_table::{Attribute, Cell, CellAlignment, ContentArrangement, Row, Table};
|
use anyhow::anyhow;
|
||||||
use tracing_appender::non_blocking::WorkerGuard;
|
|
||||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
|
|
||||||
use turso_core::{Database, LimboError, Statement, StepResult, Value};
|
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use comfy_table::{Attribute, Cell, CellAlignment, ContentArrangement, Row, Table};
|
||||||
use rustyline::{error::ReadlineError, history::DefaultHistory, Editor};
|
use rustyline::{error::ReadlineError, history::DefaultHistory, Editor};
|
||||||
use std::{
|
use std::{
|
||||||
fmt,
|
fmt,
|
||||||
|
@ -27,6 +24,9 @@ use std::{
|
||||||
},
|
},
|
||||||
time::{Duration, Instant},
|
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)]
|
#[derive(Parser)]
|
||||||
#[command(name = "limbo")]
|
#[command(name = "limbo")]
|
||||||
|
@ -140,6 +140,12 @@ impl Limbo {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
let conn = db.connect()?;
|
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::new(AtomicUsize::new(0));
|
||||||
{
|
{
|
||||||
let interrupt_count: Arc<AtomicUsize> = Arc::clone(&interrupt_count);
|
let interrupt_count: Arc<AtomicUsize> = Arc::clone(&interrupt_count);
|
||||||
|
|
|
@ -26,7 +26,6 @@ time = ["limbo_time/static"]
|
||||||
crypto = ["limbo_crypto/static"]
|
crypto = ["limbo_crypto/static"]
|
||||||
series = ["limbo_series/static"]
|
series = ["limbo_series/static"]
|
||||||
ipaddr = ["limbo_ipaddr/static"]
|
ipaddr = ["limbo_ipaddr/static"]
|
||||||
completion = ["limbo_completion/static"]
|
|
||||||
static = ["turso_ext/static"]
|
static = ["turso_ext/static"]
|
||||||
fuzz = []
|
fuzz = []
|
||||||
csv = ["limbo_csv/static"]
|
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_crypto = { workspace = true, optional = true, features = ["static"] }
|
||||||
limbo_series = { workspace = true, optional = true, features = ["static"] }
|
limbo_series = { workspace = true, optional = true, features = ["static"] }
|
||||||
limbo_ipaddr = { 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"] }
|
limbo_csv = { workspace = true, optional = true, features = ["static"] }
|
||||||
miette = "7.6.0"
|
miette = "7.6.0"
|
||||||
strum = { workspace = true }
|
strum = { workspace = true }
|
||||||
|
|
|
@ -200,10 +200,6 @@ impl Connection {
|
||||||
if unsafe { !limbo_ipaddr::register_extension_static(&mut ext_api).is_ok() } {
|
if unsafe { !limbo_ipaddr::register_extension_static(&mut ext_api).is_ok() } {
|
||||||
return Err("Failed to register ipaddr extension".to_string());
|
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")]
|
#[cfg(feature = "csv")]
|
||||||
if unsafe { !limbo_csv::register_extension_static(&mut ext_api).is_ok() } {
|
if unsafe { !limbo_csv::register_extension_static(&mut ext_api).is_ok() } {
|
||||||
return Err("Failed to register csv extension".to_string());
|
return Err("Failed to register csv extension".to_string());
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
cargo publish -p turso_macros
|
cargo publish -p turso_macros
|
||||||
cargo publish -p turso_ext
|
cargo publish -p turso_ext
|
||||||
cargo publish -p limbo_completion
|
|
||||||
cargo publish -p limbo_crypto
|
cargo publish -p limbo_crypto
|
||||||
cargo publish -p limbo_csv
|
cargo publish -p limbo_csv
|
||||||
cargo publish -p limbo_percentile
|
cargo publish -p limbo_percentile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue