duckdb 1.2.2.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 +4 -4
- data/.github/workflows/test_on_macos.yml +2 -2
- data/.github/workflows/test_on_ubuntu.yml +2 -2
- data/.github/workflows/test_on_windows.yml +2 -3
- data/CHANGELOG.md +17 -1
- data/Dockerfile +5 -4
- data/Gemfile.lock +4 -4
- data/README.md +1 -1
- data/ext/duckdb/duckdb.c +0 -2
- data/ext/duckdb/extconf.rb +4 -8
- data/ext/duckdb/instance_cache.c +0 -2
- data/ext/duckdb/instance_cache.h +0 -5
- data/ext/duckdb/pending_result.c +1 -18
- data/ext/duckdb/result.c +34 -67
- data/ext/duckdb/ruby-duckdb.h +2 -12
- data/lib/duckdb/connection.rb +3 -4
- data/lib/duckdb/prepared_statement.rb +2 -1
- data/lib/duckdb/result.rb +2 -22
- data/lib/duckdb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 979c1ffbe5e1137870bd777377ef16cb7ddde8499d5d9fd14fcd6a5fe401ffda
|
4
|
+
data.tar.gz: 72d970b664aed935c451a95e48818584cf0ecd029ade167bef88235eed62fc6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfb967f5ce29966491958e8e0c724716eacb7d36e0692a522b01ebca148e26ae5306cbc9306d64299fec16e79f96967863dad73cdc2c0d77bf4382bacfd25a00
|
7
|
+
data.tar.gz: 9a1edecd631f9b7e891b49afd71eea1baebdf1defc6488222469b6e435ce39510ecfaadcb3329d387500bbf49d87ac3344ac11ffb17ffb257836c6c6007b5811
|
@@ -15,8 +15,8 @@ jobs:
|
|
15
15
|
runs-on: macos-latest
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
|
-
ruby: ['3.2.7', '3.3.8', '3.4.2', 'head']
|
19
|
-
duckdb: ['1.2.2', '1.
|
18
|
+
ruby: ['3.2.7', '3.3.8', '3.4.2', 'head', '3.5.0-preview1']
|
19
|
+
duckdb: ['1.2.2', '1.3.1']
|
20
20
|
|
21
21
|
steps:
|
22
22
|
- uses: actions/checkout@v4
|
@@ -15,8 +15,8 @@ jobs:
|
|
15
15
|
runs-on: ubuntu-latest
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
|
-
ruby: ['3.2.7', '3.3.8', '3.4.2', 'head']
|
19
|
-
duckdb: ['1.2.2', '1.
|
18
|
+
ruby: ['3.2.7', '3.3.8', '3.4.2', 'head', '3.5.0-preview1']
|
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
|
-
|
19
|
-
|
20
|
-
duckdb: ['1.2.2', '1.1.3', '1.1.1']
|
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
@@ -1,7 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
|
-
|
4
|
+
|
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.
|
9
|
+
|
10
|
+
# 1.3.0.0 - 2025-05-31
|
11
|
+
- bump duckdb to 1.3.0 on CI.
|
12
|
+
|
13
|
+
## Breaking changes
|
14
|
+
- `DuckDB::Result#streaming?` is deprecated.
|
15
|
+
- The second argument of `DuckDB::PendingResult.new` is now meaningless. The result is the same when it is set to true.
|
16
|
+
- `DuckDB::PreparedStatement#pending_prepared` behaves the same as `DuckDB::PreparedStatement#pending_prepared_stream`.
|
17
|
+
- `DuckDB::PreparedStatement#pending_prepared_stream` will be depreacted. Use `pending_prepared` instead.
|
18
|
+
- `DuckDB::Connection#async_query` behaves the same as `DuckDB::Connection#async_query_stream`.
|
19
|
+
- `DuckDB::Connection#async_query_stream` will be deprecated. Use `async_query` instead.
|
20
|
+
- `DuckDB::Result#chunk_each`, `DuckDB::Result.use_chunk_each`, `DuckDB::Result.use_chunk_each?` are deprecated.
|
5
21
|
|
6
22
|
# 1.2.2.0 - 2025-05-11
|
7
23
|
- drop Ruby 3.1.
|
data/Dockerfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
ARG RUBY_VERSION=3.4.
|
1
|
+
ARG RUBY_VERSION=3.4.4
|
2
2
|
FROM ruby:${RUBY_VERSION}
|
3
3
|
|
4
|
-
ARG DUCKDB_VERSION=1.
|
4
|
+
ARG DUCKDB_VERSION=1.3.1
|
5
5
|
ARG VALGRIND_VERSION=3.21.0
|
6
6
|
|
7
|
-
RUN apt update -qq && \
|
8
|
-
apt install -y build-essential curl git wget libc6-dbg
|
7
|
+
RUN apt-get update -qq && \
|
8
|
+
apt-get install -y --no-install-recommends build-essential curl git wget libc6-dbg && \
|
9
|
+
apt-get clean
|
9
10
|
|
10
11
|
COPY getduckdb.sh .
|
11
12
|
RUN ./getduckdb.sh
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
duckdb (1.
|
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.
|
12
|
-
mini_portile2 (2.8.
|
11
|
+
bigdecimal (3.2.2)
|
12
|
+
mini_portile2 (2.8.9)
|
13
13
|
minitest (5.25.5)
|
14
14
|
nokogiri (1.18.8)
|
15
15
|
mini_portile2 (~> 2.8.2)
|
@@ -25,7 +25,7 @@ GEM
|
|
25
25
|
nokogiri (1.18.8-x86_64-linux-gnu)
|
26
26
|
racc (~> 1.4)
|
27
27
|
racc (1.8.1)
|
28
|
-
rake (13.
|
28
|
+
rake (13.3.0)
|
29
29
|
rake-compiler (1.3.0)
|
30
30
|
rake
|
31
31
|
ruby_memcheck (3.0.1)
|
data/README.md
CHANGED
@@ -146,7 +146,7 @@ result = con.prepare('SELECT * FROM users WHERE name = $name AND email = $email'
|
|
146
146
|
You can use async query.
|
147
147
|
|
148
148
|
```ruby
|
149
|
-
pending_result = con.
|
149
|
+
pending_result = con.async_query('SLOW QUERY')
|
150
150
|
pending_result.execute_task while pending_result.state == :not_ready
|
151
151
|
|
152
152
|
result = pending_result.execute_pending
|
data/ext/duckdb/duckdb.c
CHANGED
data/ext/duckdb/extconf.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'mkmf'
|
4
4
|
|
5
|
-
DUCKDB_REQUIRED_VERSION = '1.
|
5
|
+
DUCKDB_REQUIRED_VERSION = '1.2.0'
|
6
6
|
|
7
7
|
def check_duckdb_header(header, version)
|
8
8
|
found = find_header(
|
@@ -56,17 +56,13 @@ end
|
|
56
56
|
dir_config('duckdb')
|
57
57
|
|
58
58
|
check_duckdb_header('duckdb.h', DUCKDB_REQUIRED_VERSION)
|
59
|
-
check_duckdb_library('duckdb', '
|
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')
|
66
63
|
|
67
|
-
#
|
68
|
-
|
69
|
-
have_const('DUCKDB_TYPE_SQLNULL', 'duckdb.h')
|
64
|
+
# check duckdb >= 1.3.0
|
65
|
+
have_func('duckdb_get_table_names', 'duckdb.h')
|
70
66
|
|
71
67
|
$CFLAGS << ' -DDUCKDB_API_NO_DEPRECATED' if ENV['DUCKDB_API_NO_DEPRECATED']
|
72
68
|
|
data/ext/duckdb/instance_cache.c
CHANGED
@@ -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
|
data/ext/duckdb/instance_cache.h
CHANGED
@@ -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/pending_result.c
CHANGED
@@ -40,13 +40,9 @@ static VALUE duckdb_pending_result_initialize(int argc, VALUE *argv, VALUE self)
|
|
40
40
|
VALUE streaming_p = Qfalse;
|
41
41
|
duckdb_state state;
|
42
42
|
|
43
|
-
/*
|
44
|
-
* FIXME: The 2nd argument is deprecated and will be removed in the future.
|
45
|
-
* The behavior will be same as streaming.
|
46
43
|
if (argc == 2) {
|
47
|
-
rb_warn("The
|
44
|
+
rb_warn("The second argument of `DuckDB::PendingResult#new` is now meaningless. The result is the same when it is set to true.");
|
48
45
|
}
|
49
|
-
*/
|
50
46
|
rb_scan_args(argc, argv, "11", &oDuckDBPreparedStatement, &streaming_p);
|
51
47
|
|
52
48
|
if (rb_obj_is_kind_of(oDuckDBPreparedStatement, cDuckDBPreparedStatement) != Qtrue) {
|
@@ -56,20 +52,7 @@ static VALUE duckdb_pending_result_initialize(int argc, VALUE *argv, VALUE self)
|
|
56
52
|
rubyDuckDBPendingResult *ctx = get_struct_pending_result(self);
|
57
53
|
rubyDuckDBPreparedStatement *stmt = get_struct_prepared_statement(oDuckDBPreparedStatement);
|
58
54
|
|
59
|
-
#ifdef DUCKDB_API_NO_DEPRECATED
|
60
55
|
state = duckdb_pending_prepared(stmt->prepared_statement, &(ctx->pending_result));
|
61
|
-
#else
|
62
|
-
/*
|
63
|
-
* FIXME: streaming_p check will be removed in the future.
|
64
|
-
*
|
65
|
-
* state = duckdb_pending_prepared(stmt->prepared_statement, &(ctx->pending_result));
|
66
|
-
*/
|
67
|
-
if (!NIL_P(streaming_p) && streaming_p == Qtrue) {
|
68
|
-
state = duckdb_pending_prepared_streaming(stmt->prepared_statement, &(ctx->pending_result));
|
69
|
-
} else {
|
70
|
-
state = duckdb_pending_prepared(stmt->prepared_statement, &(ctx->pending_result));
|
71
|
-
}
|
72
|
-
#endif
|
73
56
|
|
74
57
|
if (state == DuckDBError) {
|
75
58
|
rb_raise(eDuckDBError, "%s", duckdb_pending_error(ctx->pending_result));
|
data/ext/duckdb/result.c
CHANGED
@@ -26,9 +26,7 @@ static size_t memsize(const void *p);
|
|
26
26
|
static VALUE duckdb_result_column_count(VALUE oDuckDBResult);
|
27
27
|
static VALUE duckdb_result_rows_changed(VALUE oDuckDBResult);
|
28
28
|
static VALUE duckdb_result_columns(VALUE oDuckDBResult);
|
29
|
-
static VALUE duckdb_result_streaming_p(VALUE oDuckDBResult);
|
30
29
|
static VALUE destroy_data_chunk(VALUE arg);
|
31
|
-
static VALUE duckdb_result__chunk_each(VALUE oDuckDBResult);
|
32
30
|
|
33
31
|
static VALUE duckdb_result__chunk_stream(VALUE oDuckDBResult);
|
34
32
|
static VALUE yield_rows(VALUE arg);
|
@@ -50,6 +48,9 @@ static VALUE vector_hugeint(void* vector_data, idx_t row_idx);
|
|
50
48
|
static VALUE vector_uhugeint(void* vector_data, idx_t row_idx);
|
51
49
|
static VALUE vector_decimal(duckdb_logical_type ty, void* vector_data, idx_t row_idx);
|
52
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
|
+
|
53
54
|
static VALUE vector_timestamp_s(void* vector_data, idx_t row_idx);
|
54
55
|
static VALUE vector_timestamp_ms(void* vector_data, idx_t row_idx);
|
55
56
|
static VALUE vector_timestamp_ns(void* vector_data, idx_t row_idx);
|
@@ -168,63 +169,12 @@ static VALUE duckdb_result_columns(VALUE oDuckDBResult) {
|
|
168
169
|
return ary;
|
169
170
|
}
|
170
171
|
|
171
|
-
/*
|
172
|
-
* :nodoc:
|
173
|
-
*/
|
174
|
-
static VALUE duckdb_result_streaming_p(VALUE oDuckDBResult) {
|
175
|
-
rubyDuckDBResult *ctx;
|
176
|
-
|
177
|
-
#ifdef DUCKDB_API_NO_DEPRECATED
|
178
|
-
return Qtrue;
|
179
|
-
#else
|
180
|
-
rb_warn("`DuckDB::Result#streaming?` will be deprecated in the future.");
|
181
|
-
/* FIXME streaming is allways true. so this method is not useful and deprecated. */
|
182
|
-
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
183
|
-
return duckdb_result_is_streaming(ctx->result) ? Qtrue : Qfalse;
|
184
|
-
#endif
|
185
|
-
}
|
186
|
-
|
187
172
|
static VALUE destroy_data_chunk(VALUE arg) {
|
188
173
|
struct chunk_arg *p = (struct chunk_arg *)arg;
|
189
174
|
duckdb_destroy_data_chunk(&(p->chunk));
|
190
175
|
return Qnil;
|
191
176
|
}
|
192
177
|
|
193
|
-
/* :nodoc: */
|
194
|
-
static VALUE duckdb_result__chunk_each(VALUE oDuckDBResult) {
|
195
|
-
/*
|
196
|
-
#ifdef HAVE_DUCKDB_H_GE_V1_0_0
|
197
|
-
return duckdb_result__chunk_stream(oDuckDBResult);
|
198
|
-
#else
|
199
|
-
*/
|
200
|
-
rubyDuckDBResult *ctx;
|
201
|
-
struct chunk_arg arg;
|
202
|
-
idx_t chunk_count;
|
203
|
-
idx_t chunk_idx;
|
204
|
-
|
205
|
-
#ifdef DUCKDB_API_NO_DEPRECATED
|
206
|
-
//TODO: use duckdb_fetch_chunk instead of duckdb_result_chunk_count and duckdb_result_get_chunk.
|
207
|
-
// duckdb_result_chunk_count will be deprecated in the future.
|
208
|
-
// duckdb_result_get_chunk will be deprecated in the future.
|
209
|
-
#else
|
210
|
-
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
211
|
-
|
212
|
-
arg.col_count = duckdb_column_count(&(ctx->result));
|
213
|
-
chunk_count = duckdb_result_chunk_count(ctx->result);
|
214
|
-
|
215
|
-
RETURN_ENUMERATOR(oDuckDBResult, 0, 0);
|
216
|
-
|
217
|
-
for (chunk_idx = 0; chunk_idx < chunk_count; chunk_idx++) {
|
218
|
-
arg.chunk = duckdb_result_get_chunk(ctx->result, chunk_idx);
|
219
|
-
rb_ensure(yield_rows, (VALUE)&arg, destroy_data_chunk, (VALUE)&arg);
|
220
|
-
}
|
221
|
-
#endif
|
222
|
-
return Qnil;
|
223
|
-
/*
|
224
|
-
#endif
|
225
|
-
*/
|
226
|
-
}
|
227
|
-
|
228
178
|
/* :nodoc: */
|
229
179
|
static VALUE duckdb_result__chunk_stream(VALUE oDuckDBResult) {
|
230
180
|
rubyDuckDBResult *ctx;
|
@@ -276,14 +226,7 @@ static VALUE duckdb_result__column_type(VALUE oDuckDBResult, VALUE col_idx) {
|
|
276
226
|
static VALUE duckdb_result__return_type(VALUE oDuckDBResult) {
|
277
227
|
rubyDuckDBResult *ctx;
|
278
228
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
279
|
-
/*
|
280
|
-
* remove this #if ... #else statement when dropping duckdb 1.1.0.
|
281
|
-
*/
|
282
|
-
#if !defined(HAVE_DUCKDB_H_GE_V1_1_1) && defined(DUCKDB_API_NO_DEPRECATED)
|
283
|
-
rb_raise(eDuckDBError, "duckdb_result_return_type C-API is not available with duckdb v1.1.0 with enabled DUCKDB_API_NO_DEPRECATED.");
|
284
|
-
#else
|
285
229
|
return INT2FIX(duckdb_result_return_type(ctx->result));
|
286
|
-
#endif
|
287
230
|
}
|
288
231
|
|
289
232
|
/* :nodoc: */
|
@@ -491,17 +434,43 @@ static VALUE infinite_timestamp_value(duckdb_timestamp timestamp) {
|
|
491
434
|
return Qnil;
|
492
435
|
}
|
493
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
|
+
|
494
446
|
static VALUE vector_timestamp_s(void* vector_data, idx_t row_idx) {
|
495
|
-
|
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
|
+
}
|
496
452
|
return rb_funcall(mDuckDBConverter, id__to_time_from_duckdb_timestamp_s, 1,
|
497
|
-
LL2NUM(data.
|
498
|
-
|
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;
|
499
464
|
}
|
500
465
|
|
501
466
|
static VALUE vector_timestamp_ms(void* vector_data, idx_t row_idx) {
|
502
|
-
|
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
|
+
}
|
503
472
|
return rb_funcall(mDuckDBConverter, id__to_time_from_duckdb_timestamp_ms, 1,
|
504
|
-
LL2NUM(data.
|
473
|
+
LL2NUM(data.millis)
|
505
474
|
);
|
506
475
|
}
|
507
476
|
|
@@ -877,8 +846,6 @@ void rbduckdb_init_duckdb_result(void) {
|
|
877
846
|
rb_define_method(cDuckDBResult, "column_count", duckdb_result_column_count, 0);
|
878
847
|
rb_define_method(cDuckDBResult, "rows_changed", duckdb_result_rows_changed, 0);
|
879
848
|
rb_define_method(cDuckDBResult, "columns", duckdb_result_columns, 0);
|
880
|
-
rb_define_method(cDuckDBResult, "streaming?", duckdb_result_streaming_p, 0);
|
881
|
-
rb_define_private_method(cDuckDBResult, "_chunk_each", duckdb_result__chunk_each, 0);
|
882
849
|
rb_define_private_method(cDuckDBResult, "_chunk_stream", duckdb_result__chunk_stream, 0);
|
883
850
|
rb_define_private_method(cDuckDBResult, "_column_type", duckdb_result__column_type, 1);
|
884
851
|
rb_define_private_method(cDuckDBResult, "_return_type", duckdb_result__return_type, 0);
|
data/ext/duckdb/ruby-duckdb.h
CHANGED
@@ -8,12 +8,8 @@
|
|
8
8
|
#include "ruby/thread.h"
|
9
9
|
#include <duckdb.h>
|
10
10
|
|
11
|
-
#ifdef
|
12
|
-
#define
|
13
|
-
#endif
|
14
|
-
|
15
|
-
#ifdef HAVE_DUCKDB_CREATE_INSTANCE_CACHE
|
16
|
-
#define HAVE_DUCKDB_H_GE_V1_2_0 1
|
11
|
+
#ifdef HAVE_DUCKDB_GET_TABLE_NAMES
|
12
|
+
#define HAVE_DUCKDB_H_GE_V1_3_0 1
|
17
13
|
#endif
|
18
14
|
|
19
15
|
#include "./error.h"
|
@@ -31,10 +27,7 @@
|
|
31
27
|
#include "./blob.h"
|
32
28
|
#include "./appender.h"
|
33
29
|
#include "./config.h"
|
34
|
-
|
35
|
-
#ifdef HAVE_DUCKDB_H_GE_V1_2_0
|
36
30
|
#include "./instance_cache.h"
|
37
|
-
#endif
|
38
31
|
|
39
32
|
extern VALUE mDuckDB;
|
40
33
|
extern VALUE cDuckDBDatabase;
|
@@ -46,9 +39,6 @@ extern VALUE mDuckDBConverter;
|
|
46
39
|
extern VALUE cDuckDBPreparedStatement;
|
47
40
|
extern VALUE PositiveInfinity;
|
48
41
|
extern VALUE NegativeInfinity;
|
49
|
-
|
50
|
-
#ifdef HAVE_DUCKDB_H_GE_V1_2_0
|
51
42
|
extern VALUE cDuckDBInstanceCache;
|
52
|
-
#endif
|
53
43
|
|
54
44
|
#endif
|
data/lib/duckdb/connection.rb
CHANGED
@@ -81,10 +81,9 @@ module DuckDB
|
|
81
81
|
# result = pending_result.execute_pending
|
82
82
|
# result.each.first
|
83
83
|
def async_query_stream(sql, *args, **kwargs)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
end
|
84
|
+
warn("`#{self.class}#{__method__}` will be deprecated. Use `#{self.class}#async_query` instead.")
|
85
|
+
|
86
|
+
async_query(sql, *args, **kwargs)
|
88
87
|
end
|
89
88
|
|
90
89
|
# connects DuckDB database
|
@@ -52,7 +52,8 @@ module DuckDB
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def pending_prepared_stream
|
55
|
-
|
55
|
+
warn("`#{self.class}##{__method__}` will be deprecated. use `#{self.class}#pending_prepared` instead")
|
56
|
+
pending_prepared
|
56
57
|
end
|
57
58
|
|
58
59
|
# returns statement type. The return value is one of the following symbols:
|
data/lib/duckdb/result.rb
CHANGED
@@ -28,36 +28,16 @@ module DuckDB
|
|
28
28
|
|
29
29
|
alias column_size column_count
|
30
30
|
|
31
|
-
@use_chunk_each = false
|
32
|
-
|
33
31
|
class << self
|
34
32
|
def new
|
35
33
|
raise DuckDB::Error, 'DuckDB::Result cannot be instantiated directly.'
|
36
34
|
end
|
37
|
-
|
38
|
-
attr_writer :use_chunk_each
|
39
|
-
|
40
|
-
def use_chunk_each?
|
41
|
-
@use_chunk_each
|
42
|
-
end
|
43
35
|
end
|
44
36
|
|
45
37
|
def each(&)
|
46
|
-
|
47
|
-
return chunk_each unless block_given?
|
48
|
-
|
49
|
-
chunk_each(&)
|
50
|
-
else
|
51
|
-
return _chunk_stream unless block_given?
|
52
|
-
|
53
|
-
_chunk_stream(&)
|
54
|
-
end
|
55
|
-
end
|
38
|
+
return _chunk_stream unless block_given?
|
56
39
|
|
57
|
-
|
58
|
-
def chunk_each(&)
|
59
|
-
warn 'DuckDB::Result#chunk_each will be deprecated.'
|
60
|
-
_chunk_each(&)
|
40
|
+
_chunk_stream(&)
|
61
41
|
end
|
62
42
|
|
63
43
|
# returns return type. The return value is one of the following symbols:
|
data/lib/duckdb/version.rb
CHANGED