You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/02/13 16:28:53 UTC

[GitHub] [arrow-adbc] wjones127 commented on a diff in pull request #416: feat(rust/drivermgr): start rust driver_manager

wjones127 commented on code in PR #416:
URL: https://github.com/apache/arrow-adbc/pull/416#discussion_r1104722781


##########
rust/src/driver_manager.rs:
##########
@@ -0,0 +1,892 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Load and use ADBC drivers.
+//!
+//! ## Loading a driver
+//!
+//! Drivers are initialized using a function provided by the driver as a main
+//! entrypoint, canonically called `AdbcDriverInit`. (Although many will use a
+//! different name to support statically linking multiple drivers within the
+//! same program.)
+//!
+//! To load from a function, use [AdbcDriver::load_from_init].
+//!
+//! To load from a dynamic library, use [AdbcDriver::load].
+//!
+//! ## Using across threads
+//!
+//! [AdbcDriver] and [AdbcDatabase] can be used across multiple threads. They
+//! hold their inner implementations within [std::sync::Arc], so they are
+//! cheaply copy-able.
+//!
+//! [AdbcConnection] should not be used across multiple threads. Driver
+//! implementations do not guarantee connection APIs are safe to call from
+//! multiple threads, unless calls are carefully sequenced. So instead of using
+//! the same connection across multiple threads, create a connection for each
+//! thread. [AdbcConnectionBuilder] is [core::marker::Send], so it can be moved
+//! to a new thread before initialized into an [AdbcConnection]. [AdbcConnection]
+//! holds it's inner data in a [std::rc::Rc], so it is also cheaply copyable.

Review Comment:
   I was thinking just last night that we might want to implement async `execute` methods, which would involve invoking with `spawn_blocking()`. That might mean we need to make `AdbcConnection` `Send`, but not 100% sure yet. Maybe something for a follow up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org