Skip to content

Commit a85768d

Browse files
authored
Add FlightSqlServiceClient::new_from_inner (#6003)
1 parent fd5e67d commit a85768d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arrow-flight/src/sql/client.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ pub struct FlightSqlServiceClient<T> {
6969
impl FlightSqlServiceClient<Channel> {
7070
/// Creates a new FlightSql client that connects to a server over an arbitrary tonic `Channel`
7171
pub fn new(channel: Channel) -> Self {
72-
let flight_client = FlightServiceClient::new(channel);
73-
FlightSqlServiceClient {
72+
Self::new_from_inner(FlightServiceClient::new(channel))
73+
}
74+
75+
/// Creates a new higher level client with the provided lower level client
76+
pub fn new_from_inner(inner: FlightServiceClient<Channel>) -> Self {
77+
Self {
7478
token: None,
75-
flight_client,
79+
flight_client: inner,
7680
headers: HashMap::default(),
7781
}
7882
}

0 commit comments

Comments
 (0)