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 the driver manager #1803

Merged
merged 31 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
92ff41a
Add the driver manager
alexandreyc May 1, 2024
4352ed5
Dummy commit to trigger CI
alexandreyc May 1, 2024
4488d5d
Add comment about lock inversion
alexandreyc May 2, 2024
98f880c
CI: Add reusable workflows to build drivers
alexandreyc May 3, 2024
7c619e1
Improve documentation
alexandreyc May 6, 2024
751af51
Update to use `None` instead of empty array
alexandreyc May 6, 2024
38bc72a
Use `f64::default` instead of `0.0`
alexandreyc May 6, 2024
5dd08e6
Rename `get_parameters_schema` to `get_parameter_schema`
alexandreyc May 6, 2024
b63f1be
Improve `rows_affected` computation
alexandreyc May 6, 2024
86a4ae0
Update `load_dynamic` to take more general parameter type for `name`
alexandreyc May 6, 2024
47438ba
Add function to load driver from dynamic library filename
alexandreyc May 6, 2024
a345ad4
Rename `DiverManagerInner` to `ManagedDriverInner`
alexandreyc May 7, 2024
a20b8d7
Refactor and document `get_option_string` and `get_option_bytes`
alexandreyc May 7, 2024
e06f7ff
Update `set_sql_query` and `set_substrait_plan` to take `AsRef` param…
alexandreyc May 7, 2024
d48df23
Add comment about dynamic library lifetime
alexandreyc May 7, 2024
0a68802
Fix ordered list in documentation
alexandreyc May 8, 2024
9b24d87
Make the CI work on macOS and Ubuntu
alexandreyc May 13, 2024
37ad069
Fix item reference in documentation
alexandreyc May 13, 2024
17d7836
Update to take suggestions into account
alexandreyc May 13, 2024
fac9a26
Skip python flaky test
alexandreyc May 13, 2024
14a12be
Make CI almost work on windows
alexandreyc May 15, 2024
16fe37e
Unskip flaky python test
alexandreyc May 17, 2024
9000ead
Remove CI on Windows
alexandreyc May 17, 2024
c5c92c8
Upgrade to macos-latest
alexandreyc May 17, 2024
06b9677
Fix DYLD_LIBRARY_PATH on macos-latest
alexandreyc May 17, 2024
43759d5
Comment python flaky test
alexandreyc May 17, 2024
5db43fb
Add todo for CI on windows
alexandreyc May 17, 2024
3d92fa1
Fix CI for macos-latest
alexandreyc May 17, 2024
0b3c59b
Fix line too long
alexandreyc May 17, 2024
5eaeaef
Add `macos-13` to the CI
alexandreyc May 22, 2024
20fc7e5
Revert "Comment python flaky test"
alexandreyc May 22, 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
3 changes: 2 additions & 1 deletion .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ on:
- "python/**"
- "ruby/**"
- ".github/workflows/native-unix.yml"
workflow_call:

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}-unix
cancel-in-progress: true

permissions:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/native-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ on:
- "python/**"
- "ruby/**"
- ".github/workflows/native-windows.yml"
workflow_call:

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}-windows
cancel-in-progress: true

permissions:
Expand Down
40 changes: 24 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
- ".github/workflows/rust.yml"

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}-rust
cancel-in-progress: true

permissions:
Expand All @@ -42,11 +42,16 @@ defaults:
working-directory: rust

jobs:
native-unix:
uses: ./.github/workflows/native-unix.yml

rust:
needs: [native-unix]
strategy:
matrix:
# TODO(lidavidm): add back macos-latest once it has Cargo installed
os: [windows-latest, macos-13, ubuntu-latest]
# TODO(alexandreyc): add `windows-latest`
# See: https://github.com/apache/arrow-adbc/pull/1803#issuecomment-2117669300
os: [macos-13, macos-latest, ubuntu-latest]
name: "Rust ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
env:
Expand All @@ -60,21 +65,24 @@ jobs:
- name: Use stable Rust
id: rust
run: |
rustup update stable
rustup toolchain install stable --no-self-update
rustup default stable
VERSION=$(rustup show active-toolchain -v | tail -1 | tr -d "[:space:]")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
- uses: actions/download-artifact@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
rust/target/
key: ${{ runner.os }}-cargo-${{ steps.rust.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ steps.rust.outputs.version }}-
name: driver-manager-${{ matrix.os }}
path: ${{ github.workspace }}/build
- name: Set dynamic linker path
if: matrix.os == 'ubuntu-latest'
run: |
echo "LD_LIBRARY_PATH=${{ github.workspace }}/build/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set dynamic linker path
if: matrix.os == 'macos-latest'
run: |
echo "DYLD_LIBRARY_PATH=/opt/homebrew/opt/sqlite/lib:${{ github.workspace }}/build/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set dynamic linker path
if: matrix.os == 'macos-13'
run: |
echo "DYLD_LIBRARY_PATH=/usr/local/opt/sqlite/lib:${{ github.workspace }}/build/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
- name: Test
Expand Down
6 changes: 4 additions & 2 deletions rust/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

[package]
name = "adbc_core"
description = "Public abstract API, driver manager and driver exporter"
Expand All @@ -25,5 +24,8 @@ license = { workspace = true }

[dependencies]
arrow = { workspace = true }
libloading = "0.8"
libloading = { version = "0.8", optional = true }
once_cell = "1.19.0"

[features]
driver_manager = ["dep:libloading"]
2 changes: 1 addition & 1 deletion rust/core/src/driver_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ unsafe extern "C" fn statement_get_parameter_schema<DriverType: Driver>(
let exported = check_err!(statement_private_data::<DriverType>(statement), error);
let statement = &exported.0;

let schema_value = check_err!(statement.get_parameters_schema(), error);
let schema_value = check_err!(statement.get_parameter_schema(), error);
let schema_value: FFI_ArrowSchema = check_err!(schema_value.try_into(), error);
std::ptr::write_unaligned(schema, schema_value);

Expand Down
Loading
Loading