Skip to content

Commit 4f6535c

Browse files
SwoorupMaxxenMax Gabrielsson
authored
Organise workspace crates and consolidate Cargo.toml manifest properties/dependencies (#285)
* Organise workspace crates and unify Cargo.toml manifests * Update code coverage and contributing.md * double choco openssl install timeout * num_integer is not optional * move httpfs later...? * before * include dir * add note * fix memory leak in api usage test * specify crates explicitly * swap action * I guess it just doesnt work with workspace members * swap again * swap yet again * ignore unpublished change * typo --------- Co-authored-by: Max Gabrielsson <[email protected]> Co-authored-by: Max Gabrielsson <[email protected]>
1 parent 6640ff2 commit 4f6535c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+249
-196
lines changed

.github/.codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ignore:
2-
- "libduckdb-sys/duckdb"
3-
- "libduckdb-sys/src/bindgen_bundled_version.rs"
2+
- "crates/libduckdb-sys/duckdb"
3+
- "crates/libduckdb-sys/src/bindgen_bundled_version.rs"
44
coverage:
55
status:
66
project:

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
components: 'rustfmt, clippy'
2121

2222
# cargo publish
23-
- uses: wangfenjin/publish-crates@main
24-
name: cargo publish
23+
- name: publish crates
24+
uses: katyo/publish-crates@v2
2525
with:
2626
path: './'
2727
args: --no-verify --allow-dirty --all-features
2828
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
29-
ignore-published: true
29+
ignore-unpublished-changes: true
3030

3131
# create release
3232
- name: "Build Changelog"

.github/workflows/rust.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ jobs:
145145
# as the other tests have them.
146146
RUST_BACKTRACE: "0"
147147
run: cargo -Z build-std test --features "modern-full extensions-full" --target x86_64-unknown-linux-gnu
148-
- uses: wangfenjin/publish-crates@main
149-
name: cargo publish --dry-run
148+
- name: publish crates --dry-run
149+
uses: katyo/publish-crates@v2
150150
with:
151151
path: './'
152152
args: --allow-dirty --all-features
153153
dry-run: true
154-
ignore-published: true
154+
ignore-unpublished-changes: true

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Cargo.lock
2727

2828
*.db
2929

30-
libduckdb-sys/duckdb-sources/
31-
libduckdb-sys/duckdb/
32-
libduckdb-sys/._duckdb
30+
crates/libduckdb-sys/duckdb-sources/
31+
crates/libduckdb-sys/duckdb/
32+
crates/libduckdb-sys/._duckdb

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[submodule "libduckdb-sys/duckdb-sources"]
2-
path = libduckdb-sys/duckdb-sources
1+
[submodule "crates/libduckdb-sys/duckdb-sources"]
2+
path = crates/libduckdb-sys/duckdb-sources
33
url = https://github.com/duckdb/duckdb
44
update = none

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions

Cargo.toml

Lines changed: 46 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
[package]
2-
name = "duckdb"
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"crates/duckdb",
5+
"crates/libduckdb-sys",
6+
"crates/duckdb-loadable-macros"
7+
]
8+
9+
[workspace.package]
310
version = "0.10.2"
411
authors = ["wangfenjin <[email protected]>"]
512
edition = "2021"
6-
description = "Ergonomic wrapper for DuckDB"
713
repository = "https://github.com/wangfenjin/duckdb-rs"
814
homepage = "https://github.com/wangfenjin/duckdb-rs"
915
documentation = "http://docs.rs/duckdb/"
@@ -12,90 +18,46 @@ keywords = ["duckdb", "database", "ffi"]
1218
license = "MIT"
1319
categories = ["database"]
1420

15-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
16-
17-
[lib]
18-
name = "duckdb"
19-
20-
[workspace]
21-
members = ["libduckdb-sys", "duckdb-loadable-macros"]
22-
23-
[features]
24-
default = []
25-
bundled = ["libduckdb-sys/bundled"]
26-
httpfs = ["libduckdb-sys/httpfs", "bundled"]
27-
json = ["libduckdb-sys/json", "bundled"]
28-
parquet = ["libduckdb-sys/parquet", "bundled"]
29-
vtab = []
30-
vtab-loadable = ["vtab", "duckdb-loadable-macros"]
31-
vtab-excel = ["vtab", "calamine"]
32-
vtab-arrow = ["vtab", "num"]
33-
appender-arrow = ["vtab-arrow"]
34-
vtab-full = ["vtab-excel", "vtab-arrow", "appender-arrow"]
35-
extensions-full = ["httpfs", "json", "parquet", "vtab-full"]
36-
buildtime_bindgen = ["libduckdb-sys/buildtime_bindgen"]
37-
modern-full = ["chrono", "serde_json", "url", "r2d2", "uuid", "polars"]
38-
polars = ["dep:polars"]
39-
chrono = ["dep:chrono", "num-integer"]
40-
41-
[dependencies]
42-
# time = { version = "0.3.2", features = ["formatting", "parsing"], optional = true }
43-
hashlink = "0.8"
44-
chrono = { version = "0.4.22", optional = true }
45-
serde_json = { version = "1.0", optional = true }
46-
csv = { version = "1.1", optional = true }
47-
url = { version = "2.1", optional = true }
48-
lazy_static = { version = "1.4", optional = true }
49-
byteorder = { version = "1.3", features = ["i128"], optional = true }
21+
[workspace.dependencies]
22+
duckdb = { version = "0.10.2", path = "crates/duckdb" }
23+
libduckdb-sys = { version = "0.10.2", path = "crates/libduckdb-sys" }
24+
duckdb-loadable-macros = { version = "0.1.1", path = "crates/duckdb-loadable-macros" }
25+
autocfg = "1.0"
26+
bindgen = { version = "0.69", default-features = false }
27+
byteorder = "1.3"
28+
calamine = "0.22.0"
29+
cast = "0.3"
30+
cc = "1.0"
31+
chrono = "0.4.22"
32+
csv = "1.1"
33+
doc-comment = "0.3"
5034
fallible-iterator = "0.3"
5135
fallible-streaming-iterator = "0.1"
36+
flate2 = "1.0"
37+
hashlink = "0.8"
38+
lazy_static = "1.4"
5239
memchr = "2.3"
53-
uuid = { version = "1.0", optional = true }
54-
smallvec = "1.6.1"
55-
cast = { version = "0.3", features = ["std"] }
56-
arrow = { version = "51", default-features = false, features = ["prettyprint", "ffi"] }
40+
num = { version = "0.4", default-features = false }
41+
pkg-config = "0.3.24"
42+
polars = "0.35.4"
43+
polars-core = "0.35.4"
44+
pretty_assertions = "1.4.0"
45+
proc-macro2 = "1.0.56"
46+
quote = "1.0.21"
47+
r2d2 = "0.8.9"
48+
rand = "0.8.3"
49+
regex = "1.6"
5750
rust_decimal = "1.14"
58-
strum = { version = "0.25", features = ["derive"] }
59-
r2d2 = { version = "0.8.9", optional = true }
60-
calamine = { version = "0.22.0", optional = true }
61-
num = { version = "0.4", optional = true, default-features = false, features = ["std"] }
62-
duckdb-loadable-macros = { version = "0.1.1", path="./duckdb-loadable-macros", optional = true }
63-
polars = { version = "0.35.4", features = ["dtype-full"], optional = true}
64-
num-integer = {version = "0.1.46", optional = true}
65-
66-
[dev-dependencies]
67-
doc-comment = "0.3"
51+
serde = "1.0"
52+
serde_json = "1.0"
53+
smallvec = "1.6.1"
54+
strum = "0.25"
55+
syn = "2.0.15"
56+
tar = "0.4.38"
57+
tempdir = "0.3.7"
6858
tempfile = "3.1.0"
69-
lazy_static = "1.4"
70-
regex = "1.6"
71-
uuid = { version = "1.0", features = ["v4"] }
7259
unicase = "2.6.0"
73-
rand = "0.8.3"
74-
tempdir = "0.3.7"
75-
polars-core = "0.35.4"
76-
pretty_assertions = "1.4.0"
77-
# criterion = "0.3"
78-
79-
# [[bench]]
80-
# name = "data_types"
81-
# harness = false
82-
83-
[dependencies.libduckdb-sys]
84-
path = "libduckdb-sys"
85-
version = "0.10.2"
86-
87-
88-
[package.metadata.docs.rs]
89-
features = ['vtab', 'chrono']
90-
all-features = false
91-
no-default-features = true
92-
default-target = "x86_64-unknown-linux-gnu"
93-
94-
[package.metadata.playground]
95-
features = []
96-
all-features = false
97-
98-
[[example]]
99-
name = "hello-ext"
100-
crate-type = ["cdylib"]
101-
required-features = ["vtab-loadable"]
60+
url = "2.1"
61+
uuid = "1.0"
62+
vcpkg = "0.2"
63+
arrow = { version = "51", default-features = false }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "duckdb-loadable-macros"
3+
version = "0.1.1"
4+
authors.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
homepage.workspace = true
9+
keywords.workspace = true
10+
readme.workspace = true
11+
categories = ["external-ffi-bindings", "database"]
12+
description = "Native bindings to the libduckdb library, C API; build loadable extensions"
13+
14+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
16+
[dependencies]
17+
proc-macro2 = { workspace = true }
18+
quote = { workspace = true }
19+
syn = { workspace = true, features = ["extra-traits", "full", "fold", "parsing"] }
20+
21+
[lib]
22+
proc-macro = true

crates/duckdb-loadable-macros/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE
Lines changed: 1 addition & 0 deletions

crates/duckdb/Cargo.toml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[package]
2+
name = "duckdb"
3+
version = "0.10.2"
4+
authors.workspace = true
5+
edition.workspace = true
6+
repository.workspace = true
7+
homepage.workspace = true
8+
documentation.workspace = true
9+
readme.workspace = true
10+
keywords.workspace = true
11+
license.workspace = true
12+
categories.workspace = true
13+
description = "Ergonomic wrapper for DuckDB"
14+
15+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
16+
17+
[lib]
18+
name = "duckdb"
19+
20+
[features]
21+
default = []
22+
bundled = ["libduckdb-sys/bundled"]
23+
httpfs = ["libduckdb-sys/httpfs", "bundled"]
24+
json = ["libduckdb-sys/json", "bundled"]
25+
parquet = ["libduckdb-sys/parquet", "bundled"]
26+
vtab = []
27+
vtab-loadable = ["vtab", "duckdb-loadable-macros"]
28+
vtab-excel = ["vtab", "calamine"]
29+
vtab-arrow = ["vtab", "num"]
30+
appender-arrow = ["vtab-arrow"]
31+
vtab-full = ["vtab-excel", "vtab-arrow", "appender-arrow"]
32+
extensions-full = ["httpfs", "json", "parquet", "vtab-full"]
33+
buildtime_bindgen = ["libduckdb-sys/buildtime_bindgen"]
34+
modern-full = ["chrono", "serde_json", "url", "r2d2", "uuid", "polars"]
35+
polars = ["dep:polars"]
36+
37+
[dependencies]
38+
libduckdb-sys = { workspace = true }
39+
hashlink = { workspace = true }
40+
chrono = { workspace = true, optional = true }
41+
serde_json = { workspace = true, optional = true }
42+
csv = { workspace = true, optional = true }
43+
url = { workspace = true, optional = true }
44+
lazy_static = { workspace = true, optional = true }
45+
byteorder = { workspace = true, features = ["i128"], optional = true }
46+
fallible-iterator = { workspace = true }
47+
fallible-streaming-iterator = { workspace = true }
48+
memchr = { workspace = true }
49+
uuid = { workspace = true, optional = true }
50+
smallvec = { workspace = true }
51+
cast = { workspace = true, features = ["std"] }
52+
arrow = { workspace = true, features = ["prettyprint", "ffi"] }
53+
rust_decimal = { workspace = true }
54+
strum = { workspace = true, features = ["derive"] }
55+
r2d2 = { workspace = true, optional = true }
56+
calamine = { workspace = true, optional = true }
57+
num = { workspace = true, features = ["std"], optional = true }
58+
duckdb-loadable-macros = { workspace = true, optional = true }
59+
polars = { workspace = true, features = ["dtype-full"], optional = true }
60+
num-integer = {version = "0.1.46"}
61+
62+
[dev-dependencies]
63+
doc-comment = { workspace = true }
64+
tempfile = { workspace = true }
65+
lazy_static = { workspace = true }
66+
regex = { workspace = true }
67+
uuid = { workspace = true, features = ["v4"] }
68+
unicase = { workspace = true }
69+
rand = { workspace = true }
70+
tempdir = { workspace = true }
71+
polars-core = { workspace = true }
72+
pretty_assertions = { workspace = true }
73+
# criterion = "0.3"
74+
75+
# [[bench]]
76+
# name = "data_types"
77+
# harness = false
78+
79+
80+
[package.metadata.docs.rs]
81+
features = []
82+
all-features = false
83+
no-default-features = true
84+
default-target = "x86_64-unknown-linux-gnu"
85+
86+
[package.metadata.playground]
87+
features = []
88+
all-features = false
89+
90+
[[example]]
91+
name = "hello-ext"
92+
crate-type = ["cdylib"]
93+
required-features = ["vtab-loadable"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/lib.rs renamed to crates/duckdb/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl fmt::Debug for Connection {
566566
}
567567

568568
#[cfg(doctest)]
569-
doc_comment::doctest!("../README.md");
569+
doc_comment::doctest!("../../../README.md");
570570

571571
#[cfg(test)]
572572
mod test {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/row.rs renamed to crates/duckdb/src/row.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use std::{convert, sync::Arc};
33
use super::{Error, Result, Statement};
44
use crate::types::{self, EnumType, FromSql, FromSqlError, ListType, ValueRef};
55

6-
use arrow::array::DictionaryArray;
76
use arrow::{
8-
array::{self, Array, ArrayRef, ListArray, StructArray},
7+
array::{self, Array, ArrayRef, DictionaryArray, ListArray, StructArray},
98
datatypes::*,
109
};
1110
use fallible_iterator::FallibleIterator;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/types/value_ref.rs renamed to crates/duckdb/src/types/value_ref.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use crate::types::{FromSqlError, FromSqlResult};
44
use crate::Row;
55
use rust_decimal::prelude::*;
66

7-
use arrow::array::{Array, ArrayRef, DictionaryArray, LargeListArray, ListArray};
8-
use arrow::datatypes::{UInt16Type, UInt32Type, UInt8Type};
7+
use arrow::{
8+
array::{Array, ArrayRef, DictionaryArray, LargeListArray, ListArray},
9+
datatypes::{UInt16Type, UInt32Type, UInt8Type},
10+
};
911

1012
/// An absolute length of time in seconds, milliseconds, microseconds or nanoseconds.
1113
/// Copy from arrow::datatypes::TimeUnit
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)