duckdb 1.5.2.0 → 1.5.2.1
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 +9 -0
- data/duckdb.gemspec +37 -0
- data/ext/duckdb/aggregate_function.c +61 -100
- data/ext/duckdb/aggregate_function.h +2 -2
- data/ext/duckdb/appender.c +76 -35
- data/ext/duckdb/appender.h +1 -1
- data/ext/duckdb/client_context.c +5 -5
- data/ext/duckdb/client_context.h +2 -2
- data/ext/duckdb/column.c +13 -13
- data/ext/duckdb/column.h +1 -1
- data/ext/duckdb/connection.c +40 -41
- data/ext/duckdb/connection.h +2 -2
- data/ext/duckdb/converter.h +1 -7
- data/ext/duckdb/conveter.c +6 -6
- data/ext/duckdb/data_chunk.c +22 -22
- data/ext/duckdb/data_chunk.h +2 -2
- data/ext/duckdb/database.c +10 -10
- data/ext/duckdb/database.h +1 -1
- data/ext/duckdb/duckdb.c +17 -17
- data/ext/duckdb/expression.c +8 -8
- data/ext/duckdb/expression.h +1 -1
- data/ext/duckdb/extconf.rb +4 -3
- data/ext/duckdb/extracted_statements.c +15 -15
- data/ext/duckdb/extracted_statements.h +1 -1
- data/ext/duckdb/instance_cache.c +10 -10
- data/ext/duckdb/instance_cache.h +1 -1
- data/ext/duckdb/logical_type.c +94 -133
- data/ext/duckdb/logical_type.h +2 -2
- data/ext/duckdb/memory_helper.c +28 -28
- data/ext/duckdb/pending_result.c +27 -27
- data/ext/duckdb/pending_result.h +2 -2
- data/ext/duckdb/prepared_statement.c +103 -103
- data/ext/duckdb/prepared_statement.h +2 -2
- data/ext/duckdb/result.c +33 -33
- data/ext/duckdb/result.h +2 -3
- data/ext/duckdb/ruby-duckdb.h +4 -0
- data/ext/duckdb/scalar_function.c +3 -3
- data/ext/duckdb/table_description.c +1 -1
- data/ext/duckdb/table_function.c +3 -3
- data/ext/duckdb/table_function_bind_info.c +1 -1
- data/ext/duckdb/value.c +62 -50
- data/ext/duckdb/value.h +2 -2
- data/ext/duckdb/vector.c +20 -20
- data/ext/duckdb/vector.h +2 -2
- data/lib/duckdb/aggregate_function.rb +202 -3
- data/lib/duckdb/appender.rb +74 -0
- data/lib/duckdb/connection.rb +1 -16
- data/lib/duckdb/converter.rb +5 -0
- data/lib/duckdb/logical_type.rb +1 -3
- data/lib/duckdb/prepared_statement.rb +1 -1
- data/lib/duckdb/table_function.rb +0 -1
- data/lib/duckdb/value.rb +19 -0
- data/lib/duckdb/version.rb +1 -1
- metadata +2 -2
- data/lib/duckdb/duckdb_native.so +0 -0
|
@@ -6,39 +6,39 @@ static void destroy_prepared_statement(rubyDuckDBPreparedStatement *p);
|
|
|
6
6
|
static void deallocate(void *ctx);
|
|
7
7
|
static VALUE allocate(VALUE klass);
|
|
8
8
|
static size_t memsize(const void *p);
|
|
9
|
-
static VALUE
|
|
10
|
-
static VALUE
|
|
11
|
-
static VALUE
|
|
12
|
-
static VALUE
|
|
9
|
+
static VALUE prepared_statement_initialize(VALUE self, VALUE con, VALUE query);
|
|
10
|
+
static VALUE prepared_statement_nparams(VALUE self);
|
|
11
|
+
static VALUE prepared_statement_execute(VALUE self);
|
|
12
|
+
static VALUE prepared_statement_destroy(VALUE self);
|
|
13
13
|
static idx_t check_index(VALUE vidx);
|
|
14
14
|
|
|
15
|
-
static VALUE
|
|
16
|
-
static VALUE
|
|
17
|
-
static VALUE
|
|
18
|
-
static VALUE
|
|
19
|
-
static VALUE
|
|
20
|
-
static VALUE
|
|
21
|
-
static VALUE
|
|
22
|
-
static VALUE
|
|
23
|
-
static VALUE
|
|
24
|
-
static VALUE
|
|
25
|
-
static VALUE
|
|
26
|
-
static VALUE
|
|
27
|
-
static VALUE
|
|
28
|
-
static VALUE
|
|
29
|
-
static VALUE
|
|
30
|
-
static VALUE
|
|
31
|
-
static VALUE
|
|
32
|
-
static VALUE
|
|
33
|
-
static VALUE
|
|
34
|
-
static VALUE
|
|
35
|
-
static VALUE
|
|
36
|
-
static VALUE
|
|
37
|
-
static VALUE
|
|
38
|
-
static VALUE
|
|
39
|
-
static VALUE
|
|
40
|
-
static VALUE
|
|
41
|
-
static VALUE
|
|
15
|
+
static VALUE prepared_statement_bind_parameter_index(VALUE self, VALUE name);
|
|
16
|
+
static VALUE prepared_statement_parameter_name(VALUE self, VALUE vidx);
|
|
17
|
+
static VALUE prepared_statement_clear_bindings(VALUE self);
|
|
18
|
+
static VALUE prepared_statement_bind_bool(VALUE self, VALUE vidx, VALUE val);
|
|
19
|
+
static VALUE prepared_statement_bind_int8(VALUE self, VALUE vidx, VALUE val);
|
|
20
|
+
static VALUE prepared_statement_bind_int16(VALUE self, VALUE vidx, VALUE val);
|
|
21
|
+
static VALUE prepared_statement_bind_int32(VALUE self, VALUE vidx, VALUE val);
|
|
22
|
+
static VALUE prepared_statement_bind_int64(VALUE self, VALUE vidx, VALUE val);
|
|
23
|
+
static VALUE prepared_statement_bind_float(VALUE self, VALUE vidx, VALUE val);
|
|
24
|
+
static VALUE prepared_statement_bind_double(VALUE self, VALUE vidx, VALUE val);
|
|
25
|
+
static VALUE prepared_statement_bind_varchar(VALUE self, VALUE vidx, VALUE str);
|
|
26
|
+
static VALUE prepared_statement_bind_blob(VALUE self, VALUE vidx, VALUE blob);
|
|
27
|
+
static VALUE prepared_statement_bind_null(VALUE self, VALUE vidx);
|
|
28
|
+
static VALUE prepared_statement__statement_type(VALUE self);
|
|
29
|
+
static VALUE prepared_statement__param_type(VALUE self, VALUE vidx);
|
|
30
|
+
static VALUE prepared_statement__bind_uint8(VALUE self, VALUE vidx, VALUE val);
|
|
31
|
+
static VALUE prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALUE val);
|
|
32
|
+
static VALUE prepared_statement__bind_uint32(VALUE self, VALUE vidx, VALUE val);
|
|
33
|
+
static VALUE prepared_statement__bind_uint64(VALUE self, VALUE vidx, VALUE val);
|
|
34
|
+
static VALUE prepared_statement__bind_date(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day);
|
|
35
|
+
static VALUE prepared_statement__bind_time(VALUE self, VALUE vidx, VALUE hour, VALUE min, VALUE sec, VALUE micros);
|
|
36
|
+
static VALUE prepared_statement__bind_timestamp(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros);
|
|
37
|
+
static VALUE prepared_statement__bind_interval(VALUE self, VALUE vidx, VALUE months, VALUE days, VALUE micros);
|
|
38
|
+
static VALUE prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper);
|
|
39
|
+
static VALUE prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper);
|
|
40
|
+
static VALUE prepared_statement__bind_decimal(VALUE self, VALUE vidx, VALUE lower, VALUE upper, VALUE width, VALUE scale);
|
|
41
|
+
static VALUE prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE val);
|
|
42
42
|
|
|
43
43
|
static const rb_data_type_t prepared_statement_data_type = {
|
|
44
44
|
"DuckDB/PreparedStatement",
|
|
@@ -84,7 +84,7 @@ VALUE rbduckdb_prepared_statement_new(duckdb_connection con, duckdb_extracted_st
|
|
|
84
84
|
return obj;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
static VALUE
|
|
87
|
+
static VALUE prepared_statement_initialize(VALUE self, VALUE con, VALUE query) {
|
|
88
88
|
rubyDuckDBConnection *ctxcon;
|
|
89
89
|
rubyDuckDBPreparedStatement *ctx;
|
|
90
90
|
|
|
@@ -93,7 +93,7 @@ static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE q
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
96
|
-
ctxcon =
|
|
96
|
+
ctxcon = rbduckdb_get_struct_connection(con);
|
|
97
97
|
|
|
98
98
|
if (duckdb_prepare(ctxcon->con, StringValuePtr(query), &(ctx->prepared_statement)) == DuckDBError) {
|
|
99
99
|
const char *error = duckdb_prepare_error(ctx->prepared_statement);
|
|
@@ -102,7 +102,7 @@ static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE q
|
|
|
102
102
|
return self;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
static VALUE
|
|
105
|
+
static VALUE prepared_statement_nparams(VALUE self) {
|
|
106
106
|
rubyDuckDBPreparedStatement *ctx;
|
|
107
107
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
108
108
|
return ULL2NUM(duckdb_nparams(ctx->prepared_statement));
|
|
@@ -113,16 +113,16 @@ typedef struct {
|
|
|
113
113
|
duckdb_prepared_statement prepared_statement;
|
|
114
114
|
duckdb_result *out_result;
|
|
115
115
|
duckdb_state retval;
|
|
116
|
-
}
|
|
116
|
+
} prepared_statement_execute_nogvl_args;
|
|
117
117
|
|
|
118
118
|
/* :nodoc: */
|
|
119
|
-
static void
|
|
120
|
-
|
|
119
|
+
static void prepared_statement_execute_nogvl(void *ptr) {
|
|
120
|
+
prepared_statement_execute_nogvl_args *args = (prepared_statement_execute_nogvl_args *)ptr;
|
|
121
121
|
|
|
122
122
|
args->retval = duckdb_execute_prepared(args->prepared_statement, args->out_result);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
static VALUE
|
|
125
|
+
static VALUE prepared_statement_execute(VALUE self) {
|
|
126
126
|
rubyDuckDBPreparedStatement *ctx;
|
|
127
127
|
rubyDuckDBResult *ctxr;
|
|
128
128
|
const char *error;
|
|
@@ -130,15 +130,15 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
|
|
|
130
130
|
VALUE msg;
|
|
131
131
|
|
|
132
132
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
133
|
-
ctxr =
|
|
133
|
+
ctxr = rbduckdb_get_struct_result(result);
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
prepared_statement_execute_nogvl_args args = {
|
|
136
136
|
.prepared_statement = ctx->prepared_statement,
|
|
137
137
|
.out_result = &(ctxr->result),
|
|
138
138
|
.retval = DuckDBError,
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
rb_thread_call_without_gvl((void *)
|
|
141
|
+
rb_thread_call_without_gvl((void *)prepared_statement_execute_nogvl, &args, RUBY_UBF_IO, 0);
|
|
142
142
|
duckdb_state state = args.retval;
|
|
143
143
|
|
|
144
144
|
if (state == DuckDBError) {
|
|
@@ -157,7 +157,7 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
|
|
|
157
157
|
/*
|
|
158
158
|
* :nodoc:
|
|
159
159
|
*/
|
|
160
|
-
static VALUE
|
|
160
|
+
static VALUE prepared_statement_destroy(VALUE self) {
|
|
161
161
|
rubyDuckDBPreparedStatement *ctx;
|
|
162
162
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
163
163
|
destroy_prepared_statement(ctx);
|
|
@@ -175,7 +175,7 @@ static idx_t check_index(VALUE vidx) {
|
|
|
175
175
|
return idx;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
static VALUE
|
|
178
|
+
static VALUE prepared_statement_bind_parameter_index(VALUE self, VALUE name) {
|
|
179
179
|
rubyDuckDBPreparedStatement *ctx;
|
|
180
180
|
idx_t idx;
|
|
181
181
|
|
|
@@ -187,7 +187,7 @@ static VALUE duckdb_prepared_statement_bind_parameter_index(VALUE self, VALUE na
|
|
|
187
187
|
return ULL2NUM(idx);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
static VALUE
|
|
190
|
+
static VALUE prepared_statement_parameter_name(VALUE self, VALUE vidx) {
|
|
191
191
|
rubyDuckDBPreparedStatement *ctx;
|
|
192
192
|
VALUE vname;
|
|
193
193
|
const char *name;
|
|
@@ -210,7 +210,7 @@ static VALUE duckdb_prepared_statement_parameter_name(VALUE self, VALUE vidx) {
|
|
|
210
210
|
*
|
|
211
211
|
* clear all bindings of prepared statement.
|
|
212
212
|
*/
|
|
213
|
-
static VALUE
|
|
213
|
+
static VALUE prepared_statement_clear_bindings(VALUE self) {
|
|
214
214
|
rubyDuckDBPreparedStatement *ctx;
|
|
215
215
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
216
216
|
|
|
@@ -221,7 +221,7 @@ static VALUE duckdb_prepared_statement_clear_bindings(VALUE self) {
|
|
|
221
221
|
return self;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
static VALUE
|
|
224
|
+
static VALUE prepared_statement_bind_bool(VALUE self, VALUE vidx, VALUE val) {
|
|
225
225
|
rubyDuckDBPreparedStatement *ctx;
|
|
226
226
|
idx_t idx = check_index(vidx);
|
|
227
227
|
|
|
@@ -236,7 +236,7 @@ static VALUE duckdb_prepared_statement_bind_bool(VALUE self, VALUE vidx, VALUE v
|
|
|
236
236
|
return self;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
static VALUE
|
|
239
|
+
static VALUE prepared_statement_bind_int8(VALUE self, VALUE vidx, VALUE val) {
|
|
240
240
|
rubyDuckDBPreparedStatement *ctx;
|
|
241
241
|
idx_t idx = check_index(vidx);
|
|
242
242
|
int8_t i8val = (int8_t)NUM2INT(val);
|
|
@@ -250,7 +250,7 @@ static VALUE duckdb_prepared_statement_bind_int8(VALUE self, VALUE vidx, VALUE v
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
|
|
253
|
-
static VALUE
|
|
253
|
+
static VALUE prepared_statement_bind_int16(VALUE self, VALUE vidx, VALUE val) {
|
|
254
254
|
rubyDuckDBPreparedStatement *ctx;
|
|
255
255
|
idx_t idx = check_index(vidx);
|
|
256
256
|
int16_t i16val = NUM2INT(val);
|
|
@@ -263,7 +263,7 @@ static VALUE duckdb_prepared_statement_bind_int16(VALUE self, VALUE vidx, VALUE
|
|
|
263
263
|
return self;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
static VALUE
|
|
266
|
+
static VALUE prepared_statement_bind_int32(VALUE self, VALUE vidx, VALUE val) {
|
|
267
267
|
rubyDuckDBPreparedStatement *ctx;
|
|
268
268
|
idx_t idx = check_index(vidx);
|
|
269
269
|
int32_t i32val = NUM2INT(val);
|
|
@@ -276,7 +276,7 @@ static VALUE duckdb_prepared_statement_bind_int32(VALUE self, VALUE vidx, VALUE
|
|
|
276
276
|
return self;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
static VALUE
|
|
279
|
+
static VALUE prepared_statement_bind_int64(VALUE self, VALUE vidx, VALUE val) {
|
|
280
280
|
rubyDuckDBPreparedStatement *ctx;
|
|
281
281
|
idx_t idx = check_index(vidx);
|
|
282
282
|
int64_t i64val = NUM2LL(val);
|
|
@@ -289,7 +289,7 @@ static VALUE duckdb_prepared_statement_bind_int64(VALUE self, VALUE vidx, VALUE
|
|
|
289
289
|
return self;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
static VALUE
|
|
292
|
+
static VALUE prepared_statement_bind_float(VALUE self, VALUE vidx, VALUE val) {
|
|
293
293
|
rubyDuckDBPreparedStatement *ctx;
|
|
294
294
|
idx_t idx = check_index(vidx);
|
|
295
295
|
double dbl = NUM2DBL(val);
|
|
@@ -302,7 +302,7 @@ static VALUE duckdb_prepared_statement_bind_float(VALUE self, VALUE vidx, VALUE
|
|
|
302
302
|
return self;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
static VALUE
|
|
305
|
+
static VALUE prepared_statement_bind_double(VALUE self, VALUE vidx, VALUE val) {
|
|
306
306
|
rubyDuckDBPreparedStatement *ctx;
|
|
307
307
|
idx_t idx = check_index(vidx);
|
|
308
308
|
double dbl = NUM2DBL(val);
|
|
@@ -315,7 +315,7 @@ static VALUE duckdb_prepared_statement_bind_double(VALUE self, VALUE vidx, VALUE
|
|
|
315
315
|
return self;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
static VALUE
|
|
318
|
+
static VALUE prepared_statement_bind_varchar(VALUE self, VALUE vidx, VALUE str) {
|
|
319
319
|
rubyDuckDBPreparedStatement *ctx;
|
|
320
320
|
idx_t idx = check_index(vidx);
|
|
321
321
|
|
|
@@ -327,7 +327,7 @@ static VALUE duckdb_prepared_statement_bind_varchar(VALUE self, VALUE vidx, VALU
|
|
|
327
327
|
return self;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
static VALUE
|
|
330
|
+
static VALUE prepared_statement_bind_blob(VALUE self, VALUE vidx, VALUE blob) {
|
|
331
331
|
rubyDuckDBPreparedStatement *ctx;
|
|
332
332
|
idx_t idx = check_index(vidx);
|
|
333
333
|
|
|
@@ -339,7 +339,7 @@ static VALUE duckdb_prepared_statement_bind_blob(VALUE self, VALUE vidx, VALUE b
|
|
|
339
339
|
return self;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
static VALUE
|
|
342
|
+
static VALUE prepared_statement_bind_null(VALUE self, VALUE vidx) {
|
|
343
343
|
rubyDuckDBPreparedStatement *ctx;
|
|
344
344
|
idx_t idx = check_index(vidx);
|
|
345
345
|
|
|
@@ -352,21 +352,21 @@ static VALUE duckdb_prepared_statement_bind_null(VALUE self, VALUE vidx) {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
/* :nodoc: */
|
|
355
|
-
static VALUE
|
|
355
|
+
static VALUE prepared_statement__statement_type(VALUE self) {
|
|
356
356
|
rubyDuckDBPreparedStatement *ctx;
|
|
357
357
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
358
358
|
return INT2FIX(duckdb_prepared_statement_type(ctx->prepared_statement));
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
/* :nodoc: */
|
|
362
|
-
static VALUE
|
|
362
|
+
static VALUE prepared_statement__param_type(VALUE self, VALUE vidx) {
|
|
363
363
|
rubyDuckDBPreparedStatement *ctx;
|
|
364
364
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
365
365
|
return INT2FIX(duckdb_param_type(ctx->prepared_statement, NUM2ULL(vidx)));
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/* :nodoc: */
|
|
369
|
-
static VALUE
|
|
369
|
+
static VALUE prepared_statement__bind_uint8(VALUE self, VALUE vidx, VALUE val) {
|
|
370
370
|
rubyDuckDBPreparedStatement *ctx;
|
|
371
371
|
idx_t idx = check_index(vidx);
|
|
372
372
|
uint8_t ui8val = (uint8_t)NUM2UINT(val);
|
|
@@ -380,7 +380,7 @@ static VALUE duckdb_prepared_statement__bind_uint8(VALUE self, VALUE vidx, VALUE
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
/* :nodoc: */
|
|
383
|
-
static VALUE
|
|
383
|
+
static VALUE prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALUE val) {
|
|
384
384
|
rubyDuckDBPreparedStatement *ctx;
|
|
385
385
|
idx_t idx = check_index(vidx);
|
|
386
386
|
uint16_t ui16val = (uint16_t)NUM2UINT(val);
|
|
@@ -394,7 +394,7 @@ static VALUE duckdb_prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALU
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
/* :nodoc: */
|
|
397
|
-
static VALUE
|
|
397
|
+
static VALUE prepared_statement__bind_uint32(VALUE self, VALUE vidx, VALUE val) {
|
|
398
398
|
rubyDuckDBPreparedStatement *ctx;
|
|
399
399
|
idx_t idx = check_index(vidx);
|
|
400
400
|
uint32_t ui32val = (uint32_t)NUM2UINT(val);
|
|
@@ -408,7 +408,7 @@ static VALUE duckdb_prepared_statement__bind_uint32(VALUE self, VALUE vidx, VALU
|
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
/* :nodoc: */
|
|
411
|
-
static VALUE
|
|
411
|
+
static VALUE prepared_statement__bind_uint64(VALUE self, VALUE vidx, VALUE val) {
|
|
412
412
|
rubyDuckDBPreparedStatement *ctx;
|
|
413
413
|
idx_t idx = check_index(vidx);
|
|
414
414
|
uint64_t ui64val = (uint64_t)NUM2ULL(val);
|
|
@@ -422,7 +422,7 @@ static VALUE duckdb_prepared_statement__bind_uint64(VALUE self, VALUE vidx, VALU
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
/* :nodoc: */
|
|
425
|
-
static VALUE
|
|
425
|
+
static VALUE prepared_statement__bind_date(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day) {
|
|
426
426
|
rubyDuckDBPreparedStatement *ctx;
|
|
427
427
|
duckdb_date dt;
|
|
428
428
|
idx_t idx = check_index(vidx);
|
|
@@ -439,7 +439,7 @@ static VALUE duckdb_prepared_statement__bind_date(VALUE self, VALUE vidx, VALUE
|
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
/* :nodoc: */
|
|
442
|
-
static VALUE
|
|
442
|
+
static VALUE prepared_statement__bind_time(VALUE self, VALUE vidx, VALUE hour, VALUE min, VALUE sec, VALUE micros){
|
|
443
443
|
rubyDuckDBPreparedStatement *ctx;
|
|
444
444
|
duckdb_time time;
|
|
445
445
|
|
|
@@ -457,7 +457,7 @@ static VALUE duckdb_prepared_statement__bind_time(VALUE self, VALUE vidx, VALUE
|
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
/* :nodoc: */
|
|
460
|
-
static VALUE
|
|
460
|
+
static VALUE prepared_statement__bind_timestamp(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros) {
|
|
461
461
|
duckdb_timestamp timestamp;
|
|
462
462
|
rubyDuckDBPreparedStatement *ctx;
|
|
463
463
|
idx_t idx = check_index(vidx);
|
|
@@ -472,7 +472,7 @@ static VALUE duckdb_prepared_statement__bind_timestamp(VALUE self, VALUE vidx, V
|
|
|
472
472
|
}
|
|
473
473
|
|
|
474
474
|
/* :nodoc: */
|
|
475
|
-
static VALUE
|
|
475
|
+
static VALUE prepared_statement__bind_interval(VALUE self, VALUE vidx, VALUE months, VALUE days, VALUE micros) {
|
|
476
476
|
duckdb_interval interval;
|
|
477
477
|
rubyDuckDBPreparedStatement *ctx;
|
|
478
478
|
idx_t idx = check_index(vidx);
|
|
@@ -488,7 +488,7 @@ static VALUE duckdb_prepared_statement__bind_interval(VALUE self, VALUE vidx, VA
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
/* :nodoc: */
|
|
491
|
-
static VALUE
|
|
491
|
+
static VALUE prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper) {
|
|
492
492
|
duckdb_hugeint hugeint;
|
|
493
493
|
rubyDuckDBPreparedStatement *ctx;
|
|
494
494
|
idx_t idx = check_index(vidx);
|
|
@@ -505,7 +505,7 @@ static VALUE duckdb_prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VAL
|
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
/* :nodoc: */
|
|
508
|
-
static VALUE
|
|
508
|
+
static VALUE prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper) {
|
|
509
509
|
duckdb_uhugeint uhugeint;
|
|
510
510
|
rubyDuckDBPreparedStatement *ctx;
|
|
511
511
|
idx_t idx = check_index(vidx);
|
|
@@ -522,7 +522,7 @@ static VALUE duckdb_prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VA
|
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
/* :nodoc: */
|
|
525
|
-
static VALUE
|
|
525
|
+
static VALUE prepared_statement__bind_decimal(VALUE self, VALUE vidx, VALUE lower, VALUE upper, VALUE width, VALUE scale) {
|
|
526
526
|
duckdb_hugeint hugeint;
|
|
527
527
|
duckdb_decimal decimal;
|
|
528
528
|
rubyDuckDBPreparedStatement *ctx;
|
|
@@ -543,13 +543,13 @@ static VALUE duckdb_prepared_statement__bind_decimal(VALUE self, VALUE vidx, VAL
|
|
|
543
543
|
}
|
|
544
544
|
|
|
545
545
|
/* :nodoc: */
|
|
546
|
-
static VALUE
|
|
546
|
+
static VALUE prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE val) {
|
|
547
547
|
rubyDuckDBPreparedStatement *ctx;
|
|
548
548
|
rubyDuckDBValue *val_ctx;
|
|
549
549
|
idx_t idx = check_index(vidx);
|
|
550
550
|
|
|
551
551
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
552
|
-
val_ctx =
|
|
552
|
+
val_ctx = rbduckdb_get_struct_value(val);
|
|
553
553
|
|
|
554
554
|
if (duckdb_bind_value(ctx->prepared_statement, idx, val_ctx->value) == DuckDBError) {
|
|
555
555
|
rb_raise(eDuckDBError, "fail to bind %llu parameter", (unsigned long long)idx);
|
|
@@ -557,13 +557,13 @@ static VALUE duckdb_prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE
|
|
|
557
557
|
return self;
|
|
558
558
|
}
|
|
559
559
|
|
|
560
|
-
rubyDuckDBPreparedStatement *
|
|
560
|
+
rubyDuckDBPreparedStatement *rbduckdb_get_struct_prepared_statement(VALUE self) {
|
|
561
561
|
rubyDuckDBPreparedStatement *ctx;
|
|
562
562
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
563
563
|
return ctx;
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
-
void
|
|
566
|
+
void rbduckdb_init_prepared_statement(void) {
|
|
567
567
|
#if 0
|
|
568
568
|
VALUE mDuckDB = rb_define_module("DuckDB");
|
|
569
569
|
#endif
|
|
@@ -571,35 +571,35 @@ void rbduckdb_init_duckdb_prepared_statement(void) {
|
|
|
571
571
|
|
|
572
572
|
rb_define_alloc_func(cDuckDBPreparedStatement, allocate);
|
|
573
573
|
|
|
574
|
-
rb_define_method(cDuckDBPreparedStatement, "initialize",
|
|
575
|
-
rb_define_method(cDuckDBPreparedStatement, "execute",
|
|
576
|
-
rb_define_method(cDuckDBPreparedStatement, "destroy",
|
|
577
|
-
rb_define_method(cDuckDBPreparedStatement, "nparams",
|
|
578
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_parameter_index",
|
|
579
|
-
rb_define_method(cDuckDBPreparedStatement, "parameter_name",
|
|
580
|
-
rb_define_method(cDuckDBPreparedStatement, "clear_bindings",
|
|
581
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_bool",
|
|
582
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_int8",
|
|
583
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_int16",
|
|
584
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_int32",
|
|
585
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_int64",
|
|
586
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_float",
|
|
587
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_double",
|
|
588
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_varchar",
|
|
589
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_blob",
|
|
590
|
-
rb_define_method(cDuckDBPreparedStatement, "bind_null",
|
|
591
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint8",
|
|
592
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint16",
|
|
593
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint32",
|
|
594
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint64",
|
|
595
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_statement_type",
|
|
596
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_param_type",
|
|
597
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_date",
|
|
598
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_time",
|
|
599
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_timestamp",
|
|
600
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_interval",
|
|
601
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_hugeint",
|
|
602
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uhugeint",
|
|
603
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_decimal",
|
|
604
|
-
rb_define_private_method(cDuckDBPreparedStatement, "_bind_value",
|
|
574
|
+
rb_define_method(cDuckDBPreparedStatement, "initialize", prepared_statement_initialize, 2);
|
|
575
|
+
rb_define_method(cDuckDBPreparedStatement, "execute", prepared_statement_execute, 0);
|
|
576
|
+
rb_define_method(cDuckDBPreparedStatement, "destroy", prepared_statement_destroy, 0);
|
|
577
|
+
rb_define_method(cDuckDBPreparedStatement, "nparams", prepared_statement_nparams, 0);
|
|
578
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_parameter_index", prepared_statement_bind_parameter_index, 1);
|
|
579
|
+
rb_define_method(cDuckDBPreparedStatement, "parameter_name", prepared_statement_parameter_name, 1);
|
|
580
|
+
rb_define_method(cDuckDBPreparedStatement, "clear_bindings", prepared_statement_clear_bindings, 0);
|
|
581
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_bool", prepared_statement_bind_bool, 2);
|
|
582
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int8", prepared_statement_bind_int8, 2);
|
|
583
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int16", prepared_statement_bind_int16, 2);
|
|
584
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int32", prepared_statement_bind_int32, 2);
|
|
585
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int64", prepared_statement_bind_int64, 2);
|
|
586
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_float", prepared_statement_bind_float, 2);
|
|
587
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_double", prepared_statement_bind_double, 2);
|
|
588
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_varchar", prepared_statement_bind_varchar, 2);
|
|
589
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_blob", prepared_statement_bind_blob, 2);
|
|
590
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_null", prepared_statement_bind_null, 1);
|
|
591
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint8", prepared_statement__bind_uint8, 2);
|
|
592
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint16", prepared_statement__bind_uint16, 2);
|
|
593
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint32", prepared_statement__bind_uint32, 2);
|
|
594
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint64", prepared_statement__bind_uint64, 2);
|
|
595
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_statement_type", prepared_statement__statement_type, 0);
|
|
596
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_param_type", prepared_statement__param_type, 1);
|
|
597
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_date", prepared_statement__bind_date, 4);
|
|
598
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_time", prepared_statement__bind_time, 5);
|
|
599
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_timestamp", prepared_statement__bind_timestamp, 8);
|
|
600
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_interval", prepared_statement__bind_interval, 4);
|
|
601
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_hugeint", prepared_statement__bind_hugeint, 3);
|
|
602
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uhugeint", prepared_statement__bind_uhugeint, 3);
|
|
603
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_decimal", prepared_statement__bind_decimal, 5);
|
|
604
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_value", prepared_statement__bind_value, 2);
|
|
605
605
|
}
|
|
@@ -9,7 +9,7 @@ struct _rubyDuckDBPreparedStatement {
|
|
|
9
9
|
typedef struct _rubyDuckDBPreparedStatement rubyDuckDBPreparedStatement;
|
|
10
10
|
|
|
11
11
|
VALUE rbduckdb_prepared_statement_new(duckdb_connection con, duckdb_extracted_statements extracted_statements, idx_t index);
|
|
12
|
-
rubyDuckDBPreparedStatement *
|
|
13
|
-
void
|
|
12
|
+
rubyDuckDBPreparedStatement *rbduckdb_get_struct_prepared_statement(VALUE self);
|
|
13
|
+
void rbduckdb_init_prepared_statement(void);
|
|
14
14
|
|
|
15
15
|
#endif
|
data/ext/duckdb/result.c
CHANGED
|
@@ -10,19 +10,19 @@ static VALUE cDuckDBResult;
|
|
|
10
10
|
static void deallocate(void *ctx);
|
|
11
11
|
static VALUE allocate(VALUE klass);
|
|
12
12
|
static size_t memsize(const void *p);
|
|
13
|
-
static VALUE
|
|
14
|
-
static VALUE
|
|
15
|
-
static VALUE
|
|
13
|
+
static VALUE result_column_count(VALUE oDuckDBResult);
|
|
14
|
+
static VALUE result_rows_changed(VALUE oDuckDBResult);
|
|
15
|
+
static VALUE result_columns(VALUE oDuckDBResult);
|
|
16
16
|
static VALUE destroy_data_chunk(VALUE arg);
|
|
17
17
|
|
|
18
|
-
static VALUE
|
|
18
|
+
static VALUE result__chunk_stream(VALUE oDuckDBResult);
|
|
19
19
|
static VALUE yield_rows(VALUE arg);
|
|
20
|
-
static VALUE
|
|
21
|
-
static VALUE
|
|
22
|
-
static VALUE
|
|
23
|
-
static VALUE
|
|
24
|
-
static VALUE
|
|
25
|
-
static VALUE
|
|
20
|
+
static VALUE result__column_type(VALUE oDuckDBResult, VALUE col_idx);
|
|
21
|
+
static VALUE result__return_type(VALUE oDuckDBResult);
|
|
22
|
+
static VALUE result__statement_type(VALUE oDuckDBResult);
|
|
23
|
+
static VALUE result__enum_internal_type(VALUE oDuckDBResult, VALUE col_idx);
|
|
24
|
+
static VALUE result__enum_dictionary_size(VALUE oDuckDBResult, VALUE col_idx);
|
|
25
|
+
static VALUE result__enum_dictionary_value(VALUE oDuckDBResult, VALUE col_idx, VALUE idx);
|
|
26
26
|
|
|
27
27
|
static VALUE vector_date(void *vector_data, idx_t row_idx);
|
|
28
28
|
static VALUE vector_timestamp(void* vector_data, idx_t row_idx);
|
|
@@ -72,7 +72,7 @@ static size_t memsize(const void *p) {
|
|
|
72
72
|
return sizeof(rubyDuckDBResult);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
rubyDuckDBResult *
|
|
75
|
+
rubyDuckDBResult *rbduckdb_get_struct_result(VALUE obj) {
|
|
76
76
|
rubyDuckDBResult *ctx;
|
|
77
77
|
TypedData_Get_Struct(obj, rubyDuckDBResult, &result_data_type, ctx);
|
|
78
78
|
return ctx;
|
|
@@ -100,7 +100,7 @@ rubyDuckDBResult *get_struct_result(VALUE obj) {
|
|
|
100
100
|
* end
|
|
101
101
|
*
|
|
102
102
|
*/
|
|
103
|
-
static VALUE
|
|
103
|
+
static VALUE result_rows_changed(VALUE oDuckDBResult) {
|
|
104
104
|
rubyDuckDBResult *ctx;
|
|
105
105
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
106
106
|
return LL2NUM(duckdb_rows_changed(&(ctx->result)));
|
|
@@ -124,7 +124,7 @@ static VALUE duckdb_result_rows_changed(VALUE oDuckDBResult) {
|
|
|
124
124
|
* end
|
|
125
125
|
*
|
|
126
126
|
*/
|
|
127
|
-
static VALUE
|
|
127
|
+
static VALUE result_column_count(VALUE oDuckDBResult) {
|
|
128
128
|
rubyDuckDBResult *ctx;
|
|
129
129
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
130
130
|
return LL2NUM(duckdb_column_count(&(ctx->result)));
|
|
@@ -137,7 +137,7 @@ static VALUE duckdb_result_column_count(VALUE oDuckDBResult) {
|
|
|
137
137
|
* Returns the column class Lists.
|
|
138
138
|
*
|
|
139
139
|
*/
|
|
140
|
-
static VALUE
|
|
140
|
+
static VALUE result_columns(VALUE oDuckDBResult) {
|
|
141
141
|
rubyDuckDBResult *ctx;
|
|
142
142
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
143
143
|
|
|
@@ -159,7 +159,7 @@ static VALUE destroy_data_chunk(VALUE arg) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/* :nodoc: */
|
|
162
|
-
static VALUE
|
|
162
|
+
static VALUE result__chunk_stream(VALUE oDuckDBResult) {
|
|
163
163
|
rubyDuckDBResult *ctx;
|
|
164
164
|
struct chunk_arg arg;
|
|
165
165
|
|
|
@@ -199,28 +199,28 @@ static VALUE yield_rows(VALUE arg) {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
/* :nodoc: */
|
|
202
|
-
static VALUE
|
|
202
|
+
static VALUE result__column_type(VALUE oDuckDBResult, VALUE col_idx) {
|
|
203
203
|
rubyDuckDBResult *ctx;
|
|
204
204
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
205
205
|
return LL2NUM(duckdb_column_type(&(ctx->result), NUM2LL(col_idx)));
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
/* :nodoc: */
|
|
209
|
-
static VALUE
|
|
209
|
+
static VALUE result__return_type(VALUE oDuckDBResult) {
|
|
210
210
|
rubyDuckDBResult *ctx;
|
|
211
211
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
212
212
|
return INT2FIX(duckdb_result_return_type(ctx->result));
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/* :nodoc: */
|
|
216
|
-
static VALUE
|
|
216
|
+
static VALUE result__statement_type(VALUE oDuckDBResult) {
|
|
217
217
|
rubyDuckDBResult *ctx;
|
|
218
218
|
TypedData_Get_Struct(oDuckDBResult, rubyDuckDBResult, &result_data_type, ctx);
|
|
219
219
|
return INT2FIX(duckdb_result_statement_type(ctx->result));
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/* :nodoc: */
|
|
223
|
-
static VALUE
|
|
223
|
+
static VALUE result__enum_internal_type(VALUE oDuckDBResult, VALUE col_idx) {
|
|
224
224
|
rubyDuckDBResult *ctx;
|
|
225
225
|
VALUE type = Qnil;
|
|
226
226
|
duckdb_logical_type logical_type;
|
|
@@ -235,7 +235,7 @@ static VALUE duckdb_result__enum_internal_type(VALUE oDuckDBResult, VALUE col_id
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
/* :nodoc: */
|
|
238
|
-
static VALUE
|
|
238
|
+
static VALUE result__enum_dictionary_size(VALUE oDuckDBResult, VALUE col_idx) {
|
|
239
239
|
rubyDuckDBResult *ctx;
|
|
240
240
|
VALUE size = Qnil;
|
|
241
241
|
duckdb_logical_type logical_type;
|
|
@@ -250,7 +250,7 @@ static VALUE duckdb_result__enum_dictionary_size(VALUE oDuckDBResult, VALUE col_
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
/* :nodoc: */
|
|
253
|
-
static VALUE
|
|
253
|
+
static VALUE result__enum_dictionary_value(VALUE oDuckDBResult, VALUE col_idx, VALUE idx) {
|
|
254
254
|
rubyDuckDBResult *ctx;
|
|
255
255
|
VALUE value = Qnil;
|
|
256
256
|
duckdb_logical_type logical_type;
|
|
@@ -706,7 +706,7 @@ static VALUE vector_value(duckdb_vector vector, idx_t row_idx) {
|
|
|
706
706
|
return obj;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
-
void
|
|
709
|
+
void rbduckdb_init_result(void) {
|
|
710
710
|
#if 0
|
|
711
711
|
VALUE mDuckDB = rb_define_module("DuckDB");
|
|
712
712
|
#endif
|
|
@@ -714,15 +714,15 @@ void rbduckdb_init_duckdb_result(void) {
|
|
|
714
714
|
|
|
715
715
|
rb_define_alloc_func(cDuckDBResult, allocate);
|
|
716
716
|
|
|
717
|
-
rb_define_method(cDuckDBResult, "column_count",
|
|
718
|
-
rb_define_method(cDuckDBResult, "rows_changed",
|
|
719
|
-
rb_define_method(cDuckDBResult, "columns",
|
|
720
|
-
rb_define_private_method(cDuckDBResult, "_chunk_stream",
|
|
721
|
-
rb_define_private_method(cDuckDBResult, "_column_type",
|
|
722
|
-
rb_define_private_method(cDuckDBResult, "_return_type",
|
|
723
|
-
rb_define_private_method(cDuckDBResult, "_statement_type",
|
|
724
|
-
|
|
725
|
-
rb_define_private_method(cDuckDBResult, "_enum_internal_type",
|
|
726
|
-
rb_define_private_method(cDuckDBResult, "_enum_dictionary_size",
|
|
727
|
-
rb_define_private_method(cDuckDBResult, "_enum_dictionary_value",
|
|
717
|
+
rb_define_method(cDuckDBResult, "column_count", result_column_count, 0);
|
|
718
|
+
rb_define_method(cDuckDBResult, "rows_changed", result_rows_changed, 0);
|
|
719
|
+
rb_define_method(cDuckDBResult, "columns", result_columns, 0);
|
|
720
|
+
rb_define_private_method(cDuckDBResult, "_chunk_stream", result__chunk_stream, 0);
|
|
721
|
+
rb_define_private_method(cDuckDBResult, "_column_type", result__column_type, 1);
|
|
722
|
+
rb_define_private_method(cDuckDBResult, "_return_type", result__return_type, 0);
|
|
723
|
+
rb_define_private_method(cDuckDBResult, "_statement_type", result__statement_type, 0);
|
|
724
|
+
|
|
725
|
+
rb_define_private_method(cDuckDBResult, "_enum_internal_type", result__enum_internal_type, 1);
|
|
726
|
+
rb_define_private_method(cDuckDBResult, "_enum_dictionary_size", result__enum_dictionary_size, 1);
|
|
727
|
+
rb_define_private_method(cDuckDBResult, "_enum_dictionary_value", result__enum_dictionary_value, 2);
|
|
728
728
|
}
|
data/ext/duckdb/result.h
CHANGED
|
@@ -7,10 +7,9 @@ struct _rubyDuckDBResult {
|
|
|
7
7
|
|
|
8
8
|
typedef struct _rubyDuckDBResult rubyDuckDBResult;
|
|
9
9
|
|
|
10
|
-
rubyDuckDBResult *
|
|
11
|
-
void
|
|
10
|
+
rubyDuckDBResult *rbduckdb_get_struct_result(VALUE obj);
|
|
11
|
+
void rbduckdb_init_result(void);
|
|
12
12
|
VALUE rbduckdb_create_result(void);
|
|
13
13
|
VALUE rbduckdb_vector_value_at(duckdb_vector vector, duckdb_logical_type element_type, idx_t index);
|
|
14
14
|
|
|
15
15
|
#endif
|
|
16
|
-
|