red-adbc 0.10.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac0000667c7415f8ee8798c14ed39afafe0f261a3c4532a1eaa587c9c0c64a19
4
- data.tar.gz: 6ac196ebbd3b0e8ff85c45162643236153c0d92b01e2a3d803abf620cf2bb3e9
3
+ metadata.gz: b3e38661bb51d363808e530520d34e2db0c9ee10760e3131a3fc29ce8d24603c
4
+ data.tar.gz: bfa56ab21c18d1d415c80b1f702f74a8b65b249e414ae81fe175ac32fa1668d4
5
5
  SHA512:
6
- metadata.gz: fd168666ba54b89fca29a446bc80cd71dab983471dfcef559ad8839adce7a8c58da817ea3c4b2c290a8aa55115724e91f91e4e3d8997aa3f2642984cd4dbff2d
7
- data.tar.gz: ad914853fe4fe18a643b3dde325d7c2f1cbc8b1546aa113caca417446145fc132f7eaaaabcf3758a441f1049bdd34df630b8bcb7dacc60ca5ed6466e9359ce5c
6
+ metadata.gz: 227b2de351ca2a2470a87899255eb0d42f563549c556de83e79c5198f1591de5bb620c6f359c91061471bed5dcdb70a8fe2db3c5175eaadd490a5cda50098e9f
7
+ data.tar.gz: 640804850814b5bab21f6c3cc5f50b443104c79b15bbb440d271d78870bdec43f55f5739dc73aebb9cbf08577c512aa4466dfc7efab18edf08a9af34d69220a1
data/LICENSE.txt CHANGED
@@ -246,6 +246,32 @@ All rights reserved.
246
246
 
247
247
  --------------------------------------------------------------------------------
248
248
 
249
+ 3rdparty dependency {fmt} is statically linked in certain binary
250
+ distributions, like the Python wheels. {fmt} is under the MIT license:
251
+
252
+ Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
253
+
254
+ Permission is hereby granted, free of charge, to any person obtaining
255
+ a copy of this software and associated documentation files (the
256
+ "Software"), to deal in the Software without restriction, including
257
+ without limitation the rights to use, copy, modify, merge, publish,
258
+ distribute, sublicense, and/or sell copies of the Software, and to
259
+ permit persons to whom the Software is furnished to do so, subject to
260
+ the following conditions:
261
+
262
+ The above copyright notice and this permission notice shall be
263
+ included in all copies or substantial portions of the Software.
264
+
265
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
266
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
267
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
268
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
269
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
270
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
271
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
272
+
273
+ --------------------------------------------------------------------------------
274
+
249
275
  3rdparty dependency Go is statically linked in certain binary distributions,
250
276
  like the Python wheels. The Go project is under the BSD 3-clause license +
251
277
  PATENTS weak patent termination clause
@@ -281,6 +307,33 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
281
307
 
282
308
  --------------------------------------------------------------------------------
283
309
 
310
+ 3rdparty dependency backward-cpp is statically linked in certain binary
311
+ distributions, like the Python wheels. backward-cpp has the following license:
312
+
313
+ Copyright 2013 Google Inc. All Rights Reserved.
314
+
315
+ The MIT License (MIT)
316
+
317
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
318
+ this software and associated documentation files (the "Software"), to deal in
319
+ the Software without restriction, including without limitation the rights to
320
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
321
+ of the Software, and to permit persons to whom the Software is furnished to do
322
+ so, subject to the following conditions:
323
+
324
+ The above copyright notice and this permission notice shall be included in all
325
+ copies or substantial portions of the Software.
326
+
327
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
328
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
329
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
330
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
331
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
332
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
333
+ SOFTWARE.
334
+
335
+ --------------------------------------------------------------------------------
336
+
284
337
  3rdparty dependency libpq is statically linked in certain binary
285
338
  distributions, like the Python wheels. libpq has the following license:
286
339
 
@@ -0,0 +1,36 @@
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
@@ -0,0 +1,56 @@
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 ADBC
19
+ module ConnectionOperations
20
+ def query(sql, &block)
21
+ open_statement do |statement|
22
+ statement.query(sql, &block)
23
+ end
24
+ end
25
+
26
+ def ingest(table_name, values, mode: :create)
27
+ open_statment do |statement|
28
+ statement.ingest(table_name, values, mode: mode)
29
+ end
30
+ end
31
+
32
+ def info(codes=nil)
33
+ unless codes.nil?
34
+ codes = codes.collect do |code|
35
+ ADBC::Info.try_convert(code)
36
+ end
37
+ end
38
+ get_info(codes) do |table|
39
+ values = {}
40
+ table.raw_records.each do |code, value|
41
+ value = value.values[0] if value.is_a?(Hash)
42
+ code = ADBC::Info.try_convert(code)
43
+ values[code.nick.gsub("-", "_").to_sym] = value
44
+ end
45
+ values
46
+ end
47
+ end
48
+
49
+ ADBC::Info.values.each do |value|
50
+ name = value.nick.gsub("-", "_").to_sym
51
+ define_method(name) do
52
+ info([name])[name]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -15,42 +15,23 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
+ require_relative "connection-operations"
19
+
18
20
  module ADBC
19
21
  class Connection
22
+ include ConnectionOperations
23
+
20
24
  def open_statement(&block)
21
25
  Statement.open(self, &block)
22
26
  end
23
27
 
24
- def query(sql, &block)
25
- open_statement do |statement|
26
- statement.query(sql, &block)
27
- end
28
- end
29
-
30
- def ingest(table_name, values, mode: :create)
31
- open_statment do |statement|
32
- statement.ingest(table_name, values, mode: mode)
33
- end
34
- end
35
-
36
- def info(codes=nil)
37
- unless codes.nil?
38
- codes = codes.collect do |code|
39
- ADBC::Info.try_convert(code)
40
- end
41
- end
42
- c_abi_array_stream = get_info(codes)
28
+ alias_method :get_info_raw, :get_info
29
+ def get_info(codes)
30
+ c_abi_array_stream = get_info_raw(codes)
43
31
  begin
44
32
  reader = Arrow::RecordBatchReader.import(c_abi_array_stream)
45
33
  begin
46
- table = reader.read_all
47
- values = {}
48
- table.raw_records.each do |code, value|
49
- value = value.values[0] if value.is_a?(Hash)
50
- code = ADBC::Info.try_convert(code)
51
- values[code.nick.gsub("-", "_").to_sym] = value
52
- end
53
- values
34
+ yield(reader.read_all)
54
35
  ensure
55
36
  reader.unref
56
37
  end
@@ -58,12 +39,5 @@ module ADBC
58
39
  GLib.free(c_abi_array_stream)
59
40
  end
60
41
  end
61
-
62
- ADBC::Info.values.each do |value|
63
- name = value.nick.gsub("-", "_").to_sym
64
- define_method(name) do
65
- info([name])[name]
66
- end
67
- end
68
42
  end
69
43
  end
data/lib/adbc/loader.rb CHANGED
@@ -58,6 +58,7 @@ module ADBCArrow
58
58
  end
59
59
 
60
60
  def require_libraries
61
+ require_relative "arrow-connection"
61
62
  require_relative "arrow-statement"
62
63
  end
63
64
  end
data/lib/adbc/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module ADBC
19
- VERSION = "0.10.0"
19
+ VERSION = "1.0.0"
20
20
 
21
21
  module Version
22
22
  MAJOR, MINOR, MICRO, TAG = VERSION.split(".").collect(&:to_i)
data/lib/adbc.rb CHANGED
@@ -32,6 +32,10 @@ begin
32
32
  rescue GObjectIntrospection::RepositoryError
33
33
  else
34
34
  module ADBC
35
+ RawConnection = Connection
36
+ remove_const(:Connection)
37
+ Connection = ADBCArrow::Connection
38
+
35
39
  RawStatement = Statement
36
40
  remove_const(:Statement)
37
41
  Statement = ADBCArrow::Statement
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-adbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Arrow Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: red-arrow
@@ -38,7 +38,9 @@ files:
38
38
  - README.md
39
39
  - dependency-check/Rakefile
40
40
  - lib/adbc.rb
41
+ - lib/adbc/arrow-connection.rb
41
42
  - lib/adbc/arrow-statement.rb
43
+ - lib/adbc/connection-operations.rb
42
44
  - lib/adbc/connection.rb
43
45
  - lib/adbc/database.rb
44
46
  - lib/adbc/loader.rb