duckdb 1.5.2.0 → 1.5.3.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 +38 -0
- data/duckdb.gemspec +37 -0
- data/ext/duckdb/aggregate_function.c +62 -100
- data/ext/duckdb/aggregate_function.h +2 -2
- data/ext/duckdb/aggregate_function_set.c +86 -0
- data/ext/duckdb/aggregate_function_set.h +14 -0
- data/ext/duckdb/appender.c +121 -39
- 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 +63 -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 +18 -17
- data/ext/duckdb/expression.c +8 -8
- data/ext/duckdb/expression.h +1 -1
- data/ext/duckdb/extconf.rb +32 -16
- 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 +120 -103
- data/ext/duckdb/prepared_statement.h +2 -2
- data/ext/duckdb/result.c +24 -74
- data/ext/duckdb/result.h +2 -3
- data/ext/duckdb/ruby-duckdb.h +5 -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 +208 -3
- data/lib/duckdb/aggregate_function_set.rb +29 -0
- data/lib/duckdb/appender.rb +148 -0
- data/lib/duckdb/connection.rb +86 -25
- data/lib/duckdb/converter.rb +5 -0
- data/lib/duckdb/logical_type.rb +1 -3
- data/lib/duckdb/prepared_statement.rb +19 -1
- data/lib/duckdb/result.rb +39 -2
- data/lib/duckdb/scalar_function.rb +9 -4
- data/lib/duckdb/scalar_function_set.rb +0 -1
- data/lib/duckdb/table_description.rb +7 -0
- data/lib/duckdb/table_function.rb +0 -1
- data/lib/duckdb/table_name_parser.rb +58 -0
- data/lib/duckdb/value.rb +19 -0
- data/lib/duckdb/version.rb +1 -1
- data/lib/duckdb.rb +2 -0
- metadata +7 -3
- data/lib/duckdb/duckdb_native.so +0 -0
data/ext/duckdb/pending_result.c
CHANGED
|
@@ -5,12 +5,12 @@ static VALUE cDuckDBPendingResult;
|
|
|
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
|
|
9
|
-
static VALUE
|
|
10
|
-
static VALUE
|
|
11
|
-
static VALUE
|
|
12
|
-
static VALUE
|
|
13
|
-
static VALUE
|
|
8
|
+
static VALUE pending_result_initialize(int argc, VALUE *args, VALUE self);
|
|
9
|
+
static VALUE pending_result_execute_task(VALUE self);
|
|
10
|
+
static VALUE pending_result_execute_pending(VALUE self);
|
|
11
|
+
static VALUE pending_result_execution_finished_p(VALUE self);
|
|
12
|
+
static VALUE pending_result__state(VALUE self);
|
|
13
|
+
static VALUE pending_result__execute_check_state(VALUE self);
|
|
14
14
|
|
|
15
15
|
static const rb_data_type_t pending_result_data_type = {
|
|
16
16
|
"DuckDB/PendingResult",
|
|
@@ -35,7 +35,7 @@ static size_t memsize(const void *p) {
|
|
|
35
35
|
return sizeof(rubyDuckDBPendingResult);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
static VALUE
|
|
38
|
+
static VALUE pending_result_initialize(int argc, VALUE *argv, VALUE self) {
|
|
39
39
|
VALUE oDuckDBPreparedStatement;
|
|
40
40
|
VALUE streaming_p = Qfalse;
|
|
41
41
|
duckdb_state state;
|
|
@@ -49,8 +49,8 @@ static VALUE duckdb_pending_result_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
49
49
|
rb_raise(rb_eTypeError, "1st argument must be DuckDB::PreparedStatement");
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
rubyDuckDBPendingResult *ctx =
|
|
53
|
-
rubyDuckDBPreparedStatement *stmt =
|
|
52
|
+
rubyDuckDBPendingResult *ctx = rbduckdb_get_struct_pending_result(self);
|
|
53
|
+
rubyDuckDBPreparedStatement *stmt = rbduckdb_get_struct_prepared_statement(oDuckDBPreparedStatement);
|
|
54
54
|
|
|
55
55
|
state = duckdb_pending_prepared(stmt->prepared_statement, &(ctx->pending_result));
|
|
56
56
|
|
|
@@ -71,14 +71,14 @@ static VALUE duckdb_pending_result_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
71
71
|
* pending_result = conn.async_query("slow query")
|
|
72
72
|
* pending_result.execute_task
|
|
73
73
|
*/
|
|
74
|
-
static VALUE
|
|
75
|
-
rubyDuckDBPendingResult *ctx =
|
|
74
|
+
static VALUE pending_result_execute_task(VALUE self) {
|
|
75
|
+
rubyDuckDBPendingResult *ctx = rbduckdb_get_struct_pending_result(self);
|
|
76
76
|
ctx->state = duckdb_pending_execute_task(ctx->pending_result);
|
|
77
77
|
return Qnil;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
static VALUE
|
|
81
|
-
rubyDuckDBPendingResult *ctx =
|
|
80
|
+
static VALUE pending_result_execution_finished_p(VALUE self) {
|
|
81
|
+
rubyDuckDBPendingResult *ctx = rbduckdb_get_struct_pending_result(self);
|
|
82
82
|
return duckdb_pending_execution_is_finished(ctx->state) ? Qtrue : Qfalse;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -94,13 +94,13 @@ static VALUE duckdb_pending_result_execution_finished_p(VALUE self) {
|
|
|
94
94
|
* pending_result.execute_task while pending_result.state != :ready
|
|
95
95
|
* result = pending_result.execute_pending # => DuckDB::Result
|
|
96
96
|
*/
|
|
97
|
-
static VALUE
|
|
97
|
+
static VALUE pending_result_execute_pending(VALUE self) {
|
|
98
98
|
rubyDuckDBPendingResult *ctx;
|
|
99
99
|
rubyDuckDBResult *ctxr;
|
|
100
100
|
VALUE result = rbduckdb_create_result();
|
|
101
101
|
|
|
102
102
|
TypedData_Get_Struct(self, rubyDuckDBPendingResult, &pending_result_data_type, ctx);
|
|
103
|
-
ctxr =
|
|
103
|
+
ctxr = rbduckdb_get_struct_result(result);
|
|
104
104
|
if (duckdb_execute_pending(ctx->pending_result, &(ctxr->result)) == DuckDBError) {
|
|
105
105
|
rb_raise(eDuckDBError, "%s", duckdb_pending_error(ctx->pending_result));
|
|
106
106
|
}
|
|
@@ -108,34 +108,34 @@ static VALUE duckdb_pending_result_execute_pending(VALUE self) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/* :nodoc: */
|
|
111
|
-
static VALUE
|
|
112
|
-
rubyDuckDBPendingResult *ctx =
|
|
111
|
+
static VALUE pending_result__state(VALUE self) {
|
|
112
|
+
rubyDuckDBPendingResult *ctx = rbduckdb_get_struct_pending_result(self);
|
|
113
113
|
return INT2FIX(ctx->state);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/* :nodoc: */
|
|
117
|
-
static VALUE
|
|
118
|
-
rubyDuckDBPendingResult *ctx =
|
|
117
|
+
static VALUE pending_result__execute_check_state(VALUE self) {
|
|
118
|
+
rubyDuckDBPendingResult *ctx = rbduckdb_get_struct_pending_result(self);
|
|
119
119
|
return INT2FIX(duckdb_pending_execute_check_state(ctx->pending_result));
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
rubyDuckDBPendingResult *
|
|
122
|
+
rubyDuckDBPendingResult *rbduckdb_get_struct_pending_result(VALUE obj) {
|
|
123
123
|
rubyDuckDBPendingResult *ctx;
|
|
124
124
|
TypedData_Get_Struct(obj, rubyDuckDBPendingResult, &pending_result_data_type, ctx);
|
|
125
125
|
return ctx;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
void
|
|
128
|
+
void rbduckdb_init_pending_result(void) {
|
|
129
129
|
#if 0
|
|
130
130
|
VALUE mDuckDB = rb_define_module("DuckDB");
|
|
131
131
|
#endif
|
|
132
132
|
cDuckDBPendingResult = rb_define_class_under(mDuckDB, "PendingResult", rb_cObject);
|
|
133
133
|
rb_define_alloc_func(cDuckDBPendingResult, allocate);
|
|
134
134
|
|
|
135
|
-
rb_define_method(cDuckDBPendingResult, "initialize",
|
|
136
|
-
rb_define_method(cDuckDBPendingResult, "execute_task",
|
|
137
|
-
rb_define_method(cDuckDBPendingResult, "execute_pending",
|
|
138
|
-
rb_define_method(cDuckDBPendingResult, "execution_finished?",
|
|
139
|
-
rb_define_private_method(cDuckDBPendingResult, "_state",
|
|
140
|
-
rb_define_private_method(cDuckDBPendingResult, "_execute_check_state",
|
|
135
|
+
rb_define_method(cDuckDBPendingResult, "initialize", pending_result_initialize, -1);
|
|
136
|
+
rb_define_method(cDuckDBPendingResult, "execute_task", pending_result_execute_task, 0);
|
|
137
|
+
rb_define_method(cDuckDBPendingResult, "execute_pending", pending_result_execute_pending, 0);
|
|
138
|
+
rb_define_method(cDuckDBPendingResult, "execution_finished?", pending_result_execution_finished_p, 0);
|
|
139
|
+
rb_define_private_method(cDuckDBPendingResult, "_state", pending_result__state, 0);
|
|
140
|
+
rb_define_private_method(cDuckDBPendingResult, "_execute_check_state", pending_result__execute_check_state, 0);
|
|
141
141
|
}
|
data/ext/duckdb/pending_result.h
CHANGED
|
@@ -8,6 +8,6 @@ struct _rubyDuckDBPendingResult {
|
|
|
8
8
|
|
|
9
9
|
typedef struct _rubyDuckDBPendingResult rubyDuckDBPendingResult;
|
|
10
10
|
|
|
11
|
-
rubyDuckDBPendingResult *
|
|
12
|
-
void
|
|
11
|
+
rubyDuckDBPendingResult *rbduckdb_get_struct_pending_result(VALUE obj);
|
|
12
|
+
void rbduckdb_init_pending_result(void);
|
|
13
13
|
#endif
|
|
@@ -6,39 +6,40 @@ 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_timestamp_tz(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros);
|
|
38
|
+
static VALUE prepared_statement__bind_interval(VALUE self, VALUE vidx, VALUE months, VALUE days, VALUE micros);
|
|
39
|
+
static VALUE prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper);
|
|
40
|
+
static VALUE prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper);
|
|
41
|
+
static VALUE prepared_statement__bind_decimal(VALUE self, VALUE vidx, VALUE lower, VALUE upper, VALUE width, VALUE scale);
|
|
42
|
+
static VALUE prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE val);
|
|
42
43
|
|
|
43
44
|
static const rb_data_type_t prepared_statement_data_type = {
|
|
44
45
|
"DuckDB/PreparedStatement",
|
|
@@ -84,7 +85,7 @@ VALUE rbduckdb_prepared_statement_new(duckdb_connection con, duckdb_extracted_st
|
|
|
84
85
|
return obj;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
static VALUE
|
|
88
|
+
static VALUE prepared_statement_initialize(VALUE self, VALUE con, VALUE query) {
|
|
88
89
|
rubyDuckDBConnection *ctxcon;
|
|
89
90
|
rubyDuckDBPreparedStatement *ctx;
|
|
90
91
|
|
|
@@ -93,7 +94,7 @@ static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE q
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
96
|
-
ctxcon =
|
|
97
|
+
ctxcon = rbduckdb_get_struct_connection(con);
|
|
97
98
|
|
|
98
99
|
if (duckdb_prepare(ctxcon->con, StringValuePtr(query), &(ctx->prepared_statement)) == DuckDBError) {
|
|
99
100
|
const char *error = duckdb_prepare_error(ctx->prepared_statement);
|
|
@@ -102,7 +103,7 @@ static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE q
|
|
|
102
103
|
return self;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
static VALUE
|
|
106
|
+
static VALUE prepared_statement_nparams(VALUE self) {
|
|
106
107
|
rubyDuckDBPreparedStatement *ctx;
|
|
107
108
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
108
109
|
return ULL2NUM(duckdb_nparams(ctx->prepared_statement));
|
|
@@ -113,16 +114,16 @@ typedef struct {
|
|
|
113
114
|
duckdb_prepared_statement prepared_statement;
|
|
114
115
|
duckdb_result *out_result;
|
|
115
116
|
duckdb_state retval;
|
|
116
|
-
}
|
|
117
|
+
} prepared_statement_execute_nogvl_args;
|
|
117
118
|
|
|
118
119
|
/* :nodoc: */
|
|
119
|
-
static void
|
|
120
|
-
|
|
120
|
+
static void prepared_statement_execute_nogvl(void *ptr) {
|
|
121
|
+
prepared_statement_execute_nogvl_args *args = (prepared_statement_execute_nogvl_args *)ptr;
|
|
121
122
|
|
|
122
123
|
args->retval = duckdb_execute_prepared(args->prepared_statement, args->out_result);
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
static VALUE
|
|
126
|
+
static VALUE prepared_statement_execute(VALUE self) {
|
|
126
127
|
rubyDuckDBPreparedStatement *ctx;
|
|
127
128
|
rubyDuckDBResult *ctxr;
|
|
128
129
|
const char *error;
|
|
@@ -130,15 +131,15 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
|
|
|
130
131
|
VALUE msg;
|
|
131
132
|
|
|
132
133
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
133
|
-
ctxr =
|
|
134
|
+
ctxr = rbduckdb_get_struct_result(result);
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
prepared_statement_execute_nogvl_args args = {
|
|
136
137
|
.prepared_statement = ctx->prepared_statement,
|
|
137
138
|
.out_result = &(ctxr->result),
|
|
138
139
|
.retval = DuckDBError,
|
|
139
140
|
};
|
|
140
141
|
|
|
141
|
-
rb_thread_call_without_gvl((void *)
|
|
142
|
+
rb_thread_call_without_gvl((void *)prepared_statement_execute_nogvl, &args, RUBY_UBF_IO, 0);
|
|
142
143
|
duckdb_state state = args.retval;
|
|
143
144
|
|
|
144
145
|
if (state == DuckDBError) {
|
|
@@ -157,7 +158,7 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
|
|
|
157
158
|
/*
|
|
158
159
|
* :nodoc:
|
|
159
160
|
*/
|
|
160
|
-
static VALUE
|
|
161
|
+
static VALUE prepared_statement_destroy(VALUE self) {
|
|
161
162
|
rubyDuckDBPreparedStatement *ctx;
|
|
162
163
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
163
164
|
destroy_prepared_statement(ctx);
|
|
@@ -175,7 +176,7 @@ static idx_t check_index(VALUE vidx) {
|
|
|
175
176
|
return idx;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
static VALUE
|
|
179
|
+
static VALUE prepared_statement_bind_parameter_index(VALUE self, VALUE name) {
|
|
179
180
|
rubyDuckDBPreparedStatement *ctx;
|
|
180
181
|
idx_t idx;
|
|
181
182
|
|
|
@@ -187,7 +188,7 @@ static VALUE duckdb_prepared_statement_bind_parameter_index(VALUE self, VALUE na
|
|
|
187
188
|
return ULL2NUM(idx);
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
static VALUE
|
|
191
|
+
static VALUE prepared_statement_parameter_name(VALUE self, VALUE vidx) {
|
|
191
192
|
rubyDuckDBPreparedStatement *ctx;
|
|
192
193
|
VALUE vname;
|
|
193
194
|
const char *name;
|
|
@@ -210,7 +211,7 @@ static VALUE duckdb_prepared_statement_parameter_name(VALUE self, VALUE vidx) {
|
|
|
210
211
|
*
|
|
211
212
|
* clear all bindings of prepared statement.
|
|
212
213
|
*/
|
|
213
|
-
static VALUE
|
|
214
|
+
static VALUE prepared_statement_clear_bindings(VALUE self) {
|
|
214
215
|
rubyDuckDBPreparedStatement *ctx;
|
|
215
216
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
216
217
|
|
|
@@ -221,7 +222,7 @@ static VALUE duckdb_prepared_statement_clear_bindings(VALUE self) {
|
|
|
221
222
|
return self;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
|
-
static VALUE
|
|
225
|
+
static VALUE prepared_statement_bind_bool(VALUE self, VALUE vidx, VALUE val) {
|
|
225
226
|
rubyDuckDBPreparedStatement *ctx;
|
|
226
227
|
idx_t idx = check_index(vidx);
|
|
227
228
|
|
|
@@ -236,7 +237,7 @@ static VALUE duckdb_prepared_statement_bind_bool(VALUE self, VALUE vidx, VALUE v
|
|
|
236
237
|
return self;
|
|
237
238
|
}
|
|
238
239
|
|
|
239
|
-
static VALUE
|
|
240
|
+
static VALUE prepared_statement_bind_int8(VALUE self, VALUE vidx, VALUE val) {
|
|
240
241
|
rubyDuckDBPreparedStatement *ctx;
|
|
241
242
|
idx_t idx = check_index(vidx);
|
|
242
243
|
int8_t i8val = (int8_t)NUM2INT(val);
|
|
@@ -250,7 +251,7 @@ static VALUE duckdb_prepared_statement_bind_int8(VALUE self, VALUE vidx, VALUE v
|
|
|
250
251
|
}
|
|
251
252
|
|
|
252
253
|
|
|
253
|
-
static VALUE
|
|
254
|
+
static VALUE prepared_statement_bind_int16(VALUE self, VALUE vidx, VALUE val) {
|
|
254
255
|
rubyDuckDBPreparedStatement *ctx;
|
|
255
256
|
idx_t idx = check_index(vidx);
|
|
256
257
|
int16_t i16val = NUM2INT(val);
|
|
@@ -263,7 +264,7 @@ static VALUE duckdb_prepared_statement_bind_int16(VALUE self, VALUE vidx, VALUE
|
|
|
263
264
|
return self;
|
|
264
265
|
}
|
|
265
266
|
|
|
266
|
-
static VALUE
|
|
267
|
+
static VALUE prepared_statement_bind_int32(VALUE self, VALUE vidx, VALUE val) {
|
|
267
268
|
rubyDuckDBPreparedStatement *ctx;
|
|
268
269
|
idx_t idx = check_index(vidx);
|
|
269
270
|
int32_t i32val = NUM2INT(val);
|
|
@@ -276,7 +277,7 @@ static VALUE duckdb_prepared_statement_bind_int32(VALUE self, VALUE vidx, VALUE
|
|
|
276
277
|
return self;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
static VALUE
|
|
280
|
+
static VALUE prepared_statement_bind_int64(VALUE self, VALUE vidx, VALUE val) {
|
|
280
281
|
rubyDuckDBPreparedStatement *ctx;
|
|
281
282
|
idx_t idx = check_index(vidx);
|
|
282
283
|
int64_t i64val = NUM2LL(val);
|
|
@@ -289,7 +290,7 @@ static VALUE duckdb_prepared_statement_bind_int64(VALUE self, VALUE vidx, VALUE
|
|
|
289
290
|
return self;
|
|
290
291
|
}
|
|
291
292
|
|
|
292
|
-
static VALUE
|
|
293
|
+
static VALUE prepared_statement_bind_float(VALUE self, VALUE vidx, VALUE val) {
|
|
293
294
|
rubyDuckDBPreparedStatement *ctx;
|
|
294
295
|
idx_t idx = check_index(vidx);
|
|
295
296
|
double dbl = NUM2DBL(val);
|
|
@@ -302,7 +303,7 @@ static VALUE duckdb_prepared_statement_bind_float(VALUE self, VALUE vidx, VALUE
|
|
|
302
303
|
return self;
|
|
303
304
|
}
|
|
304
305
|
|
|
305
|
-
static VALUE
|
|
306
|
+
static VALUE prepared_statement_bind_double(VALUE self, VALUE vidx, VALUE val) {
|
|
306
307
|
rubyDuckDBPreparedStatement *ctx;
|
|
307
308
|
idx_t idx = check_index(vidx);
|
|
308
309
|
double dbl = NUM2DBL(val);
|
|
@@ -315,7 +316,7 @@ static VALUE duckdb_prepared_statement_bind_double(VALUE self, VALUE vidx, VALUE
|
|
|
315
316
|
return self;
|
|
316
317
|
}
|
|
317
318
|
|
|
318
|
-
static VALUE
|
|
319
|
+
static VALUE prepared_statement_bind_varchar(VALUE self, VALUE vidx, VALUE str) {
|
|
319
320
|
rubyDuckDBPreparedStatement *ctx;
|
|
320
321
|
idx_t idx = check_index(vidx);
|
|
321
322
|
|
|
@@ -327,7 +328,7 @@ static VALUE duckdb_prepared_statement_bind_varchar(VALUE self, VALUE vidx, VALU
|
|
|
327
328
|
return self;
|
|
328
329
|
}
|
|
329
330
|
|
|
330
|
-
static VALUE
|
|
331
|
+
static VALUE prepared_statement_bind_blob(VALUE self, VALUE vidx, VALUE blob) {
|
|
331
332
|
rubyDuckDBPreparedStatement *ctx;
|
|
332
333
|
idx_t idx = check_index(vidx);
|
|
333
334
|
|
|
@@ -339,7 +340,7 @@ static VALUE duckdb_prepared_statement_bind_blob(VALUE self, VALUE vidx, VALUE b
|
|
|
339
340
|
return self;
|
|
340
341
|
}
|
|
341
342
|
|
|
342
|
-
static VALUE
|
|
343
|
+
static VALUE prepared_statement_bind_null(VALUE self, VALUE vidx) {
|
|
343
344
|
rubyDuckDBPreparedStatement *ctx;
|
|
344
345
|
idx_t idx = check_index(vidx);
|
|
345
346
|
|
|
@@ -352,21 +353,21 @@ static VALUE duckdb_prepared_statement_bind_null(VALUE self, VALUE vidx) {
|
|
|
352
353
|
}
|
|
353
354
|
|
|
354
355
|
/* :nodoc: */
|
|
355
|
-
static VALUE
|
|
356
|
+
static VALUE prepared_statement__statement_type(VALUE self) {
|
|
356
357
|
rubyDuckDBPreparedStatement *ctx;
|
|
357
358
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
358
359
|
return INT2FIX(duckdb_prepared_statement_type(ctx->prepared_statement));
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
/* :nodoc: */
|
|
362
|
-
static VALUE
|
|
363
|
+
static VALUE prepared_statement__param_type(VALUE self, VALUE vidx) {
|
|
363
364
|
rubyDuckDBPreparedStatement *ctx;
|
|
364
365
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
365
366
|
return INT2FIX(duckdb_param_type(ctx->prepared_statement, NUM2ULL(vidx)));
|
|
366
367
|
}
|
|
367
368
|
|
|
368
369
|
/* :nodoc: */
|
|
369
|
-
static VALUE
|
|
370
|
+
static VALUE prepared_statement__bind_uint8(VALUE self, VALUE vidx, VALUE val) {
|
|
370
371
|
rubyDuckDBPreparedStatement *ctx;
|
|
371
372
|
idx_t idx = check_index(vidx);
|
|
372
373
|
uint8_t ui8val = (uint8_t)NUM2UINT(val);
|
|
@@ -380,7 +381,7 @@ static VALUE duckdb_prepared_statement__bind_uint8(VALUE self, VALUE vidx, VALUE
|
|
|
380
381
|
}
|
|
381
382
|
|
|
382
383
|
/* :nodoc: */
|
|
383
|
-
static VALUE
|
|
384
|
+
static VALUE prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALUE val) {
|
|
384
385
|
rubyDuckDBPreparedStatement *ctx;
|
|
385
386
|
idx_t idx = check_index(vidx);
|
|
386
387
|
uint16_t ui16val = (uint16_t)NUM2UINT(val);
|
|
@@ -394,7 +395,7 @@ static VALUE duckdb_prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALU
|
|
|
394
395
|
}
|
|
395
396
|
|
|
396
397
|
/* :nodoc: */
|
|
397
|
-
static VALUE
|
|
398
|
+
static VALUE prepared_statement__bind_uint32(VALUE self, VALUE vidx, VALUE val) {
|
|
398
399
|
rubyDuckDBPreparedStatement *ctx;
|
|
399
400
|
idx_t idx = check_index(vidx);
|
|
400
401
|
uint32_t ui32val = (uint32_t)NUM2UINT(val);
|
|
@@ -408,7 +409,7 @@ static VALUE duckdb_prepared_statement__bind_uint32(VALUE self, VALUE vidx, VALU
|
|
|
408
409
|
}
|
|
409
410
|
|
|
410
411
|
/* :nodoc: */
|
|
411
|
-
static VALUE
|
|
412
|
+
static VALUE prepared_statement__bind_uint64(VALUE self, VALUE vidx, VALUE val) {
|
|
412
413
|
rubyDuckDBPreparedStatement *ctx;
|
|
413
414
|
idx_t idx = check_index(vidx);
|
|
414
415
|
uint64_t ui64val = (uint64_t)NUM2ULL(val);
|
|
@@ -422,7 +423,7 @@ static VALUE duckdb_prepared_statement__bind_uint64(VALUE self, VALUE vidx, VALU
|
|
|
422
423
|
}
|
|
423
424
|
|
|
424
425
|
/* :nodoc: */
|
|
425
|
-
static VALUE
|
|
426
|
+
static VALUE prepared_statement__bind_date(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day) {
|
|
426
427
|
rubyDuckDBPreparedStatement *ctx;
|
|
427
428
|
duckdb_date dt;
|
|
428
429
|
idx_t idx = check_index(vidx);
|
|
@@ -439,7 +440,7 @@ static VALUE duckdb_prepared_statement__bind_date(VALUE self, VALUE vidx, VALUE
|
|
|
439
440
|
}
|
|
440
441
|
|
|
441
442
|
/* :nodoc: */
|
|
442
|
-
static VALUE
|
|
443
|
+
static VALUE prepared_statement__bind_time(VALUE self, VALUE vidx, VALUE hour, VALUE min, VALUE sec, VALUE micros){
|
|
443
444
|
rubyDuckDBPreparedStatement *ctx;
|
|
444
445
|
duckdb_time time;
|
|
445
446
|
|
|
@@ -457,7 +458,7 @@ static VALUE duckdb_prepared_statement__bind_time(VALUE self, VALUE vidx, VALUE
|
|
|
457
458
|
}
|
|
458
459
|
|
|
459
460
|
/* :nodoc: */
|
|
460
|
-
static VALUE
|
|
461
|
+
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
462
|
duckdb_timestamp timestamp;
|
|
462
463
|
rubyDuckDBPreparedStatement *ctx;
|
|
463
464
|
idx_t idx = check_index(vidx);
|
|
@@ -472,7 +473,22 @@ static VALUE duckdb_prepared_statement__bind_timestamp(VALUE self, VALUE vidx, V
|
|
|
472
473
|
}
|
|
473
474
|
|
|
474
475
|
/* :nodoc: */
|
|
475
|
-
static VALUE
|
|
476
|
+
static VALUE prepared_statement__bind_timestamp_tz(VALUE self, VALUE vidx, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros) {
|
|
477
|
+
duckdb_timestamp timestamp_tz;
|
|
478
|
+
rubyDuckDBPreparedStatement *ctx;
|
|
479
|
+
idx_t idx = check_index(vidx);
|
|
480
|
+
|
|
481
|
+
timestamp_tz = rbduckdb_to_duckdb_timestamp_from_value(year, month, day, hour, min, sec, micros);
|
|
482
|
+
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
483
|
+
|
|
484
|
+
if (duckdb_bind_timestamp_tz(ctx->prepared_statement, idx, timestamp_tz) == DuckDBError) {
|
|
485
|
+
rb_raise(eDuckDBError, "fail to bind %llu parameter", (unsigned long long)idx);
|
|
486
|
+
}
|
|
487
|
+
return self;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* :nodoc: */
|
|
491
|
+
static VALUE prepared_statement__bind_interval(VALUE self, VALUE vidx, VALUE months, VALUE days, VALUE micros) {
|
|
476
492
|
duckdb_interval interval;
|
|
477
493
|
rubyDuckDBPreparedStatement *ctx;
|
|
478
494
|
idx_t idx = check_index(vidx);
|
|
@@ -488,7 +504,7 @@ static VALUE duckdb_prepared_statement__bind_interval(VALUE self, VALUE vidx, VA
|
|
|
488
504
|
}
|
|
489
505
|
|
|
490
506
|
/* :nodoc: */
|
|
491
|
-
static VALUE
|
|
507
|
+
static VALUE prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper) {
|
|
492
508
|
duckdb_hugeint hugeint;
|
|
493
509
|
rubyDuckDBPreparedStatement *ctx;
|
|
494
510
|
idx_t idx = check_index(vidx);
|
|
@@ -505,7 +521,7 @@ static VALUE duckdb_prepared_statement__bind_hugeint(VALUE self, VALUE vidx, VAL
|
|
|
505
521
|
}
|
|
506
522
|
|
|
507
523
|
/* :nodoc: */
|
|
508
|
-
static VALUE
|
|
524
|
+
static VALUE prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VALUE lower, VALUE upper) {
|
|
509
525
|
duckdb_uhugeint uhugeint;
|
|
510
526
|
rubyDuckDBPreparedStatement *ctx;
|
|
511
527
|
idx_t idx = check_index(vidx);
|
|
@@ -522,7 +538,7 @@ static VALUE duckdb_prepared_statement__bind_uhugeint(VALUE self, VALUE vidx, VA
|
|
|
522
538
|
}
|
|
523
539
|
|
|
524
540
|
/* :nodoc: */
|
|
525
|
-
static VALUE
|
|
541
|
+
static VALUE prepared_statement__bind_decimal(VALUE self, VALUE vidx, VALUE lower, VALUE upper, VALUE width, VALUE scale) {
|
|
526
542
|
duckdb_hugeint hugeint;
|
|
527
543
|
duckdb_decimal decimal;
|
|
528
544
|
rubyDuckDBPreparedStatement *ctx;
|
|
@@ -543,13 +559,13 @@ static VALUE duckdb_prepared_statement__bind_decimal(VALUE self, VALUE vidx, VAL
|
|
|
543
559
|
}
|
|
544
560
|
|
|
545
561
|
/* :nodoc: */
|
|
546
|
-
static VALUE
|
|
562
|
+
static VALUE prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE val) {
|
|
547
563
|
rubyDuckDBPreparedStatement *ctx;
|
|
548
564
|
rubyDuckDBValue *val_ctx;
|
|
549
565
|
idx_t idx = check_index(vidx);
|
|
550
566
|
|
|
551
567
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
552
|
-
val_ctx =
|
|
568
|
+
val_ctx = rbduckdb_get_struct_value(val);
|
|
553
569
|
|
|
554
570
|
if (duckdb_bind_value(ctx->prepared_statement, idx, val_ctx->value) == DuckDBError) {
|
|
555
571
|
rb_raise(eDuckDBError, "fail to bind %llu parameter", (unsigned long long)idx);
|
|
@@ -557,13 +573,13 @@ static VALUE duckdb_prepared_statement__bind_value(VALUE self, VALUE vidx, VALUE
|
|
|
557
573
|
return self;
|
|
558
574
|
}
|
|
559
575
|
|
|
560
|
-
rubyDuckDBPreparedStatement *
|
|
576
|
+
rubyDuckDBPreparedStatement *rbduckdb_get_struct_prepared_statement(VALUE self) {
|
|
561
577
|
rubyDuckDBPreparedStatement *ctx;
|
|
562
578
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
|
563
579
|
return ctx;
|
|
564
580
|
}
|
|
565
581
|
|
|
566
|
-
void
|
|
582
|
+
void rbduckdb_init_prepared_statement(void) {
|
|
567
583
|
#if 0
|
|
568
584
|
VALUE mDuckDB = rb_define_module("DuckDB");
|
|
569
585
|
#endif
|
|
@@ -571,35 +587,36 @@ void rbduckdb_init_duckdb_prepared_statement(void) {
|
|
|
571
587
|
|
|
572
588
|
rb_define_alloc_func(cDuckDBPreparedStatement, allocate);
|
|
573
589
|
|
|
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, "
|
|
601
|
-
rb_define_private_method(cDuckDBPreparedStatement, "
|
|
602
|
-
rb_define_private_method(cDuckDBPreparedStatement, "
|
|
603
|
-
rb_define_private_method(cDuckDBPreparedStatement, "
|
|
604
|
-
rb_define_private_method(cDuckDBPreparedStatement, "
|
|
590
|
+
rb_define_method(cDuckDBPreparedStatement, "initialize", prepared_statement_initialize, 2);
|
|
591
|
+
rb_define_method(cDuckDBPreparedStatement, "execute", prepared_statement_execute, 0);
|
|
592
|
+
rb_define_method(cDuckDBPreparedStatement, "destroy", prepared_statement_destroy, 0);
|
|
593
|
+
rb_define_method(cDuckDBPreparedStatement, "nparams", prepared_statement_nparams, 0);
|
|
594
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_parameter_index", prepared_statement_bind_parameter_index, 1);
|
|
595
|
+
rb_define_method(cDuckDBPreparedStatement, "parameter_name", prepared_statement_parameter_name, 1);
|
|
596
|
+
rb_define_method(cDuckDBPreparedStatement, "clear_bindings", prepared_statement_clear_bindings, 0);
|
|
597
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_bool", prepared_statement_bind_bool, 2);
|
|
598
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int8", prepared_statement_bind_int8, 2);
|
|
599
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int16", prepared_statement_bind_int16, 2);
|
|
600
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int32", prepared_statement_bind_int32, 2);
|
|
601
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_int64", prepared_statement_bind_int64, 2);
|
|
602
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_float", prepared_statement_bind_float, 2);
|
|
603
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_double", prepared_statement_bind_double, 2);
|
|
604
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_varchar", prepared_statement_bind_varchar, 2);
|
|
605
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_blob", prepared_statement_bind_blob, 2);
|
|
606
|
+
rb_define_method(cDuckDBPreparedStatement, "bind_null", prepared_statement_bind_null, 1);
|
|
607
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint8", prepared_statement__bind_uint8, 2);
|
|
608
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint16", prepared_statement__bind_uint16, 2);
|
|
609
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint32", prepared_statement__bind_uint32, 2);
|
|
610
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uint64", prepared_statement__bind_uint64, 2);
|
|
611
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_statement_type", prepared_statement__statement_type, 0);
|
|
612
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_param_type", prepared_statement__param_type, 1);
|
|
613
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_date", prepared_statement__bind_date, 4);
|
|
614
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_time", prepared_statement__bind_time, 5);
|
|
615
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_timestamp", prepared_statement__bind_timestamp, 8);
|
|
616
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_timestamp_tz", prepared_statement__bind_timestamp_tz, 8);
|
|
617
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_interval", prepared_statement__bind_interval, 4);
|
|
618
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_hugeint", prepared_statement__bind_hugeint, 3);
|
|
619
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_uhugeint", prepared_statement__bind_uhugeint, 3);
|
|
620
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_decimal", prepared_statement__bind_decimal, 5);
|
|
621
|
+
rb_define_private_method(cDuckDBPreparedStatement, "_bind_value", prepared_statement__bind_value, 2);
|
|
605
622
|
}
|
|
@@ -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
|