Skip to content

Commit

Permalink
Support table function (#138)
Browse files Browse the repository at this point in the history
* impl table function

Change-Id: I0f51ba2ba0de2d0195d4736feea8ea2d76492166

* delete comment

Change-Id: I95981c1a37264a87bc43ed2c96b3ddb13d36f8e7

* fix clippy

Change-Id: Id55d4df2362a5e9614df0018bbade9f556828e81

* handle empty

Change-Id: I465048afcba7e8a177a428002bfdcfaffc255648

* fix clippy

Change-Id: I3138b7dcc60f05f75251f8c32adf7fb5f1230a75

* impl to_string

Change-Id: If7292f0a3965d052aab84dd1093cd6f39da7849e

* vtab don't need bundled

Change-Id: I146e67dcc745070b83dcd668edddec2fa687ea24

* try fix mem error

Change-Id: I1633861e71ee40f57cd925a7a3cca535a6168db2

* fix mem

Change-Id: I396bcb0ddf1a31a3c01e44314b1853322554810c

* allow clippy

Change-Id: I353dfdaf876d84a51d51090365ee1fe8e4aa7135

* asan without excel

Change-Id: I44ca4dc59d9727a3e33532c2336549bea0f3de56

* add excel

Change-Id: Id407e9001a965e212b3d595c330b9a24433f61da

* fix mem leak

Change-Id: I0715c8c592800045934ff95255786a64526b076d

* delete unused comment

Change-Id: I258fbd5e31f52cad8986bf731574de0a7e614d89
  • Loading branch information
wangfenjin authored Mar 17, 2023
1 parent d231b27 commit de21ea1
Show file tree
Hide file tree
Showing 19 changed files with 7,196 additions and 578 deletions.
1 change: 1 addition & 0 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ignore:
- "libduckdb-sys/duckdb"
- "libduckdb-sys/src/bindgen_bundled_version.rs"
coverage:
status:
project:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
# Intentionally omit time feature until we're on time 0.3, at which
# point it should be added to `bundled-full`.
args: '--features "buildtime_bindgen modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
args: '--features "buildtime_bindgen modern-full vtab-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
version: 0.22.0
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
Expand All @@ -90,7 +90,7 @@ jobs:
value: $env:PATH;${{ github.workspace }}/libduckdb
- name: Run cargo-test
if: matrix.os == 'windows-latest'
run: cargo test --features "buildtime_bindgen modern-full"
run: cargo test --features "modern-full vtab-full"
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
Expand All @@ -115,7 +115,7 @@ jobs:
with:
rust-version: stable
targets: x86_64-pc-windows-msvc
- run: cargo test --features "bundled modern-full extensions-full"
- run: cargo test --features "modern-full extensions-full"

Sanitizer:
name: Address Sanitizer
Expand All @@ -138,7 +138,7 @@ jobs:
# leak sanitization, but we don't care about backtraces here, so long
# as the other tests have them.
RUST_BACKTRACE: "0"
run: cargo -Z build-std test --features "bundled modern-full extensions-full" --target x86_64-unknown-linux-gnu
run: cargo -Z build-std test --features "modern-full extensions-full" --target x86_64-unknown-linux-gnu

- uses: wangfenjin/publish-crates@main
name: cargo publish --dry-run
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ Cargo.lock
.ccls-cache/

*.db

libduckdb-sys/duckdb-sources/
libduckdb-sys/duckdb/
libduckdb-sys/._duckdb
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ bundled = ["libduckdb-sys/bundled"]
httpfs = ["libduckdb-sys/httpfs", "bundled"]
json = ["libduckdb-sys/json", "bundled"]
parquet = ["libduckdb-sys/parquet", "bundled"]
extensions-full = ["httpfs", "json", "parquet"]

vtab = []
excel = ["vtab", "calamine"]
vtab-full = ["excel"]
extensions-full = ["httpfs", "json", "parquet", "vtab-full"]
buildtime_bindgen = ["libduckdb-sys/buildtime_bindgen"]
modern-full = [
"chrono",
Expand Down Expand Up @@ -56,6 +58,7 @@ arrow = { version = "35", default-features = false, features = ["prettyprint", "
rust_decimal = "1.14"
strum = { version = "0.24", features = ["derive"] }
r2d2 = { version = "0.8.9", optional = true }
calamine = { version = "0.19.1", optional = true }

[dev-dependencies]
doc-comment = "0.3"
Expand Down
Binary file added examples/Movies_Social_metadata.xlsx
Binary file not shown.
Binary file added examples/date.xlsx
Binary file not shown.
2 changes: 0 additions & 2 deletions libduckdb-sys/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions libduckdb-sys/bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export DU_INCLUDE_DIR="$DUCKDB_LIB_DIR"
# rm -f libduckdb-src.zip

# Regenerate bindgen file for DUCKDB
rm -f "$DUCKDB_LIB_DIR/bindgen_bundled_version.rs"
rm -f "$SCRIPT_DIR/src/bindgen_bundled_version.rs"
cargo update
# Just to make sure there is only one bindgen.rs file in target dir
find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec rm {} \;
env LIBDUCKDB_SYS_BUNDLING=1 cargo test --features "bundled buildtime_bindgen"
find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec cp {} "$DUCKDB_LIB_DIR/bindgen_bundled_version.rs" \;
find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec cp {} "$SCRIPT_DIR/src/bindgen_bundled_version.rs" \;

# Sanity checks
# cd "$SCRIPT_DIR/.." || { echo "fatal error" >&2; exit 1; }
Expand Down
2 changes: 1 addition & 1 deletion libduckdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ mod build_linked {
let header = find_duckdb();

if !cfg!(feature = "buildtime_bindgen") {
std::fs::copy(format!("{}/bindgen_bundled_version.rs", lib_name()), out_path)
std::fs::copy("src/bindgen_bundled_version.rs", out_path)
.expect("Could not copy bindings to output directory");
} else {
#[cfg(feature = "buildtime_bindgen")]
Expand Down
Loading

0 comments on commit de21ea1

Please sign in to comment.