red-adbc 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +0 -13
- data/README.md +2 -0
- data/lib/adbc/connection.rb +25 -0
- data/lib/adbc/loader.rb +0 -20
- data/lib/adbc/statement.rb +10 -0
- data/lib/adbc/version.rb +1 -1
- data/lib/adbc.rb +0 -14
- metadata +5 -10
- data/lib/adbc/arrow-connection.rb +0 -36
- data/lib/adbc/arrow-statement.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f69638320235dde3057699cf4001ade6f5ed371f39e80890c7afc8f017c6fda4
|
4
|
+
data.tar.gz: cb5d454f7af748c396455ec175cf5bf30d95a36f65efbe5fe6efb502f111b685
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ece4deacfaf8116bada4e114e471b82d5b3548cb0a8be256e1bfd8c6f55c1b2b494105ceb48852085a3982c7318d8786b4765b4e29f0074629797de1f907897f
|
7
|
+
data.tar.gz: 1331935b4d4aef0b577a425ca243aba9abd7445d72d33b7381caa3184c84215e4a2b71b3c2d378d39774a3aa31de23c2de702718e147e367ea1086ab3eacd7cb
|
data/LICENSE.txt
CHANGED
@@ -602,18 +602,6 @@ THE SOFTWARE.
|
|
602
602
|
|
603
603
|
--------------------------------------------------------------------------------
|
604
604
|
|
605
|
-
3rdparty dependency github.com/apache/arrow-go/v18
|
606
|
-
is statically linked in certain binary distributions, like the Python wheels.
|
607
|
-
github.com/apache/arrow-go/v18 is under the Apache-2.0 license.
|
608
|
-
|
609
|
-
--------------------------------------------------------------------------------
|
610
|
-
|
611
|
-
3rdparty dependency github.com/apache/thrift/lib/go/thrift
|
612
|
-
is statically linked in certain binary distributions, like the Python wheels.
|
613
|
-
github.com/apache/thrift/lib/go/thrift is under the Apache-2.0 license.
|
614
|
-
|
615
|
-
--------------------------------------------------------------------------------
|
616
|
-
|
617
605
|
3rdparty dependency github.com/aws/aws-sdk-go-v2
|
618
606
|
is statically linked in certain binary distributions, like the Python wheels.
|
619
607
|
github.com/aws/aws-sdk-go-v2 is under the Apache-2.0 license.
|
@@ -1237,7 +1225,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1237
1225
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
1238
1226
|
SOFTWARE.
|
1239
1227
|
|
1240
|
-
|
1241
1228
|
--------------------------------------------------------------------------------
|
1242
1229
|
|
1243
1230
|
3rdparty dependency github.com/klauspost/compress
|
data/README.md
CHANGED
data/lib/adbc/connection.rb
CHANGED
@@ -39,5 +39,30 @@ module ADBC
|
|
39
39
|
GLib.free(c_abi_array_stream)
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
alias_method :get_objects_raw, :get_objects
|
44
|
+
def get_objects(depth: :all,
|
45
|
+
catalog: nil,
|
46
|
+
db_schema: nil,
|
47
|
+
table_name: nil,
|
48
|
+
table_types: nil,
|
49
|
+
column_name: nil)
|
50
|
+
c_abi_array_stream = get_objects_raw(depth,
|
51
|
+
catalog,
|
52
|
+
db_schema,
|
53
|
+
table_name,
|
54
|
+
table_types,
|
55
|
+
column_name)
|
56
|
+
begin
|
57
|
+
reader = Arrow::RecordBatchReader.import(c_abi_array_stream)
|
58
|
+
begin
|
59
|
+
reader.read_all
|
60
|
+
ensure
|
61
|
+
reader.unref
|
62
|
+
end
|
63
|
+
ensure
|
64
|
+
GLib.free(c_abi_array_stream)
|
65
|
+
end
|
66
|
+
end
|
42
67
|
end
|
43
68
|
end
|
data/lib/adbc/loader.rb
CHANGED
@@ -60,23 +60,3 @@ module ADBC
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
-
|
64
|
-
module ADBCArrow
|
65
|
-
class Loader < GObjectIntrospection::Loader
|
66
|
-
class << self
|
67
|
-
def load
|
68
|
-
super("ADBCArrow", ADBCArrow)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
def post_load(repository, namespace)
|
74
|
-
require_libraries
|
75
|
-
end
|
76
|
-
|
77
|
-
def require_libraries
|
78
|
-
require_relative "arrow-connection"
|
79
|
-
require_relative "arrow-statement"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
data/lib/adbc/statement.rb
CHANGED
@@ -23,6 +23,16 @@ module ADBC
|
|
23
23
|
extend StatementOpenable
|
24
24
|
include StatementOperations
|
25
25
|
|
26
|
+
alias_method :parameter_schema_raw, :parameter_schema
|
27
|
+
def parameter_schema
|
28
|
+
_, c_abi_schema = parameter_schema_raw
|
29
|
+
begin
|
30
|
+
Arrow::Schema.import(c_abi_schema)
|
31
|
+
ensure
|
32
|
+
GLib.free(c_abi_schema)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
26
36
|
alias_method :execute_raw, :execute
|
27
37
|
def execute(need_result: true)
|
28
38
|
_, c_abi_array_stream, n_rows_affected = execute_raw(need_result)
|
data/lib/adbc/version.rb
CHANGED
data/lib/adbc.rb
CHANGED
@@ -27,17 +27,3 @@ module ADBC
|
|
27
27
|
end
|
28
28
|
|
29
29
|
ADBC::Loader.load
|
30
|
-
begin
|
31
|
-
ADBCArrow::Loader.load
|
32
|
-
rescue GObjectIntrospection::RepositoryError
|
33
|
-
else
|
34
|
-
module ADBC
|
35
|
-
RawConnection = Connection
|
36
|
-
remove_const(:Connection)
|
37
|
-
Connection = ADBCArrow::Connection
|
38
|
-
|
39
|
-
RawStatement = Statement
|
40
|
-
remove_const(:Statement)
|
41
|
-
Statement = ADBCArrow::Statement
|
42
|
-
end
|
43
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red-adbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apache Arrow Developers
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: red-arrow
|
@@ -36,8 +35,6 @@ files:
|
|
36
35
|
- NOTICE.txt
|
37
36
|
- README.md
|
38
37
|
- lib/adbc.rb
|
39
|
-
- lib/adbc/arrow-connection.rb
|
40
|
-
- lib/adbc/arrow-statement.rb
|
41
38
|
- lib/adbc/connection-operations.rb
|
42
39
|
- lib/adbc/connection.rb
|
43
40
|
- lib/adbc/database.rb
|
@@ -50,7 +47,6 @@ homepage: https://arrow.apache.org/
|
|
50
47
|
licenses:
|
51
48
|
- Apache-2.0
|
52
49
|
metadata: {}
|
53
|
-
post_install_message:
|
54
50
|
rdoc_options: []
|
55
51
|
require_paths:
|
56
52
|
- lib
|
@@ -65,10 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
61
|
- !ruby/object:Gem::Version
|
66
62
|
version: '0'
|
67
63
|
requirements:
|
68
|
-
- 'system: adbc-
|
69
|
-
- 'system: adbc-
|
70
|
-
rubygems_version: 3.
|
71
|
-
signing_key:
|
64
|
+
- 'system: adbc-glib>=1.8.0: debian: libadbc-glib-dev'
|
65
|
+
- 'system: adbc-glib>=1.8.0: rhel: adbc-glib-devel'
|
66
|
+
rubygems_version: 3.6.9
|
72
67
|
specification_version: 4
|
73
68
|
summary: Red ADBC is the Ruby bindings of ADBC (Apache Arrow Database Connectivity)
|
74
69
|
test_files: []
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
3
|
-
# distributed with this work for additional information
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
6
|
-
# "License"); you may not use this file except in compliance
|
7
|
-
# with the License. You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
12
|
-
# software distributed under the License is distributed on an
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
-
# KIND, either express or implied. See the License for the
|
15
|
-
# specific language governing permissions and limitations
|
16
|
-
# under the License.
|
17
|
-
|
18
|
-
module ADBCArrow
|
19
|
-
class Connection
|
20
|
-
include ADBC::ConnectionOperations
|
21
|
-
|
22
|
-
def open_statement(&block)
|
23
|
-
Statement.open(self, &block)
|
24
|
-
end
|
25
|
-
|
26
|
-
alias_method :get_info_raw, :get_info
|
27
|
-
def get_info(codes)
|
28
|
-
reader = get_info_raw(codes)
|
29
|
-
begin
|
30
|
-
yield(reader.read_all)
|
31
|
-
ensure
|
32
|
-
reader.unref
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
data/lib/adbc/arrow-statement.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
3
|
-
# distributed with this work for additional information
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
6
|
-
# "License"); you may not use this file except in compliance
|
7
|
-
# with the License. You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
12
|
-
# software distributed under the License is distributed on an
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
-
# KIND, either express or implied. See the License for the
|
15
|
-
# specific language governing permissions and limitations
|
16
|
-
# under the License.
|
17
|
-
|
18
|
-
module ADBCArrow
|
19
|
-
class Statement
|
20
|
-
extend ADBC::StatementOpenable
|
21
|
-
include ADBC::StatementOperations
|
22
|
-
|
23
|
-
alias_method :execute_raw, :execute
|
24
|
-
def execute(need_result: true)
|
25
|
-
_, reader, n_rows_affected = execute_raw(need_result)
|
26
|
-
if need_result
|
27
|
-
begin
|
28
|
-
if block_given?
|
29
|
-
yield(reader, n_rows_affected)
|
30
|
-
else
|
31
|
-
[reader.read_all, n_rows_affected]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
else
|
35
|
-
if block_given?
|
36
|
-
yield(n_rows_affected)
|
37
|
-
else
|
38
|
-
n_rows_affected
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
alias_method :bind_raw, :bind
|
44
|
-
def bind(*args)
|
45
|
-
n_args = args.size
|
46
|
-
if block_given?
|
47
|
-
message = "wrong number of arguments (given #{n_args}, expected 1 with block)"
|
48
|
-
raise ArgumentError, message unless n_args == 1
|
49
|
-
values = args[0]
|
50
|
-
if values.is_a?(Arrow::Table)
|
51
|
-
values = Arrow::TableBatchReader.new(values)
|
52
|
-
end
|
53
|
-
if values.is_a?(Arrow::RecordBatchReader)
|
54
|
-
bind_stream(values)
|
55
|
-
yield
|
56
|
-
else
|
57
|
-
bind_raw(values)
|
58
|
-
yield
|
59
|
-
end
|
60
|
-
else
|
61
|
-
bind_raw(*args)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|