Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rust): add driver manager and ability to expose Rust driver as C driver #1496

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6b5fc13
wip: write rust driver_manager
wjones127 Feb 4, 2023
744d7cd
Update dependencies
alexandreyc Jan 26, 2024
5f155c5
Fix some imports
alexandreyc Jan 26, 2024
f29a15a
Remove async methods from core traits
alexandreyc Jan 26, 2024
f197992
Remove non_camel_case_types warnings for ffi module
alexandreyc Jan 26, 2024
64ace05
Update import_info_data to return correct type
alexandreyc Jan 26, 2024
c5814e2
Update objects module to comply with newer Arrow API
alexandreyc Jan 26, 2024
11af059
Update bind_data to take &StructArray instead of RecordBatch
alexandreyc Jan 26, 2024
b96d409
Make the code compile
alexandreyc Jan 26, 2024
8671d56
cargo fmt
alexandreyc Jan 26, 2024
d1acc3a
Minor refactor of SchemaRef
alexandreyc Jan 26, 2024
1c9b3fe
Refactor info module and add support for all info data types
alexandreyc Jan 27, 2024
1e00942
Improve conversion from ArrowError to AdbcError
alexandreyc Jan 27, 2024
f0aea1b
Minor improvments to driver_manager module
alexandreyc Jan 27, 2024
2861354
Fix doctest in ffi module
alexandreyc Jan 29, 2024
f2952e8
Fix doctest in root module
alexandreyc Jan 29, 2024
0c79642
Ignore test test_connection_get_info
alexandreyc Jan 29, 2024
014d27d
Move new_statement implementation to trait for DriverConnection
alexandreyc Jan 29, 2024
ad9f2d1
Fix clippy warnings
alexandreyc Jan 29, 2024
a464193
Remove unnecessary Result return type when building DriverDatabase
alexandreyc Jan 30, 2024
d9b8876
Add impl AdbcDatabase for DriverDatabase
alexandreyc Jan 30, 2024
aec999a
Refactor get_table_types
alexandreyc Jan 30, 2024
be4df25
Fix typo in docstring
alexandreyc Jan 30, 2024
93a47fd
Minor improvements to driver manager's tests
alexandreyc Jan 30, 2024
826dd26
Fix typo in docstring
alexandreyc Feb 6, 2024
3342583
Fix bug when setting options to connection instead of database
alexandreyc Feb 15, 2024
7e06d5e
Fix clippy warning
alexandreyc Feb 15, 2024
c8cd23e
Fix some docstrings
alexandreyc Feb 15, 2024
ec650f4
Use type alias everywhere
alexandreyc Feb 15, 2024
d6010b0
Fix bug when interpreting slice of InfoData as slice of u32
alexandreyc Feb 15, 2024
25b5f56
Add test for connection_get_objects and fix bugs when building object…
alexandreyc Feb 16, 2024
f0f7c8d
Fix to call release callbacks
alexandreyc Feb 21, 2024
1ee7b6d
Add missing call to DatabaseInit
alexandreyc Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,55 @@ jobs:
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --tests
- name: Build Driver SQLite (Windows)
if: matrix.os == 'windows-latest'
working-directory: .
shell: pwsh
env:
BUILD_ALL: "0"
BUILD_DRIVER_SQLITE: "1"
ADBC_BUILD_TESTS: OFF
run: |
vcpkg --triplet x64-windows install sqlite3
$env:CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
.\ci\scripts\cpp_build.ps1 $pwd $pwd\build $pwd\rust\build
"$pwd\rust\build\bin" >> $env:GITHUB_PATH
- name: Build Driver SQLite (Unix)
if: matrix.os != 'windows-latest'
working-directory: .
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_SQLITE: "1"
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$(pwd)/rust/build"
echo "LD_LIBRARY_PATH=$(pwd)/rust/build/lib" >> $GITHUB_ENV
- name: Test
shell: bash -l {0}
run: cargo test
run: |
# MacOS library path needs to be set within action, since it is cleared
# when new processes are created.
export DYLD_LIBRARY_PATH=$(pwd)/build/lib
cargo test
- name: Check docs
run: cargo doc
miri:
# Miri is an interpreter for Rust that is used to detect undefined behavior
# in tests. However, it can only be run on tests that are entirely in Rust,
# so not on any integration tests with other languages.
name: "Rust Tests on Miri"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: miri
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo miri test --test test_implement
16 changes: 8 additions & 8 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ keywords = ["arrow", "database", "sql"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
arrow-array = { version = "44.0.0", default-features = false}
arrow-schema = { version = "44.0.0", features = ["ffi"], default-features = false}
arrow-data = { version = "44.0.0", features = ["ffi"], default-features = false}
async-trait = "0.1"
libloading = "0.7"
num_enum = "0.5"
arrow = { version = "50.0.0", features = ["ffi"], default-features = false} # Needed at least for FFI_ArrowArrayStream
arrow-array = { version = "50.0.0", default-features = false}
arrow-schema = { version = "50.0.0", features = ["ffi"], default-features = false}
arrow-data = { version = "50.0.0", features = ["ffi"], default-features = false}
libloading = "0.8"
num_enum = "0.7"
once_cell = "1"
substrait = { version = "0.5", optional = true }
substrait = { version = "0.23", optional = true }

[dev-dependencies]
itertools = "0.10"
itertools = "0.12"

[features]
substrait = ["dep:substrait"]
Loading
Loading