duckdb 1.2.2.0 → 1.3.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 +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 +3 -3
- data/CHANGELOG.md +13 -0
- data/Dockerfile +5 -4
- data/Gemfile.lock +4 -4
- data/README.md +1 -1
- data/ext/duckdb/extconf.rb +3 -0
- data/ext/duckdb/pending_result.c +1 -18
- data/ext/duckdb/result.c +0 -55
- data/ext/duckdb/ruby-duckdb.h +4 -0
- 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: 419a694a8223198ebddb3470cddc96c164fa684ebde604edf5d0df401376c0d5
|
4
|
+
data.tar.gz: c832f287dc1fa48532d2b69dc49c0de13f5d9f2811a49cf3dcd5ba23f985be71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48b21a62da9e1dff74bc2b2ecc775e93c1fbd01691bed443fd04686875e6b5285a4f4d61ea7befb961bbc2c98c610caa0da712fdbd339b3b5efe83d07c4bfc3
|
7
|
+
data.tar.gz: 06f7a29029833de5f912343432c8391cecb3404c0069b14d190617291634f790ea55433f5178d9114bd6f7e4a2c7729ce9b808343c48d820842f96fa771bbe22
|
@@ -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.1.3', '1.1.1']
|
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']
|
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.1.3', '1.1.1']
|
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']
|
20
20
|
|
21
21
|
steps:
|
22
22
|
- uses: actions/checkout@v4
|
@@ -15,9 +15,9 @@ jobs:
|
|
15
15
|
runs-on: windows-latest
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
|
-
# ruby: ['3.2.6', '3.3.
|
19
|
-
ruby: ['3.2.6', '3.3.
|
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
|
+
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']
|
21
21
|
|
22
22
|
steps:
|
23
23
|
- uses: actions/checkout@v4
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
|
+
|
4
5
|
# Unreleased
|
5
6
|
|
7
|
+
# 1.3.0.0 - 2025-05-31
|
8
|
+
- bump duckdb to 1.3.0 on CI.
|
9
|
+
|
10
|
+
## Breaking changes
|
11
|
+
- `DuckDB::Result#streaming?` is deprecated.
|
12
|
+
- The second argument of `DuckDB::PendingResult.new` is now meaningless. The result is the same when it is set to true.
|
13
|
+
- `DuckDB::PreparedStatement#pending_prepared` behaves the same as `DuckDB::PreparedStatement#pending_prepared_stream`.
|
14
|
+
- `DuckDB::PreparedStatement#pending_prepared_stream` will be depreacted. Use `pending_prepared` instead.
|
15
|
+
- `DuckDB::Connection#async_query` behaves the same as `DuckDB::Connection#async_query_stream`.
|
16
|
+
- `DuckDB::Connection#async_query_stream` will be deprecated. Use `async_query` instead.
|
17
|
+
- `DuckDB::Result#chunk_each`, `DuckDB::Result.use_chunk_each`, `DuckDB::Result.use_chunk_each?` are deprecated.
|
18
|
+
|
6
19
|
# 1.2.2.0 - 2025-05-11
|
7
20
|
- drop Ruby 3.1.
|
8
21
|
- implement `DuckDB::InstanceCache` class.
|
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.0
|
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.0.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.0)
|
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/extconf.rb
CHANGED
@@ -64,6 +64,9 @@ have_func('duckdb_result_error_type', 'duckdb.h')
|
|
64
64
|
# check duckdb >= 1.2.0
|
65
65
|
have_func('duckdb_create_instance_cache', 'duckdb.h')
|
66
66
|
|
67
|
+
# check duckdb >= 1.3.0
|
68
|
+
have_func('duckdb_get_table_names', 'duckdb.h')
|
69
|
+
|
67
70
|
# Building with enabled DUCKDB_API_NO_DEPRECATED is failed with DuckDB v1.1.0 only.
|
68
71
|
# DuckDB v1.1.1 is fixed this issue https://github.com/duckdb/duckdb/issues/13872.
|
69
72
|
have_const('DUCKDB_TYPE_SQLNULL', 'duckdb.h')
|
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);
|
@@ -168,63 +166,12 @@ static VALUE duckdb_result_columns(VALUE oDuckDBResult) {
|
|
168
166
|
return ary;
|
169
167
|
}
|
170
168
|
|
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
169
|
static VALUE destroy_data_chunk(VALUE arg) {
|
188
170
|
struct chunk_arg *p = (struct chunk_arg *)arg;
|
189
171
|
duckdb_destroy_data_chunk(&(p->chunk));
|
190
172
|
return Qnil;
|
191
173
|
}
|
192
174
|
|
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
175
|
/* :nodoc: */
|
229
176
|
static VALUE duckdb_result__chunk_stream(VALUE oDuckDBResult) {
|
230
177
|
rubyDuckDBResult *ctx;
|
@@ -877,8 +824,6 @@ void rbduckdb_init_duckdb_result(void) {
|
|
877
824
|
rb_define_method(cDuckDBResult, "column_count", duckdb_result_column_count, 0);
|
878
825
|
rb_define_method(cDuckDBResult, "rows_changed", duckdb_result_rows_changed, 0);
|
879
826
|
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
827
|
rb_define_private_method(cDuckDBResult, "_chunk_stream", duckdb_result__chunk_stream, 0);
|
883
828
|
rb_define_private_method(cDuckDBResult, "_column_type", duckdb_result__column_type, 1);
|
884
829
|
rb_define_private_method(cDuckDBResult, "_return_type", duckdb_result__return_type, 0);
|
data/ext/duckdb/ruby-duckdb.h
CHANGED
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