duckdb 0.9.2 → 0.9.2.2

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: afbb8627bfcb9764d6928d64558b55c18b26932b1ad50946cfe777169b6986f9
4
- data.tar.gz: b560803df1d4b93d1e1b9f5c56b55f779c34095780592b9cdae51f7d4da2c0ec
3
+ metadata.gz: ae1127b035cba551fdee1c009f9e0ee76161936aadaf192d1e78bdf6c5482c0a
4
+ data.tar.gz: 9c7889dbc1dc31af86d99011b3af37fe427ac23a3ba40f6aa23f253c7453874d
5
5
  SHA512:
6
- metadata.gz: 4c16acf784261f874501381aa9c764bc461d56fd35b066bae88c6cf0b4de654a867a6d309641cf0cf39d60854d268ce610fd3997534adcd11f322e7e4cd76401
7
- data.tar.gz: 24d26d68b843c27ca306980e0d1acdfed2c6f24bb573cb89ba684879c4d05d43256d2335085e82fb1c352b7cdffcd016f2c2dadf3d924fc747cc4c450b142693
6
+ metadata.gz: 67cbfeabe7fcbc6e2cab91ea0eb3670546ad33ef06e9f3f9cd768885b3b17849910e55bc0d6d71d609ccca90d8896a08df2a8b3a2b4477b2591a5ad60135b388
7
+ data.tar.gz: 00a229aad9144ebb1d36664729211795f728fc00888323b0bdbbd1e516a274d62e4727fb469d1e913e5c8e7a4bc15226e938d85d25f9c3684797d94a73272581
@@ -1,9 +1,9 @@
1
1
  name: MacOS
2
2
 
3
3
  on:
4
- # push:
5
- # branches:
6
- # - main
4
+ push:
5
+ branches:
6
+ - main
7
7
  pull_request:
8
8
  types:
9
9
  - opened
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: macos-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: ['2.7.8', '3.0.6', '3.1.4', '3.2.2', '3.3.0-preview3', 'head']
18
+ ruby: ['3.0.6', '3.1.4', '3.2.2', '3.3.0', 'head']
19
19
  duckdb: ['0.9.2', '0.8.1']
20
20
 
21
21
  steps:
@@ -1,9 +1,9 @@
1
1
  name: Ubuntu
2
2
 
3
3
  on:
4
- # push:
5
- # branches:
6
- # - main
4
+ push:
5
+ branches:
6
+ - main
7
7
  pull_request:
8
8
  types:
9
9
  - opened
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: ['2.7.8', '3.0.6', '3.1.4', '3.2.2', '3.3.0-preview3', 'head']
18
+ ruby: ['3.0.6', '3.1.4', '3.2.2', '3.3.0', 'head']
19
19
  duckdb: ['0.9.2', '0.8.1']
20
20
 
21
21
  steps:
@@ -49,7 +49,6 @@ jobs:
49
49
  env:
50
50
  DUCKDB_VERSION: ${{ matrix.duckdb }}
51
51
  run: |
52
- gem install bundler
53
52
  bundle install --jobs 4 --retry 3
54
53
  bundle exec rake build -- --with-duckdb-include=${GITHUB_WORKSPACE}/duckdb-v${DUCKDB_VERSION}/src/include --with-duckdb-lib=${GITHUB_WORKSPACE}/duckdb-v${DUCKDB_VERSION}/build/release/src/
55
54
 
@@ -1,9 +1,9 @@
1
1
  name: Windows
2
2
 
3
3
  on:
4
- # push:
5
- # branches:
6
- # - main
4
+ push:
5
+ branches:
6
+ - main
7
7
  pull_request:
8
8
  types:
9
9
  - opened
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: windows-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: ['2.7.8', '3.0.6', '3.1.4', '3.2.2', 'ucrt', 'mingw', 'mswin', 'head']
18
+ ruby: ['3.0.6', '3.1.4', '3.2.2', 'ucrt', 'mingw', 'mswin', 'head']
19
19
  duckdb: ['0.9.2', '0.8.1']
20
20
 
21
21
  steps:
data/CHANGELOG.md CHANGED
@@ -1,23 +1,33 @@
1
1
  # ChangeLog
2
2
 
3
+ # 0.9.2.2
4
+ - bump Ruby to 3.3.0 on CI.
5
+
6
+ ## Breaking changes
7
+ - drop Ruby 2.7.
8
+
9
+ # 0.9.2.1
10
+ - support Time column in `DuckDB#Result#chunk_each`.
11
+ - add `DuckDB::Interval#eql?`.
12
+
3
13
  # 0.9.2
4
- - add DuckDB::Connection#async_query_stream
5
- - DuckDB::PendingResult accepts second argument. If the second argument is
6
- true, PendingResult#execute_pending returns streaming DuckDB::Result object.
7
- - add DuckDB::PreparedStatement#pending_prepared_stream
8
- - add DuckDB::Result#streaming?.
14
+ - add `DuckDB::Connection#async_query_stream`.
15
+ - `DuckDB::PendingResult` accepts second argument. If the second argument is
16
+ true, `PendingResult#execute_pending` returns streaming `DuckDB::Result` object.
17
+ - add `DuckDB::PreparedStatement#pending_prepared_stream`
18
+ - add `DuckDB::Result#streaming?`.
9
19
 
10
20
  # 0.9.1.2
11
- - add DuckDB::Connection#interrupt, DuckDB::Connection#query_progress
12
- - add DuckDB::Connection#async_query, alias method async_execute.
21
+ - add `DuckDB::Connection#interrupt`, `DuckDB::Connection#query_progress`.
22
+ - add `DuckDB::Connection#async_query`, alias method `async_execute`.
13
23
 
14
24
  # 0.9.1.1
15
25
  - change default branch to main from master.
16
- - add DuckDB::PendingResult class.
17
- - add DuckDB::PendingResult#state.
18
- - add DuckDB::PendingResult#execute_task.
19
- - add DuckDB::PendingResult#execute_pending.
20
- - add DuckDB::PreparedStatement#pending_prepared.
26
+ - add `DuckDB::PendingResult` class.
27
+ - add `DuckDB::PendingResult#state`.
28
+ - add `DuckDB::PendingResult#execute_task`.
29
+ - add `DuckDB::PendingResult#execute_pending`.
30
+ - add `DuckDB::PreparedStatement#pending_prepared`.
21
31
 
22
32
  ## Breaking Changes
23
33
  - drop duckdb v0.7.x.
@@ -28,16 +38,16 @@
28
38
 
29
39
  # 0.9.0.1
30
40
  - add `DuckDB::PreparedStatement#bind_parameter_index`.
31
- - DuckDB::Connection#query accepts SQL with named bind parameters.
41
+ - `DuckDB::Connection#query` accepts SQL with named bind parameters.
32
42
 
33
43
  # 0.9.0
34
44
  - bump duckdb to 0.9.0.
35
45
 
36
46
  ## Breaking Changes
37
- - deprecation warning when DuckDB::Result.each calling with `DuckDB::Result.use_chunk_each` is false.
47
+ - deprecation warning when `DuckDB::Result.each` calling with `DuckDB::Result.use_chunk_each` is false.
38
48
  The `each` behavior will be same as `DuckDB::Result.chunk_each` in the future.
39
49
  set `DuckDB::Result.use_chunk_each = true` to suppress the warning.
40
- - DuckDB::Result#chunck_each returns DuckDB::Interval class when the column type is INTERVAL.
50
+ - `DuckDB::Result#chunk_each` returns `DuckDB::Interval` class when the column type is INTERVAL.
41
51
 
42
52
  # 0.8.1.3
43
53
  - Fix BigDecimal conversion.
@@ -64,7 +74,7 @@
64
74
  But `DuckDB::Result#each` behavior will be changed like as `DuckDB::Result#chunk_each` in near future release.
65
75
  And there are some breaking changes.
66
76
  Write `DuckdDB::Result.use_chunk_each = true` if you want to try new behavior.
67
- ```
77
+ ```ruby
68
78
  DuckDB::Result.use_chunk_each = true
69
79
 
70
80
  result = con.query('SELECT ....')
data/Gemfile.lock CHANGED
@@ -1,24 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (0.9.2)
4
+ duckdb (0.9.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- benchmark-ips (2.12.0)
9
+ benchmark-ips (2.13.0)
10
10
  mini_portile2 (2.8.5)
11
11
  minitest (5.20.0)
12
12
  nokogiri (1.15.5)
13
13
  mini_portile2 (~> 2.8.2)
14
14
  racc (~> 1.4)
15
- nokogiri (1.15.5-x86_64-linux)
16
- racc (~> 1.4)
17
15
  racc (1.7.3)
18
16
  rake (13.1.0)
19
17
  rake-compiler (1.2.5)
20
18
  rake
21
- ruby_memcheck (2.2.1)
19
+ ruby_memcheck (2.3.0)
22
20
  nokogiri
23
21
  stackprof (0.2.25)
24
22
 
@@ -37,4 +35,4 @@ DEPENDENCIES
37
35
  stackprof
38
36
 
39
37
  BUNDLED WITH
40
- 2.4.17
38
+ 2.5.3
data/duckdb.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  end
27
27
  spec.require_paths = ['lib']
28
28
  spec.extensions = ['ext/duckdb/extconf.rb']
29
- spec.required_ruby_version = '>= 2.7.0'
29
+ spec.required_ruby_version = '>= 3.0.0'
30
30
 
31
31
  spec.add_development_dependency 'bundler', '~> 2.3'
32
32
  spec.add_development_dependency 'minitest', '~> 5.0'
data/ext/duckdb/result.c CHANGED
@@ -44,6 +44,7 @@ static VALUE duckdb_result__enum_dictionary_value(VALUE oDuckDBResult, VALUE col
44
44
 
45
45
  static VALUE vector_date(void *vector_data, idx_t row_idx);
46
46
  static VALUE vector_timestamp(void* vector_data, idx_t row_idx);
47
+ static VALUE vector_time(void* vector_data, idx_t row_idx);
47
48
  static VALUE vector_interval(void* vector_data, idx_t row_idx);
48
49
  static VALUE vector_blob(void* vector_data, idx_t row_idx);
49
50
  static VALUE vector_varchar(void* vector_data, idx_t row_idx);
@@ -501,6 +502,17 @@ static VALUE vector_timestamp(void* vector_data, idx_t row_idx) {
501
502
  );
502
503
  }
503
504
 
505
+ static VALUE vector_time(void* vector_data, idx_t row_idx) {
506
+ duckdb_time_struct data = duckdb_from_time(((duckdb_time *)vector_data)[row_idx]);
507
+ return rb_funcall(mDuckDBConverter, rb_intern("_to_time_from_duckdb_time"), 4,
508
+ INT2FIX(data.hour),
509
+ INT2FIX(data.min),
510
+ INT2FIX(data.sec),
511
+ INT2NUM(data.micros)
512
+ );
513
+ }
514
+
515
+
504
516
  static VALUE vector_interval(void* vector_data, idx_t row_idx) {
505
517
  duckdb_interval data = ((duckdb_interval *)vector_data)[row_idx];
506
518
  return rb_funcall(mDuckDBConverter, rb_intern("_to_interval_from_vector"), 3,
@@ -721,6 +733,9 @@ static VALUE vector_value(duckdb_vector vector, idx_t row_idx) {
721
733
  case DUCKDB_TYPE_TIMESTAMP:
722
734
  obj = vector_timestamp(vector_data, row_idx);
723
735
  break;
736
+ case DUCKDB_TYPE_TIME:
737
+ obj = vector_time(vector_data, row_idx);
738
+ break;
724
739
  case DUCKDB_TYPE_INTERVAL:
725
740
  obj = vector_interval(vector_data, row_idx);
726
741
  break;
@@ -19,6 +19,18 @@ module DuckDB
19
19
  Time.local(year, month, day, hour, minute, second, microsecond)
20
20
  end
21
21
 
22
+ def _to_time_from_duckdb_time(hour, minute, second, microsecond)
23
+ Time.parse(
24
+ format(
25
+ '%<hour>02d:%<minute>02d:%<second>02d.%<microsecond>06d',
26
+ hour: hour,
27
+ minute: minute,
28
+ second: second,
29
+ microsecond: microsecond
30
+ )
31
+ )
32
+ end
33
+
22
34
  def _to_hugeint_from_vector(lower, upper)
23
35
  (upper << HALF_HUGEINT_BIT) + lower
24
36
  end
@@ -157,5 +157,9 @@ module DuckDB
157
157
  @interval_days == other.interval_days &&
158
158
  @interval_micros == other.interval_micros
159
159
  end
160
+
161
+ def eql?(other)
162
+ self == other
163
+ end
160
164
  end
161
165
  end
@@ -3,5 +3,5 @@
3
3
  module DuckDB
4
4
  # The version string of ruby-duckdb.
5
5
  # Currently, ruby-duckdb is NOT semantic versioning.
6
- VERSION = '0.9.2'
6
+ VERSION = '0.9.2.2'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duckdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Suketa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-25 00:00:00.000000000 Z
11
+ date: 2023-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -157,14 +157,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 2.7.0
160
+ version: 3.0.0
161
161
  required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.4.17
167
+ rubygems_version: 3.5.3
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: This module is Ruby binding for DuckDB database engine.