duckdb 0.9.2 → 0.9.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afbb8627bfcb9764d6928d64558b55c18b26932b1ad50946cfe777169b6986f9
4
- data.tar.gz: b560803df1d4b93d1e1b9f5c56b55f779c34095780592b9cdae51f7d4da2c0ec
3
+ metadata.gz: b83a52918000c5a6b188eede2053e8f6d3118baad3e451b6a0db48aa0ab8b977
4
+ data.tar.gz: 12dec4bf0fbf2819067e58f57047a8fd2a0b5f0a6e329fa89d8dc0edc59ed338
5
5
  SHA512:
6
- metadata.gz: 4c16acf784261f874501381aa9c764bc461d56fd35b066bae88c6cf0b4de654a867a6d309641cf0cf39d60854d268ce610fd3997534adcd11f322e7e4cd76401
7
- data.tar.gz: 24d26d68b843c27ca306980e0d1acdfed2c6f24bb573cb89ba684879c4d05d43256d2335085e82fb1c352b7cdffcd016f2c2dadf3d924fc747cc4c450b142693
6
+ metadata.gz: '014489d9944bf9cb36c883450f654be009fccee51a3af1215e2f64e525d13ca8faed8ffed08df60368cd5c7c93e29b773626f9e6b4cccbd00593992d0465af28'
7
+ data.tar.gz: '08a0fc5a78f29fd006c3e308ab0346df3f18944d337747af8d753a213232bd9c68e1ce5985b040dd00330d8ac6233a233633e466b0d26b4f045dfd9f9835155a'
@@ -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: ['2.7.8', '3.0.6', '3.1.4', '3.2.2', '3.3.0-rc1', '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: ['2.7.8', '3.0.6', '3.1.4', '3.2.2', '3.3.0-rc1', '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
data/CHANGELOG.md CHANGED
@@ -1,23 +1,27 @@
1
1
  # ChangeLog
2
2
 
3
+ # 0.9.2.1
4
+ - support Time column in `DuckDB#Result#chunk_each`.
5
+ - add `DuckDB::Interval#eql?`.
6
+
3
7
  # 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?.
8
+ - add `DuckDB::Connection#async_query_stream`.
9
+ - `DuckDB::PendingResult` accepts second argument. If the second argument is
10
+ true, `PendingResult#execute_pending` returns streaming `DuckDB::Result` object.
11
+ - add `DuckDB::PreparedStatement#pending_prepared_stream`
12
+ - add `DuckDB::Result#streaming?`.
9
13
 
10
14
  # 0.9.1.2
11
- - add DuckDB::Connection#interrupt, DuckDB::Connection#query_progress
12
- - add DuckDB::Connection#async_query, alias method async_execute.
15
+ - add `DuckDB::Connection#interrupt`, `DuckDB::Connection#query_progress`.
16
+ - add `DuckDB::Connection#async_query`, alias method `async_execute`.
13
17
 
14
18
  # 0.9.1.1
15
19
  - 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.
20
+ - add `DuckDB::PendingResult` class.
21
+ - add `DuckDB::PendingResult#state`.
22
+ - add `DuckDB::PendingResult#execute_task`.
23
+ - add `DuckDB::PendingResult#execute_pending`.
24
+ - add `DuckDB::PreparedStatement#pending_prepared`.
21
25
 
22
26
  ## Breaking Changes
23
27
  - drop duckdb v0.7.x.
@@ -28,16 +32,16 @@
28
32
 
29
33
  # 0.9.0.1
30
34
  - add `DuckDB::PreparedStatement#bind_parameter_index`.
31
- - DuckDB::Connection#query accepts SQL with named bind parameters.
35
+ - `DuckDB::Connection#query` accepts SQL with named bind parameters.
32
36
 
33
37
  # 0.9.0
34
38
  - bump duckdb to 0.9.0.
35
39
 
36
40
  ## Breaking Changes
37
- - deprecation warning when DuckDB::Result.each calling with `DuckDB::Result.use_chunk_each` is false.
41
+ - deprecation warning when `DuckDB::Result.each` calling with `DuckDB::Result.use_chunk_each` is false.
38
42
  The `each` behavior will be same as `DuckDB::Result.chunk_each` in the future.
39
43
  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.
44
+ - `DuckDB::Result#chunk_each` returns `DuckDB::Interval` class when the column type is INTERVAL.
41
45
 
42
46
  # 0.8.1.3
43
47
  - Fix BigDecimal conversion.
@@ -64,7 +68,7 @@
64
68
  But `DuckDB::Result#each` behavior will be changed like as `DuckDB::Result#chunk_each` in near future release.
65
69
  And there are some breaking changes.
66
70
  Write `DuckdDB::Result.use_chunk_each = true` if you want to try new behavior.
67
- ```
71
+ ```ruby
68
72
  DuckDB::Result.use_chunk_each = true
69
73
 
70
74
  result = con.query('SELECT ....')
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (0.9.2)
4
+ duckdb (0.9.2.1)
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)
@@ -18,7 +18,7 @@ GEM
18
18
  rake (13.1.0)
19
19
  rake-compiler (1.2.5)
20
20
  rake
21
- ruby_memcheck (2.2.1)
21
+ ruby_memcheck (2.3.0)
22
22
  nokogiri
23
23
  stackprof (0.2.25)
24
24
 
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.1'
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.1
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-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler