duckdb 1.3.0.0 → 1.3.1.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: 419a694a8223198ebddb3470cddc96c164fa684ebde604edf5d0df401376c0d5
4
- data.tar.gz: c832f287dc1fa48532d2b69dc49c0de13f5d9f2811a49cf3dcd5ba23f985be71
3
+ metadata.gz: 979c1ffbe5e1137870bd777377ef16cb7ddde8499d5d9fd14fcd6a5fe401ffda
4
+ data.tar.gz: 72d970b664aed935c451a95e48818584cf0ecd029ade167bef88235eed62fc6c
5
5
  SHA512:
6
- metadata.gz: e48b21a62da9e1dff74bc2b2ecc775e93c1fbd01691bed443fd04686875e6b5285a4f4d61ea7befb961bbc2c98c610caa0da712fdbd339b3b5efe83d07c4bfc3
7
- data.tar.gz: 06f7a29029833de5f912343432c8391cecb3404c0069b14d190617291634f790ea55433f5178d9114bd6f7e4a2c7729ce9b808343c48d820842f96fa771bbe22
6
+ metadata.gz: cfb967f5ce29966491958e8e0c724716eacb7d36e0692a522b01ebca148e26ae5306cbc9306d64299fec16e79f96967863dad73cdc2c0d77bf4382bacfd25a00
7
+ data.tar.gz: 9a1edecd631f9b7e891b49afd71eea1baebdf1defc6488222469b6e435ce39510ecfaadcb3329d387500bbf49d87ac3344ac11ffb17ffb257836c6c6007b5811
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['3.2.7', '3.3.8', '3.4.2', 'head', '3.5.0-preview1']
19
- duckdb: ['1.2.2', '1.1.3', '1.1.1', '1.3.0']
19
+ duckdb: ['1.2.2', '1.3.1']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v4
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['3.2.7', '3.3.8', '3.4.2', 'head', '3.5.0-preview1']
19
- duckdb: ['1.2.2', '1.1.3', '1.1.1', '1.3.0']
19
+ duckdb: ['1.2.2', '1.3.1']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v4
@@ -15,9 +15,8 @@ jobs:
15
15
  runs-on: windows-latest
16
16
  strategy:
17
17
  matrix:
18
- # ruby: ['3.2.6', '3.3.8', '3.4.1', 'ucrt', 'mingw', 'mswin', 'head']
19
- ruby: ['3.2.6', '3.3.8', '3.4.1', 'ucrt', 'mingw', 'mswin']
20
- duckdb: ['1.2.2', '1.1.3', '1.1.1', '1.3.0']
18
+ ruby: ['3.2.6', '3.3.8', '3.4.1', 'ucrt', 'mingw', 'mswin', 'head']
19
+ duckdb: ['1.2.2', '1.3.1']
21
20
 
22
21
  steps:
23
22
  - uses: actions/checkout@v4
data/CHANGELOG.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- # Unreleased
5
+ # 1.3.1.0 - 2025-06-28
6
+ - Support TIMESTAMP_S, TIMESTAMP_MS infinity, -infinity value.
7
+ - bump duckdb to 1.3.1 on CI.
8
+ - drop dcukdb v1.1.x.
6
9
 
7
10
  # 1.3.0.0 - 2025-05-31
8
11
  - bump duckdb to 1.3.0 on CI.
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  ARG RUBY_VERSION=3.4.4
2
2
  FROM ruby:${RUBY_VERSION}
3
3
 
4
- ARG DUCKDB_VERSION=1.3.0
4
+ ARG DUCKDB_VERSION=1.3.1
5
5
  ARG VALGRIND_VERSION=3.21.0
6
6
 
7
7
  RUN apt-get update -qq && \
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (1.3.0.0)
4
+ duckdb (1.3.1.0)
5
5
  bigdecimal (>= 3.1.4)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  benchmark-ips (2.14.0)
11
- bigdecimal (3.2.0)
11
+ bigdecimal (3.2.2)
12
12
  mini_portile2 (2.8.9)
13
13
  minitest (5.25.5)
14
14
  nokogiri (1.18.8)
data/ext/duckdb/duckdb.c CHANGED
@@ -39,7 +39,5 @@ Init_duckdb_native(void) {
39
39
  rbduckdb_init_duckdb_config();
40
40
  rbduckdb_init_duckdb_converter();
41
41
  rbduckdb_init_duckdb_extracted_statements();
42
- #ifdef HAVE_DUCKDB_H_GE_V1_2_0
43
42
  rbduckdb_init_duckdb_instance_cache();
44
- #endif
45
43
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'mkmf'
4
4
 
5
- DUCKDB_REQUIRED_VERSION = '1.1.0'
5
+ DUCKDB_REQUIRED_VERSION = '1.2.0'
6
6
 
7
7
  def check_duckdb_header(header, version)
8
8
  found = find_header(
@@ -56,10 +56,7 @@ end
56
56
  dir_config('duckdb')
57
57
 
58
58
  check_duckdb_header('duckdb.h', DUCKDB_REQUIRED_VERSION)
59
- check_duckdb_library('duckdb', 'duckdb_result_error_type', DUCKDB_REQUIRED_VERSION)
60
-
61
- # check duckdb >= 1.1.0
62
- have_func('duckdb_result_error_type', 'duckdb.h')
59
+ check_duckdb_library('duckdb', 'duckdb_create_instance_cache', DUCKDB_REQUIRED_VERSION)
63
60
 
64
61
  # check duckdb >= 1.2.0
65
62
  have_func('duckdb_create_instance_cache', 'duckdb.h')
@@ -67,10 +64,6 @@ have_func('duckdb_create_instance_cache', 'duckdb.h')
67
64
  # check duckdb >= 1.3.0
68
65
  have_func('duckdb_get_table_names', 'duckdb.h')
69
66
 
70
- # Building with enabled DUCKDB_API_NO_DEPRECATED is failed with DuckDB v1.1.0 only.
71
- # DuckDB v1.1.1 is fixed this issue https://github.com/duckdb/duckdb/issues/13872.
72
- have_const('DUCKDB_TYPE_SQLNULL', 'duckdb.h')
73
-
74
67
  $CFLAGS << ' -DDUCKDB_API_NO_DEPRECATED' if ENV['DUCKDB_API_NO_DEPRECATED']
75
68
 
76
69
  create_makefile('duckdb/duckdb_native')
@@ -1,6 +1,5 @@
1
1
  #include "ruby-duckdb.h"
2
2
 
3
- #ifdef HAVE_DUCKDB_H_GE_V1_2_0
4
3
  VALUE cDuckDBInstanceCache;
5
4
 
6
5
  static void deallocate(void * ctx);
@@ -105,4 +104,3 @@ void rbduckdb_init_duckdb_instance_cache(void) {
105
104
  rb_define_method(cDuckDBInstanceCache, "destroy", duckdb_instance_cache_destroy, 0);
106
105
  rb_define_alloc_func(cDuckDBInstanceCache, allocate);
107
106
  }
108
- #endif
@@ -1,8 +1,6 @@
1
1
  #ifndef RUBY_DUCKDB_INSTANCE_CACHE_H
2
2
  #define RUBY_DUCKDB_INSTANCE_CACHE_H
3
3
 
4
- #ifdef HAVE_DUCKDB_H_GE_V1_2_0
5
-
6
4
  struct _rubyDuckDBInstanceCache {
7
5
  duckdb_instance_cache instance_cache;
8
6
  };
@@ -12,6 +10,3 @@ typedef struct _rubyDuckDBInstanceCache rubyDuckDBInstanceCache;
12
10
  void rbduckdb_init_duckdb_instance_cache(void);
13
11
 
14
12
  #endif
15
-
16
- #endif
17
-
data/ext/duckdb/result.c CHANGED
@@ -48,6 +48,9 @@ static VALUE vector_hugeint(void* vector_data, idx_t row_idx);
48
48
  static VALUE vector_uhugeint(void* vector_data, idx_t row_idx);
49
49
  static VALUE vector_decimal(duckdb_logical_type ty, void* vector_data, idx_t row_idx);
50
50
  static VALUE infinite_timestamp_value(duckdb_timestamp timestamp);
51
+ static VALUE infinite_timestamp_s_value(duckdb_timestamp_s timestamp_s);
52
+ static VALUE infinite_timestamp_ms_value(duckdb_timestamp_ms timestamp_ms);
53
+
51
54
  static VALUE vector_timestamp_s(void* vector_data, idx_t row_idx);
52
55
  static VALUE vector_timestamp_ms(void* vector_data, idx_t row_idx);
53
56
  static VALUE vector_timestamp_ns(void* vector_data, idx_t row_idx);
@@ -223,14 +226,7 @@ static VALUE duckdb_result__column_type(VALUE oDuckDBResult, VALUE col_idx) {
223
226
  static VALUE duckdb_result__return_type(VALUE oDuckDBResult) {
224
227
  rubyDuckDBResult *ctx;
225
228
  TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
226
- /*
227
- * remove this #if ... #else statement when dropping duckdb 1.1.0.
228
- */
229
- #if !defined(HAVE_DUCKDB_H_GE_V1_1_1) && defined(DUCKDB_API_NO_DEPRECATED)
230
- rb_raise(eDuckDBError, "duckdb_result_return_type C-API is not available with duckdb v1.1.0 with enabled DUCKDB_API_NO_DEPRECATED.");
231
- #else
232
229
  return INT2FIX(duckdb_result_return_type(ctx->result));
233
- #endif
234
230
  }
235
231
 
236
232
  /* :nodoc: */
@@ -438,17 +434,43 @@ static VALUE infinite_timestamp_value(duckdb_timestamp timestamp) {
438
434
  return Qnil;
439
435
  }
440
436
 
437
+ static VALUE infinite_timestamp_s_value(duckdb_timestamp_s timestamp_s) {
438
+ if (duckdb_is_finite_timestamp_s(timestamp_s) == false) {
439
+ return rb_funcall(mDuckDBConverter, id__to_infinity, 1,
440
+ LL2NUM(timestamp_s.seconds)
441
+ );
442
+ }
443
+ return Qnil;
444
+ }
445
+
441
446
  static VALUE vector_timestamp_s(void* vector_data, idx_t row_idx) {
442
- duckdb_timestamp data = ((duckdb_timestamp *)vector_data)[row_idx];
447
+ duckdb_timestamp_s data = ((duckdb_timestamp_s *)vector_data)[row_idx];
448
+ VALUE obj = infinite_timestamp_s_value(data);
449
+ if (obj != Qnil) {
450
+ return obj;
451
+ }
443
452
  return rb_funcall(mDuckDBConverter, id__to_time_from_duckdb_timestamp_s, 1,
444
- LL2NUM(data.micros)
445
- );
453
+ LL2NUM(data.seconds)
454
+ );
455
+ }
456
+
457
+ static VALUE infinite_timestamp_ms_value(duckdb_timestamp_ms timestamp_ms) {
458
+ if (duckdb_is_finite_timestamp_ms(timestamp_ms) == false) {
459
+ return rb_funcall(mDuckDBConverter, id__to_infinity, 1,
460
+ LL2NUM(timestamp_ms.millis)
461
+ );
462
+ }
463
+ return Qnil;
446
464
  }
447
465
 
448
466
  static VALUE vector_timestamp_ms(void* vector_data, idx_t row_idx) {
449
- duckdb_timestamp data = ((duckdb_timestamp *)vector_data)[row_idx];
467
+ duckdb_timestamp_ms data = ((duckdb_timestamp_ms *)vector_data)[row_idx];
468
+ VALUE obj = infinite_timestamp_ms_value(data);
469
+ if (obj != Qnil) {
470
+ return obj;
471
+ }
450
472
  return rb_funcall(mDuckDBConverter, id__to_time_from_duckdb_timestamp_ms, 1,
451
- LL2NUM(data.micros)
473
+ LL2NUM(data.millis)
452
474
  );
453
475
  }
454
476
 
@@ -8,14 +8,6 @@
8
8
  #include "ruby/thread.h"
9
9
  #include <duckdb.h>
10
10
 
11
- #ifdef HAVE_CONST_DUCKDB_TYPE_SQLNULL
12
- #define HAVE_DUCKDB_H_GE_V1_1_1 1
13
- #endif
14
-
15
- #ifdef HAVE_DUCKDB_CREATE_INSTANCE_CACHE
16
- #define HAVE_DUCKDB_H_GE_V1_2_0 1
17
- #endif
18
-
19
11
  #ifdef HAVE_DUCKDB_GET_TABLE_NAMES
20
12
  #define HAVE_DUCKDB_H_GE_V1_3_0 1
21
13
  #endif
@@ -35,10 +27,7 @@
35
27
  #include "./blob.h"
36
28
  #include "./appender.h"
37
29
  #include "./config.h"
38
-
39
- #ifdef HAVE_DUCKDB_H_GE_V1_2_0
40
30
  #include "./instance_cache.h"
41
- #endif
42
31
 
43
32
  extern VALUE mDuckDB;
44
33
  extern VALUE cDuckDBDatabase;
@@ -50,9 +39,6 @@ extern VALUE mDuckDBConverter;
50
39
  extern VALUE cDuckDBPreparedStatement;
51
40
  extern VALUE PositiveInfinity;
52
41
  extern VALUE NegativeInfinity;
53
-
54
- #ifdef HAVE_DUCKDB_H_GE_V1_2_0
55
42
  extern VALUE cDuckDBInstanceCache;
56
- #endif
57
43
 
58
44
  #endif
@@ -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 = '1.3.0.0'
6
+ VERSION = '1.3.1.0'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duckdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0.0
4
+ version: 1.3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Suketa