duckdb 1.5.5.0 → 1.5.6.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/CHANGELOG.md +17 -0
- data/ext/duckdb/aggregate_function.c +298 -60
- data/ext/duckdb/aggregate_function_set.c +3 -4
- data/ext/duckdb/appender.c +33 -7
- data/ext/duckdb/arrow_array_stream.c +6 -2
- data/ext/duckdb/arrow_import.c +1 -1
- data/ext/duckdb/client_context.c +1 -1
- data/ext/duckdb/column.c +1 -1
- data/ext/duckdb/column.h +0 -1
- data/ext/duckdb/config.c +1 -1
- data/ext/duckdb/connection.c +48 -22
- data/ext/duckdb/connection.h +2 -1
- data/ext/duckdb/data_chunk.c +1 -1
- data/ext/duckdb/database.c +80 -4
- data/ext/duckdb/database.h +12 -0
- data/ext/duckdb/expression.c +1 -1
- data/ext/duckdb/extracted_statements.c +1 -1
- data/ext/duckdb/function_executor.c +166 -32
- data/ext/duckdb/function_executor.h +18 -6
- data/ext/duckdb/instance_cache.c +85 -3
- data/ext/duckdb/instance_cache.h +6 -0
- data/ext/duckdb/logical_type.c +1 -1
- data/ext/duckdb/pending_result.c +6 -1
- data/ext/duckdb/prepared_statement.c +14 -2
- data/ext/duckdb/result.c +6 -1
- data/ext/duckdb/result.h +1 -1
- data/ext/duckdb/scalar_function.c +18 -25
- data/ext/duckdb/scalar_function_bind_info.c +1 -1
- data/ext/duckdb/scalar_function_set.c +3 -4
- data/ext/duckdb/table_description.c +1 -1
- data/ext/duckdb/table_function.c +16 -21
- data/ext/duckdb/table_function_bind_info.c +29 -1
- data/ext/duckdb/table_function_bind_info.h +1 -0
- data/ext/duckdb/table_function_function_info.c +23 -1
- data/ext/duckdb/table_function_init_info.c +20 -1
- data/ext/duckdb/value.c +2 -2
- data/ext/duckdb/vector.c +1 -1
- data/lib/duckdb/appender.rb +1 -2
- data/lib/duckdb/converter/int_to_sym.rb +3 -0
- data/lib/duckdb/converter.rb +1 -2
- data/lib/duckdb/data_chunk.rb +1 -2
- data/lib/duckdb/prepared_statement.rb +1 -2
- data/lib/duckdb/table_function/function_info.rb +1 -2
- data/lib/duckdb/table_function/init_info.rb +1 -2
- data/lib/duckdb/table_function.rb +1 -2
- data/lib/duckdb/vector.rb +1 -2
- data/lib/duckdb/version.rb +1 -1
- metadata +2 -2
|
@@ -19,7 +19,7 @@ static VALUE table_description__column_has_default(VALUE self, VALUE idx);
|
|
|
19
19
|
static const rb_data_type_t table_description_data_type = {
|
|
20
20
|
"DuckDB/TableDescription",
|
|
21
21
|
{NULL, deallocate, memsize,},
|
|
22
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
22
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
static void deallocate(void *ctx) {
|
data/ext/duckdb/table_function.c
CHANGED
|
@@ -30,14 +30,14 @@ static void table_function_local_init_callback(duckdb_init_info info);
|
|
|
30
30
|
static const rb_data_type_t table_function_data_type = {
|
|
31
31
|
"DuckDB/TableFunction",
|
|
32
32
|
{mark, deallocate, memsize, compact},
|
|
33
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
33
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
static void mark(void *ctx) {
|
|
37
37
|
rubyDuckDBTableFunction *p = (rubyDuckDBTableFunction *)ctx;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
rb_gc_mark_movable(p->bind_proc);
|
|
39
|
+
rb_gc_mark_movable(p->init_proc);
|
|
40
|
+
rb_gc_mark_movable(p->execute_proc);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
static void deallocate(void *ctx) {
|
|
@@ -210,7 +210,7 @@ static VALUE table_function_bind(VALUE self) {
|
|
|
210
210
|
rb_raise(eDuckDBError, "Table function is destroyed");
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
ctx->bind_proc
|
|
213
|
+
RB_OBJ_WRITE(self, &ctx->bind_proc, rb_block_proc());
|
|
214
214
|
|
|
215
215
|
duckdb_table_function_set_bind(ctx->table_function, table_function_bind_callback);
|
|
216
216
|
|
|
@@ -243,10 +243,9 @@ static void execute_bind_callback_protected(void *user_data) {
|
|
|
243
243
|
rb_protect(call_bind_proc, (VALUE)call_args, &state);
|
|
244
244
|
|
|
245
245
|
if (state) {
|
|
246
|
-
VALUE
|
|
247
|
-
VALUE msg = rb_funcall(err, rb_intern("message"), 0);
|
|
246
|
+
VALUE msg = rbduckdb_pending_error_message();
|
|
248
247
|
duckdb_bind_set_error(darg->info, StringValueCStr(msg));
|
|
249
|
-
|
|
248
|
+
RB_GC_GUARD(msg);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
|
|
@@ -287,7 +286,7 @@ static VALUE table_function_init(VALUE self) {
|
|
|
287
286
|
rb_raise(eDuckDBError, "Table function is destroyed");
|
|
288
287
|
}
|
|
289
288
|
|
|
290
|
-
ctx->init_proc
|
|
289
|
+
RB_OBJ_WRITE(self, &ctx->init_proc, rb_block_proc());
|
|
291
290
|
duckdb_table_function_set_init(ctx->table_function, table_function_init_callback);
|
|
292
291
|
|
|
293
292
|
rbduckdb_function_executor_ensure_started();
|
|
@@ -319,10 +318,9 @@ static void execute_init_callback_protected(void *user_data) {
|
|
|
319
318
|
rb_protect(call_init_proc, (VALUE)call_args, &state);
|
|
320
319
|
|
|
321
320
|
if (state) {
|
|
322
|
-
VALUE
|
|
323
|
-
VALUE msg = rb_funcall(err, rb_intern("message"), 0);
|
|
321
|
+
VALUE msg = rbduckdb_pending_error_message();
|
|
324
322
|
duckdb_init_set_error(darg->info, StringValueCStr(msg));
|
|
325
|
-
|
|
323
|
+
RB_GC_GUARD(msg);
|
|
326
324
|
}
|
|
327
325
|
}
|
|
328
326
|
|
|
@@ -361,7 +359,7 @@ static VALUE table_function_execute(VALUE self) {
|
|
|
361
359
|
|
|
362
360
|
TypedData_Get_Struct(self, rubyDuckDBTableFunction, &table_function_data_type, ctx);
|
|
363
361
|
|
|
364
|
-
ctx->execute_proc
|
|
362
|
+
RB_OBJ_WRITE(self, &ctx->execute_proc, rb_block_proc());
|
|
365
363
|
duckdb_table_function_set_function(ctx->table_function, table_function_execute_callback);
|
|
366
364
|
#ifdef HAVE_DUCKDB_H_GE_V1_5_0
|
|
367
365
|
/* Per-worker proxy threads for the execute path (DuckDB >= 1.5.0). */
|
|
@@ -404,10 +402,9 @@ static void execute_execute_callback_protected(void *user_data) {
|
|
|
404
402
|
rb_protect(call_execute_proc, (VALUE)call_args, &state);
|
|
405
403
|
|
|
406
404
|
if (state) {
|
|
407
|
-
VALUE
|
|
408
|
-
VALUE msg = rb_funcall(err, rb_intern("message"), 0);
|
|
405
|
+
VALUE msg = rbduckdb_pending_error_message();
|
|
409
406
|
duckdb_function_set_error(darg->info, StringValueCStr(msg));
|
|
410
|
-
|
|
407
|
+
RB_GC_GUARD(msg);
|
|
411
408
|
}
|
|
412
409
|
}
|
|
413
410
|
|
|
@@ -452,11 +449,9 @@ static VALUE create_proxy_callback(VALUE varg) {
|
|
|
452
449
|
}
|
|
453
450
|
|
|
454
451
|
/*
|
|
455
|
-
* rbduckdb_worker_proxy_create may raise (NoMemError, Thread.new failure)
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* the exception instead: the proxy stays NULL, local_init sets no state, and
|
|
459
|
-
* the execute callback falls back to the global executor.
|
|
452
|
+
* rbduckdb_worker_proxy_create may raise (NoMemError, Thread.new failure).
|
|
453
|
+
* Swallow it: the proxy stays NULL, local_init sets no state, and the execute
|
|
454
|
+
* callback falls back to the global executor.
|
|
460
455
|
*/
|
|
461
456
|
static void create_proxy_callback_protected(void *user_data) {
|
|
462
457
|
int exception_state;
|
|
@@ -10,12 +10,13 @@ static VALUE table_function_bind_info_get_parameter(VALUE self, VALUE index);
|
|
|
10
10
|
static VALUE table_function_bind_info_get_named_parameter(VALUE self, VALUE name);
|
|
11
11
|
static VALUE table_function_bind_info__add_result_column(VALUE self, VALUE column_name, VALUE logical_type);
|
|
12
12
|
static VALUE table_function_bind_info_set_cardinality(VALUE self, VALUE cardinality, VALUE is_exact);
|
|
13
|
+
static VALUE table_function_bind_info_set_bind_data(VALUE self, VALUE data);
|
|
13
14
|
static VALUE table_function_bind_info_set_error(VALUE self, VALUE error);
|
|
14
15
|
|
|
15
16
|
static const rb_data_type_t bind_info_data_type = {
|
|
16
17
|
"DuckDB/TableFunctionBindInfo",
|
|
17
18
|
{NULL, deallocate, memsize,},
|
|
18
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
19
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
static void deallocate(void *ctx) {
|
|
@@ -167,6 +168,32 @@ static VALUE table_function_bind_info_set_cardinality(VALUE self, VALUE cardinal
|
|
|
167
168
|
return self;
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
/*
|
|
172
|
+
* call-seq:
|
|
173
|
+
* bind_info.bind_data = data
|
|
174
|
+
*
|
|
175
|
+
* Stores an arbitrary Ruby object as the table function's bind data. The same
|
|
176
|
+
* object can be retrieved during init and execution, and is kept alive until
|
|
177
|
+
* DuckDB frees the bind data.
|
|
178
|
+
*
|
|
179
|
+
* bind_info.bind_data = { rows: 100 }
|
|
180
|
+
*/
|
|
181
|
+
static VALUE table_function_bind_info_set_bind_data(VALUE self, VALUE data) {
|
|
182
|
+
rubyDuckDBBindInfo *ctx;
|
|
183
|
+
void *handle;
|
|
184
|
+
|
|
185
|
+
TypedData_Get_Struct(self, rubyDuckDBBindInfo, &bind_info_data_type, ctx);
|
|
186
|
+
|
|
187
|
+
if (ctx->bind_data_handle != NULL) {
|
|
188
|
+
rbduckdb_function_data_release(ctx->bind_data_handle);
|
|
189
|
+
}
|
|
190
|
+
handle = rbduckdb_function_data_register(data);
|
|
191
|
+
ctx->bind_data_handle = handle;
|
|
192
|
+
duckdb_bind_set_bind_data(ctx->bind_info, handle, rbduckdb_function_data_destroy);
|
|
193
|
+
|
|
194
|
+
return self;
|
|
195
|
+
}
|
|
196
|
+
|
|
170
197
|
/*
|
|
171
198
|
* call-seq:
|
|
172
199
|
* bind_info.set_error(error_message) -> self
|
|
@@ -198,6 +225,7 @@ void rbduckdb_init_table_function_bind_info(void) {
|
|
|
198
225
|
rb_define_method(cDuckDBTableFunctionBindInfo, "get_parameter", table_function_bind_info_get_parameter, 1);
|
|
199
226
|
rb_define_method(cDuckDBTableFunctionBindInfo, "get_named_parameter", table_function_bind_info_get_named_parameter, 1);
|
|
200
227
|
rb_define_method(cDuckDBTableFunctionBindInfo, "set_cardinality", table_function_bind_info_set_cardinality, 2);
|
|
228
|
+
rb_define_method(cDuckDBTableFunctionBindInfo, "bind_data=", table_function_bind_info_set_bind_data, 1);
|
|
201
229
|
rb_define_method(cDuckDBTableFunctionBindInfo, "set_error", table_function_bind_info_set_error, 1);
|
|
202
230
|
|
|
203
231
|
rb_define_private_method(cDuckDBTableFunctionBindInfo, "_add_result_column", table_function_bind_info__add_result_column, 2);
|
|
@@ -5,12 +5,13 @@ VALUE cDuckDBTableFunctionFunctionInfo;
|
|
|
5
5
|
static void deallocate(void *ctx);
|
|
6
6
|
static VALUE allocate(VALUE klass);
|
|
7
7
|
static size_t memsize(const void *p);
|
|
8
|
+
static VALUE table_function_function_info_bind_data(VALUE self);
|
|
8
9
|
static VALUE table_function_function_info_set_error(VALUE self, VALUE error);
|
|
9
10
|
|
|
10
11
|
static const rb_data_type_t function_info_data_type = {
|
|
11
12
|
"DuckDB/TableFunctionFunctionInfo",
|
|
12
13
|
{NULL, deallocate, memsize,},
|
|
13
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
14
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
static void deallocate(void *ctx) {
|
|
@@ -33,6 +34,26 @@ rubyDuckDBFunctionInfo *rbduckdb_get_struct_function_info(VALUE obj) {
|
|
|
33
34
|
return ctx;
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
/*
|
|
38
|
+
* call-seq:
|
|
39
|
+
* function_info.bind_data -> object or nil
|
|
40
|
+
*
|
|
41
|
+
* Returns the object stored during the bind phase with
|
|
42
|
+
* DuckDB::TableFunction::BindInfo#bind_data=, or nil if none was set.
|
|
43
|
+
*
|
|
44
|
+
* data = function_info.bind_data
|
|
45
|
+
*/
|
|
46
|
+
static VALUE table_function_function_info_bind_data(VALUE self) {
|
|
47
|
+
rubyDuckDBFunctionInfo *ctx;
|
|
48
|
+
void *bind_data;
|
|
49
|
+
|
|
50
|
+
TypedData_Get_Struct(self, rubyDuckDBFunctionInfo, &function_info_data_type, ctx);
|
|
51
|
+
|
|
52
|
+
bind_data = duckdb_function_get_bind_data(ctx->info);
|
|
53
|
+
|
|
54
|
+
return rbduckdb_function_data_lookup(bind_data);
|
|
55
|
+
}
|
|
56
|
+
|
|
36
57
|
/*
|
|
37
58
|
* call-seq:
|
|
38
59
|
* function_info.set_error(error_message) -> self
|
|
@@ -61,5 +82,6 @@ void rbduckdb_init_table_function_function_info(void) {
|
|
|
61
82
|
cDuckDBTableFunctionFunctionInfo = rb_define_class_under(cDuckDBTableFunction, "FunctionInfo", rb_cObject);
|
|
62
83
|
rb_define_alloc_func(cDuckDBTableFunctionFunctionInfo, allocate);
|
|
63
84
|
|
|
85
|
+
rb_define_method(cDuckDBTableFunctionFunctionInfo, "bind_data", table_function_function_info_bind_data, 0);
|
|
64
86
|
rb_define_method(cDuckDBTableFunctionFunctionInfo, "set_error", table_function_function_info_set_error, 1);
|
|
65
87
|
}
|
|
@@ -9,11 +9,12 @@ static VALUE table_function_init_info_set_error(VALUE self, VALUE error);
|
|
|
9
9
|
static VALUE table_function_init_info_set_max_threads(VALUE self, VALUE max_threads);
|
|
10
10
|
static VALUE table_function_init_info_column_count(VALUE self);
|
|
11
11
|
static VALUE table_function_init_info_column_index(VALUE self, VALUE index);
|
|
12
|
+
static VALUE table_function_init_info_bind_data(VALUE self);
|
|
12
13
|
|
|
13
14
|
static const rb_data_type_t init_info_data_type = {
|
|
14
15
|
"DuckDB/TableFunctionInitInfo",
|
|
15
16
|
{NULL, deallocate, memsize,},
|
|
16
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
17
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
static void deallocate(void *ctx) {
|
|
@@ -115,6 +116,23 @@ static VALUE table_function_init_info_column_index(VALUE self, VALUE index) {
|
|
|
115
116
|
return ULL2NUM(duckdb_init_get_column_index(ctx->info, NUM2ULL(index)));
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
/*
|
|
120
|
+
* call-seq:
|
|
121
|
+
* init_info.bind_data -> object or nil
|
|
122
|
+
*
|
|
123
|
+
* Returns the object stored during the bind phase with
|
|
124
|
+
* DuckDB::TableFunction::BindInfo#bind_data=, or nil if none was set.
|
|
125
|
+
*
|
|
126
|
+
* data = init_info.bind_data
|
|
127
|
+
*/
|
|
128
|
+
static VALUE table_function_init_info_bind_data(VALUE self) {
|
|
129
|
+
rubyDuckDBInitInfo *ctx;
|
|
130
|
+
|
|
131
|
+
TypedData_Get_Struct(self, rubyDuckDBInitInfo, &init_info_data_type, ctx);
|
|
132
|
+
|
|
133
|
+
return rbduckdb_function_data_lookup(duckdb_init_get_bind_data(ctx->info));
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
void rbduckdb_init_table_function_init_info(void) {
|
|
119
137
|
#if 0
|
|
120
138
|
VALUE mDuckDB = rb_define_module("DuckDB");
|
|
@@ -127,4 +145,5 @@ void rbduckdb_init_table_function_init_info(void) {
|
|
|
127
145
|
rb_define_method(cDuckDBTableFunctionInitInfo, "max_threads=", table_function_init_info_set_max_threads, 1);
|
|
128
146
|
rb_define_method(cDuckDBTableFunctionInitInfo, "column_count", table_function_init_info_column_count, 0);
|
|
129
147
|
rb_define_method(cDuckDBTableFunctionInitInfo, "column_index", table_function_init_info_column_index, 1);
|
|
148
|
+
rb_define_method(cDuckDBTableFunctionInitInfo, "bind_data", table_function_init_info_bind_data, 0);
|
|
130
149
|
}
|
data/ext/duckdb/value.c
CHANGED
|
@@ -53,7 +53,7 @@ static VALUE value_to_ruby(VALUE self);
|
|
|
53
53
|
static const rb_data_type_t value_data_type = {
|
|
54
54
|
"DuckDB/Value",
|
|
55
55
|
{NULL, deallocate, memsize,},
|
|
56
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
56
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
static void deallocate(void * ctx) {
|
|
@@ -332,7 +332,7 @@ static idx_t marshal_values(VALUE ary, duckdb_value **out, volatile VALUE *guard
|
|
|
332
332
|
idx_t i;
|
|
333
333
|
|
|
334
334
|
for (i = 0; i < n; i++) {
|
|
335
|
-
buf[i] = rbduckdb_get_struct_value(
|
|
335
|
+
buf[i] = rbduckdb_get_struct_value(rb_ary_entry(ary, (long)i))->value;
|
|
336
336
|
}
|
|
337
337
|
*out = buf;
|
|
338
338
|
return n;
|
data/ext/duckdb/vector.c
CHANGED
|
@@ -15,7 +15,7 @@ static VALUE vector_set_validity(VALUE self, VALUE index, VALUE valid);
|
|
|
15
15
|
static const rb_data_type_t vector_data_type = {
|
|
16
16
|
"DuckDB/Vector",
|
|
17
17
|
{NULL, deallocate, memsize,},
|
|
18
|
-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
|
18
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
static void deallocate(void *ctx) {
|
data/lib/duckdb/appender.rb
CHANGED
|
@@ -759,7 +759,7 @@ module DuckDB
|
|
|
759
759
|
# appender.append(1)
|
|
760
760
|
# appender.append('Alice')
|
|
761
761
|
# appender.end_row
|
|
762
|
-
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
762
|
+
# rubocop:disable-next Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
763
763
|
def append(value)
|
|
764
764
|
case value
|
|
765
765
|
when NilClass
|
|
@@ -782,7 +782,6 @@ module DuckDB
|
|
|
782
782
|
raise(DuckDB::Error, "not supported type #{value} (#{value.class})")
|
|
783
783
|
end
|
|
784
784
|
end
|
|
785
|
-
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
786
785
|
|
|
787
786
|
# append a row.
|
|
788
787
|
#
|
data/lib/duckdb/converter.rb
CHANGED
|
@@ -44,14 +44,13 @@ module DuckDB
|
|
|
44
44
|
Date.new(year, month, day)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
# rubocop:disable Metrics/ParameterLists
|
|
47
|
+
# rubocop:disable-next Metrics/ParameterLists
|
|
48
48
|
def _to_time(year, month, day, hour, minute, second, microsecond)
|
|
49
49
|
Time.public_send(
|
|
50
50
|
default_timezone_utc? ? :utc : :local,
|
|
51
51
|
year, month, day, hour, minute, second, microsecond
|
|
52
52
|
)
|
|
53
53
|
end
|
|
54
|
-
# rubocop:enable Metrics/ParameterLists
|
|
55
54
|
|
|
56
55
|
def _to_time_from_duckdb_time(hour, minute, second, microsecond)
|
|
57
56
|
return Time.utc(1970, 1, 1, hour, minute, second, microsecond) if default_timezone_utc?
|
data/lib/duckdb/data_chunk.rb
CHANGED
|
@@ -44,7 +44,7 @@ module DuckDB
|
|
|
44
44
|
# @example Set NULL value
|
|
45
45
|
# output.set_value(0, 1, nil)
|
|
46
46
|
#
|
|
47
|
-
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
47
|
+
# rubocop:disable-next Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
48
48
|
def set_value(col_idx, row_idx, value)
|
|
49
49
|
vector = cached_vector(col_idx)
|
|
50
50
|
type_id = cached_type_id(col_idx, vector)
|
|
@@ -94,7 +94,6 @@ module DuckDB
|
|
|
94
94
|
|
|
95
95
|
value
|
|
96
96
|
end
|
|
97
|
-
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
98
97
|
|
|
99
98
|
#
|
|
100
99
|
# Resets the data chunk so it can be reused for another batch of rows.
|
|
@@ -379,7 +379,7 @@ module DuckDB
|
|
|
379
379
|
|
|
380
380
|
private
|
|
381
381
|
|
|
382
|
-
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
382
|
+
# rubocop:disable-next Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
383
383
|
def bind_with_index(index, value)
|
|
384
384
|
case value
|
|
385
385
|
when NilClass
|
|
@@ -402,7 +402,6 @@ module DuckDB
|
|
|
402
402
|
raise(DuckDB::Error, "not supported type `#{value}` (#{value.class})")
|
|
403
403
|
end
|
|
404
404
|
end
|
|
405
|
-
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength
|
|
406
405
|
|
|
407
406
|
def bind_integer_value(index, value)
|
|
408
407
|
if RANGE_INT64.cover?(value)
|
|
@@ -14,10 +14,9 @@ module DuckDB
|
|
|
14
14
|
# func_info.set_error('Something went wrong')
|
|
15
15
|
# end
|
|
16
16
|
#
|
|
17
|
-
# rubocop:disable Lint/EmptyClass
|
|
17
|
+
# rubocop:disable-next Lint/EmptyClass
|
|
18
18
|
class FunctionInfo
|
|
19
19
|
# All methods are defined in C extension (ext/duckdb/table_function_function_info.c)
|
|
20
20
|
end
|
|
21
|
-
# rubocop:enable Lint/EmptyClass
|
|
22
21
|
end
|
|
23
22
|
end
|
|
@@ -15,10 +15,9 @@ module DuckDB
|
|
|
15
15
|
# init_info.set_error('Initialization failed')
|
|
16
16
|
# end
|
|
17
17
|
#
|
|
18
|
-
# rubocop:disable Lint/EmptyClass
|
|
18
|
+
# rubocop:disable-next Lint/EmptyClass
|
|
19
19
|
class InitInfo
|
|
20
20
|
# All methods are defined in C extension (ext/duckdb/table_function_init_info.c)
|
|
21
21
|
end
|
|
22
|
-
# rubocop:enable Lint/EmptyClass
|
|
23
22
|
end
|
|
24
23
|
end
|
|
@@ -75,7 +75,7 @@ module DuckDB
|
|
|
75
75
|
# 3 # Return row count
|
|
76
76
|
# end
|
|
77
77
|
#
|
|
78
|
-
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
78
|
+
# rubocop:disable-next Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
79
79
|
def create(name:, columns:, parameters: nil, &)
|
|
80
80
|
raise ArgumentError, 'name is required' unless name
|
|
81
81
|
raise ArgumentError, 'columns are required' unless columns
|
|
@@ -116,7 +116,6 @@ module DuckDB
|
|
|
116
116
|
|
|
117
117
|
tf
|
|
118
118
|
end
|
|
119
|
-
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
120
119
|
|
|
121
120
|
# Registers a table adapter for a Ruby class.
|
|
122
121
|
#
|
data/lib/duckdb/vector.rb
CHANGED
|
@@ -12,9 +12,8 @@ module DuckDB
|
|
|
12
12
|
# vector.assign_string_element(0, 'hello')
|
|
13
13
|
# vector.assign_string_element(1, 'world')
|
|
14
14
|
#
|
|
15
|
-
# rubocop:disable Lint/EmptyClass
|
|
15
|
+
# rubocop:disable-next Lint/EmptyClass
|
|
16
16
|
class Vector
|
|
17
17
|
# All methods are defined in C extension (ext/duckdb/vector.c)
|
|
18
18
|
end
|
|
19
|
-
# rubocop:enable Lint/EmptyClass
|
|
20
19
|
end
|
data/lib/duckdb/version.rb
CHANGED
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.5.
|
|
4
|
+
version: 1.5.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Masaki Suketa
|
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
176
176
|
- !ruby/object:Gem::Version
|
|
177
177
|
version: '0'
|
|
178
178
|
requirements: []
|
|
179
|
-
rubygems_version: 4.0.
|
|
179
|
+
rubygems_version: 4.0.20
|
|
180
180
|
specification_version: 4
|
|
181
181
|
summary: Ruby bindings for the DuckDB database engine.
|
|
182
182
|
test_files: []
|