Switch to workspace dependencies

...makes it easier to specify a version, which is needed for `cargo publish`.
This commit is contained in:
Pekka Enberg
2025-02-12 17:16:08 +02:00
parent e464f99234
commit ac54c35f92
38 changed files with 99 additions and 87 deletions

42
Cargo.lock generated
View File

@@ -1636,6 +1636,7 @@ dependencies = [
"limbo_percentile",
"limbo_regexp",
"limbo_series",
"limbo_sqlite3_parser",
"limbo_time",
"limbo_uuid",
"miette",
@@ -1656,7 +1657,6 @@ dependencies = [
"rustix",
"ryu",
"serde",
"sqlite3-parser",
"strum",
"tempfile",
"thiserror 1.0.69",
@@ -1749,6 +1749,26 @@ dependencies = [
"log",
]
[[package]]
name = "limbo_sqlite3_parser"
version = "0.0.14"
dependencies = [
"bitflags 2.8.0",
"cc",
"env_logger 0.11.6",
"fallible-iterator 0.3.0",
"indexmap",
"log",
"memchr",
"miette",
"phf",
"phf_codegen",
"phf_shared",
"strum",
"strum_macros",
"uncased",
]
[[package]]
name = "limbo_time"
version = "0.0.14"
@@ -2803,26 +2823,6 @@ version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]]
name = "sqlite3-parser"
version = "0.13.0"
dependencies = [
"bitflags 2.8.0",
"cc",
"env_logger 0.11.6",
"fallible-iterator 0.3.0",
"indexmap",
"log",
"memchr",
"miette",
"phf",
"phf_codegen",
"phf_shared",
"strum",
"strum_macros",
"uncased",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.0"

View File

@@ -33,6 +33,15 @@ repository = "https://github.com/tursodatabase/limbo"
[workspace.dependencies]
limbo_core = { path = "core", version = "0.0.14" }
limbo_crypto = { path = "extensions/crypto", version = "0.0.14" }
limbo_ext = { path = "extensions/core", version = "0.0.14" }
limbo_macros = { path = "macros", version = "0.0.14" }
limbo_percentile = { path = "extensions/percentile", version = "0.0.14" }
limbo_regexp = { path = "extensions/regexp", version = "0.0.14" }
limbo_series = { path = "extensions/series", version = "0.0.14" }
limbo_time = { path = "extensions/time", version = "0.0.14" }
limbo_uuid = { path = "extensions/uuid", version = "0.0.14" }
limbo_sqlite3_parser = { path = "vendored/sqlite3-parser", version = "0.0.14" }
# Config for 'cargo dist'
[workspace.metadata.dist]

View File

@@ -17,7 +17,7 @@ io_uring = ["limbo_core/io_uring"]
[dependencies]
limbo_core = { path = "../../core" }
limbo_core = { workspace = true }
[target.'cfg(target_os = "linux")'.dependencies]
limbo_core = { path = "../../core", features = ["io_uring"] }
limbo_core = { workspace = true, features = ["io_uring"] }

View File

@@ -37,12 +37,12 @@ mimalloc = { version = "*", default-features = false }
libloading = "0.8.6"
[dependencies]
limbo_ext = { path = "../extensions/core" }
limbo_ext = { workspace = true }
cfg_block = "0.1.1"
fallible-iterator = "0.3.0"
hex = "0.4.3"
libc = { version = "0.2.155", optional = true }
sqlite3-parser = { path = "../vendored/sqlite3-parser" }
limbo_sqlite3_parser = { workspace = true }
thiserror = "1.0.61"
getrandom = { version = "0.2.15" }
regex = "1.11.1"
@@ -55,13 +55,13 @@ serde = { version = "1.0", features = ["derive"], optional = true }
pest = { version = "2.0", optional = true }
pest_derive = { version = "2.0", optional = true }
rand = "0.8.5"
limbo_macros = { path = "../macros" }
limbo_uuid = { path = "../extensions/uuid", optional = true, features = ["static"] }
limbo_regexp = { path = "../extensions/regexp", optional = true, features = ["static"] }
limbo_percentile = { path = "../extensions/percentile", optional = true, features = ["static"] }
limbo_time = { path = "../extensions/time", optional = true, features = ["static"] }
limbo_crypto = { path = "../extensions/crypto", optional = true, features = ["static"] }
limbo_series = { path = "../extensions/series", optional = true, features = ["static"] }
limbo_macros = { workspace = true }
limbo_uuid = { workspace = true, optional = true, features = ["static"] }
limbo_regexp = { workspace = true, optional = true, features = ["static"] }
limbo_percentile = { workspace = true, optional = true, features = ["static"] }
limbo_time = { workspace = true, optional = true, features = ["static"] }
limbo_crypto = { workspace = true, optional = true, features = ["static"] }
limbo_series = { workspace = true, optional = true, features = ["static"] }
miette = "7.4.0"
strum = "0.26"
parking_lot = "0.12.3"

View File

@@ -14,7 +14,7 @@ pub enum LimboError {
ParseError(String),
#[error(transparent)]
#[diagnostic(transparent)]
LexerError(#[from] sqlite3_parser::lexer::sql::Error),
LexerError(#[from] limbo_sqlite3_parser::lexer::sql::Error),
#[error("Conversion error: {0}")]
ConversionError(String),
#[error("Env variable error: {0}")]

View File

@@ -2,7 +2,7 @@ use crate::{function::ExternalFunc, util::columns_from_create_table_body, Databa
use fallible_iterator::FallibleIterator;
use limbo_ext::{ExtensionApi, InitAggFunction, ResultCode, ScalarFunction, VTabModuleImpl};
pub use limbo_ext::{FinalizeFunction, StepFunction, Value as ExtValue, ValueType as ExtValueType};
use sqlite3_parser::{
use limbo_sqlite3_parser::{
ast::{Cmd, Stmt},
lexer::sql::Parser,
};

View File

@@ -28,9 +28,9 @@ use libloading::{Library, Symbol};
#[cfg(not(target_family = "wasm"))]
use limbo_ext::{ExtensionApi, ExtensionEntryPoint};
use limbo_ext::{ResultCode, VTabModuleImpl, Value as ExtValue};
use limbo_sqlite3_parser::{ast, ast::Cmd, lexer::sql::Parser};
use parking_lot::RwLock;
use schema::{Column, Schema};
use sqlite3_parser::{ast, ast::Cmd, lexer::sql::Parser};
use std::borrow::Cow;
use std::cell::Cell;
use std::collections::HashMap;

View File

@@ -2,8 +2,8 @@ use crate::VirtualTable;
use crate::{util::normalize_ident, Result};
use core::fmt;
use fallible_iterator::FallibleIterator;
use sqlite3_parser::ast::{Expr, Literal, TableOptions};
use sqlite3_parser::{
use limbo_sqlite3_parser::ast::{Expr, Literal, TableOptions};
use limbo_sqlite3_parser::{
ast::{Cmd, CreateTableBody, QualifiedName, ResultColumn, Stmt},
lexer::sql::Parser,
};
@@ -233,8 +233,9 @@ fn create_table(
} => {
if let Some(constraints) = constraints {
for c in constraints {
if let sqlite3_parser::ast::TableConstraint::PrimaryKey { columns, .. } =
c.constraint
if let limbo_sqlite3_parser::ast::TableConstraint::PrimaryKey {
columns, ..
} = c.constraint
{
for column in columns {
primary_key_column_names.push(match column.expr {
@@ -304,13 +305,13 @@ fn create_table(
let mut notnull = false;
for c_def in &col_def.constraints {
match &c_def.constraint {
sqlite3_parser::ast::ColumnConstraint::PrimaryKey { .. } => {
limbo_sqlite3_parser::ast::ColumnConstraint::PrimaryKey { .. } => {
primary_key = true;
}
sqlite3_parser::ast::ColumnConstraint::NotNull { .. } => {
limbo_sqlite3_parser::ast::ColumnConstraint::NotNull { .. } => {
notnull = true;
}
sqlite3_parser::ast::ColumnConstraint::Default(expr) => {
limbo_sqlite3_parser::ast::ColumnConstraint::Default(expr) => {
default = Some(expr.clone())
}
_ => {}
@@ -506,8 +507,8 @@ impl Index {
.map(|col| IndexColumn {
name: normalize_ident(&col.expr.to_string()),
order: match col.order {
Some(sqlite3_parser::ast::SortOrder::Asc) => Order::Ascending,
Some(sqlite3_parser::ast::SortOrder::Desc) => Order::Descending,
Some(limbo_sqlite3_parser::ast::SortOrder::Asc) => Order::Ascending,
Some(limbo_sqlite3_parser::ast::SortOrder::Desc) => Order::Descending,
None => Order::Ascending,
},
})

View File

@@ -1,4 +1,4 @@
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use crate::{
function::AggFunc,

View File

@@ -5,7 +5,7 @@ use crate::translate::plan::{DeletePlan, Operation, Plan};
use crate::translate::planner::{parse_limit, parse_where};
use crate::vdbe::builder::{ProgramBuilder, ProgramBuilderOpts, QueryMode};
use crate::{schema::Schema, Result, SymbolTable};
use sqlite3_parser::ast::{Expr, Limit, QualifiedName};
use limbo_sqlite3_parser::ast::{Expr, Limit, QualifiedName};
use super::plan::TableReference;

View File

@@ -1,7 +1,7 @@
// This module contains code for emitting bytecode instructions for SQL query execution.
// It handles translating high-level SQL operations into low-level bytecode that can be executed by the virtual machine.
use sqlite3_parser::ast::{self};
use limbo_sqlite3_parser::ast::{self};
use crate::function::Func;
use crate::translate::plan::{DeletePlan, Plan, Search};

View File

@@ -1,4 +1,4 @@
use sqlite3_parser::ast::{self, UnaryOperator};
use limbo_sqlite3_parser::ast::{self, UnaryOperator};
#[cfg(feature = "json")]
use crate::function::JsonFunc;

View File

@@ -1,6 +1,6 @@
use std::rc::Rc;
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use crate::{
function::AggFunc,

View File

@@ -1,6 +1,6 @@
use std::ops::Deref;
use sqlite3_parser::ast::{
use limbo_sqlite3_parser::ast::{
DistinctNames, Expr, InsertBody, QualifiedName, ResolveType, ResultColumn, With,
};
@@ -71,7 +71,7 @@ pub fn translate_insert(
let root_page = table.root_page;
let values = match body {
InsertBody::Select(select, None) => match &select.body.select.deref() {
sqlite3_parser::ast::OneSelect::Values(values) => values,
limbo_sqlite3_parser::ast::OneSelect::Values(values) => values,
_ => todo!(),
},
_ => todo!(),

View File

@@ -1,4 +1,4 @@
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use crate::{
schema::Table,

View File

@@ -32,9 +32,9 @@ use crate::vdbe::builder::{CursorType, ProgramBuilderOpts, QueryMode};
use crate::vdbe::{builder::ProgramBuilder, insn::Insn, Program};
use crate::{bail_parse_error, Connection, LimboError, Result, SymbolTable};
use insert::translate_insert;
use limbo_sqlite3_parser::ast::{self, fmt::ToTokens};
use limbo_sqlite3_parser::ast::{Delete, Insert};
use select::translate_select;
use sqlite3_parser::ast::{self, fmt::ToTokens};
use sqlite3_parser::ast::{Delete, Insert};
use std::cell::RefCell;
use std::fmt::Display;
use std::rc::{Rc, Weak};

View File

@@ -1,6 +1,6 @@
use std::{collections::HashMap, rc::Rc};
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use crate::{
schema::{Index, Schema},

View File

@@ -1,6 +1,6 @@
use std::rc::Rc;
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use crate::{
schema::{Column, PseudoTable},

View File

@@ -1,5 +1,5 @@
use core::fmt;
use sqlite3_parser::ast;
use limbo_sqlite3_parser::ast;
use std::{
fmt::{Display, Formatter},
rc::Rc,

View File

@@ -13,7 +13,7 @@ use crate::{
vdbe::BranchOffset,
Result, VirtualTable,
};
use sqlite3_parser::ast::{
use limbo_sqlite3_parser::ast::{
self, Expr, FromClause, JoinType, Limit, Materialized, UnaryOperator, With,
};

View File

@@ -1,8 +1,8 @@
//! VDBE bytecode generation for pragma statements.
//! More info: https://www.sqlite.org/pragma.html.
use sqlite3_parser::ast;
use sqlite3_parser::ast::PragmaName;
use limbo_sqlite3_parser::ast;
use limbo_sqlite3_parser::ast::PragmaName;
use std::cell::RefCell;
use std::rc::Rc;

View File

@@ -12,8 +12,8 @@ use crate::util::normalize_ident;
use crate::vdbe::builder::{ProgramBuilderOpts, QueryMode};
use crate::SymbolTable;
use crate::{schema::Schema, vdbe::builder::ProgramBuilder, Result};
use sqlite3_parser::ast::{self};
use sqlite3_parser::ast::{ResultColumn, SelectInner};
use limbo_sqlite3_parser::ast::{self};
use limbo_sqlite3_parser::ast::{ResultColumn, SelectInner};
pub fn translate_select(
query_mode: QueryMode,

View File

@@ -1,4 +1,4 @@
use sqlite3_parser::ast::{self, CreateTableBody, Expr, FunctionTail, Literal};
use limbo_sqlite3_parser::ast::{self, CreateTableBody, Expr, FunctionTail, Literal};
use std::{rc::Rc, sync::Arc};
use crate::{
@@ -351,13 +351,15 @@ pub fn columns_from_create_table_body(body: ast::CreateTableBody) -> Result<Vec<
.constraints
.iter()
.find_map(|c| match &c.constraint {
sqlite3_parser::ast::ColumnConstraint::Default(val) => Some(val.clone()),
limbo_sqlite3_parser::ast::ColumnConstraint::Default(val) => {
Some(val.clone())
}
_ => None,
}),
notnull: column_def.constraints.iter().any(|c| {
matches!(
c.constraint,
sqlite3_parser::ast::ColumnConstraint::NotNull { .. }
limbo_sqlite3_parser::ast::ColumnConstraint::NotNull { .. }
)
}),
ty_str: column_def
@@ -368,7 +370,7 @@ pub fn columns_from_create_table_body(body: ast::CreateTableBody) -> Result<Vec<
primary_key: column_def.constraints.iter().any(|c| {
matches!(
c.constraint,
sqlite3_parser::ast::ColumnConstraint::PrimaryKey { .. }
limbo_sqlite3_parser::ast::ColumnConstraint::PrimaryKey { .. }
)
}),
is_rowid_alias: false,
@@ -381,7 +383,7 @@ pub fn columns_from_create_table_body(body: ast::CreateTableBody) -> Result<Vec<
#[cfg(test)]
pub mod tests {
use super::*;
use sqlite3_parser::ast::{self, Expr, Id, Literal, Operator::*, Type};
use limbo_sqlite3_parser::ast::{self, Expr, Id, Literal, Operator::*, Type};
#[test]
fn test_normalize_ident() {

View File

@@ -12,4 +12,4 @@ default = []
static = []
[dependencies]
limbo_macros = { path = "../../macros" }
limbo_macros = { workspace = true }

View File

@@ -15,7 +15,7 @@ static= [ "limbo_ext/static" ]
[dependencies]
blake3 = "1.5.5"
data-encoding = "2.7.0"
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
md5 = "0.7.0"
ring = "0.17.8"
urlencoding = "2.1.3"

View File

@@ -13,7 +13,7 @@ crate-type = ["cdylib", "lib"]
static = ["limbo_ext/static"]
[dependencies]
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
mimalloc = { version = "*", default-features = false }

View File

@@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]
[dependencies]
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
regex = "1.11.1"
[target.'cfg(not(target_family = "wasm"))'.dependencies]

View File

@@ -14,7 +14,7 @@ crate-type = ["cdylib", "lib"]
[dependencies]
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
mimalloc = { version = "*", default-features = false }

View File

@@ -17,7 +17,7 @@ mimalloc = { version = "*", default-features = false }
[dependencies]
chrono = "0.4.39"
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
strum = "0.26.3"
strum_macros = "0.26.3"
thiserror = "2.0.11"

View File

@@ -13,7 +13,7 @@ crate-type = ["cdylib", "lib"]
static= [ "limbo_ext/static" ]
[dependencies]
limbo_ext = { path = "../core", features = ["static"] }
limbo_ext = { workspace = true, features = ["static"] }
uuid = { version = "1.11.0", features = ["v4", "v7"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies]

View File

@@ -1,7 +1,7 @@
[package]
name = "sqlite3-parser"
version = "0.13.0"
edition = "2021"
name = "limbo_sqlite3_parser"
version.workspace = true
edition.workspace = true
authors = ["gwenn"]
description = "SQL parser (as understood by SQLite)"
documentation = "http://docs.rs/sqlite3-parser"

View File

@@ -2,7 +2,7 @@
#![feature(test)]
extern crate test;
use sqlite3_parser::dialect::keyword_token;
use limbo_sqlite3_parser::dialect::keyword_token;
use test::Bencher;
static VALUES: [&[u8]; 136] = [

View File

@@ -3,7 +3,7 @@ use std::env;
use std::fs::read;
use std::panic;
use sqlite3_parser::lexer::sql::Parser;
use limbo_sqlite3_parser::lexer::sql::Parser;
/// Parse specified files and check all commands.
fn main() {

View File

@@ -1,7 +1,7 @@
use std::env;
use fallible_iterator::FallibleIterator;
use sqlite3_parser::lexer::sql::Parser;
use limbo_sqlite3_parser::lexer::sql::Parser;
/// Parse args.
// RUST_LOG=sqlite3Parser=debug

View File

@@ -4,8 +4,8 @@ use std::fs::read;
use std::panic;
#[cfg(not(feature = "YYNOERRORRECOVERY"))]
use sqlite3_parser::lexer::sql::Error;
use sqlite3_parser::lexer::sql::Parser;
use limbo_sqlite3_parser::lexer::sql::Error;
use limbo_sqlite3_parser::lexer::sql::Parser;
/// Parse specified files and print all commands.
fn main() {

View File

@@ -1,5 +1,5 @@
use sqlite3_parser::lexer::sql::{TokenType, Tokenizer};
use sqlite3_parser::lexer::Scanner;
use limbo_sqlite3_parser::lexer::sql::{TokenType, Tokenizer};
use limbo_sqlite3_parser::lexer::Scanner;
use std::env;
use std::fs::read;

View File

@@ -12,7 +12,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
use fallible_iterator::FallibleIterator;
use sqlite3_parser::lexer::sql::Parser;
use limbo_sqlite3_parser::lexer::sql::Parser;
fn basic_queries(c: &mut Criterion) {
let mut group = c.benchmark_group("sqlparser-rs parsing benchmark");

View File

@@ -304,8 +304,8 @@ impl Tokenizer {
}
/// ```rust
/// use sqlite3_parser::lexer::sql::Tokenizer;
/// use sqlite3_parser::lexer::Scanner;
/// use limbo_sqlite3_parser::lexer::sql::Tokenizer;
/// use limbo_sqlite3_parser::lexer::Scanner;
///
/// let tokenizer = Tokenizer::new();
/// let input = b"PRAGMA parser_trace=ON;";