duckdb 0.0.12 → 0.2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test_on_macos.yml +2 -8
- data/.github/workflows/test_on_ubuntu.yml +15 -15
- data/.travis.yml +6 -6
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +2 -2
- data/ext/duckdb/appender.c +315 -0
- data/ext/duckdb/appender.h +17 -0
- data/ext/duckdb/duckdb.c +6 -0
- data/ext/duckdb/extconf.rb +2 -0
- data/ext/duckdb/ruby-duckdb.h +6 -0
- data/lib/duckdb/connection.rb +8 -0
- data/lib/duckdb/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96e1030a16d014daaab4b84c0c15cde0d023fcb0fb761bee97056127f3530533
|
4
|
+
data.tar.gz: 2010828495199a8959b2246c0de6262de273387daaa3b3b9a8ebbca6e2fda47c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da434b1e0f179cf6392beb998be0eba637cd782a74a4ea4474752b1c900afe1cbf43a5816cb7ff37c8b6e34226a0a2bcc4e4e89e54c28697e5ec39695775f31f
|
7
|
+
data.tar.gz: be2f05c2b472db0e548da9acd69aebd41ff0685fdcf925970af36d489882539a88fb51c49a791edd1e4f34daf9aac16311e15ce6771e9f504b987e1d29e1aa93
|
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
runs-on: macos-latest
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: ['2.5.8', '2.6.
|
10
|
+
ruby: ['2.5.8', '2.6.7', '2.7.3', '3.0.1', 'head']
|
11
11
|
|
12
12
|
steps:
|
13
13
|
- uses: actions/checkout@v2
|
@@ -17,15 +17,9 @@ jobs:
|
|
17
17
|
with:
|
18
18
|
ruby-version: ${{ matrix.ruby }}
|
19
19
|
|
20
|
-
- name: Install duckdb
|
21
|
-
env:
|
22
|
-
DUCKDB_VERSION: 0.2.4
|
20
|
+
- name: Install latest duckdb by brew
|
23
21
|
run: |
|
24
22
|
brew install duckdb
|
25
|
-
git clone -b v${DUCKDB_VERSION} https://github.com/cwida/duckdb.git duckdb-v${DUCKDB_VERSION}
|
26
|
-
cp duckdb-v${DUCKDB_VERSION}/src/include/duckdb.h /usr/local/include
|
27
|
-
mkdir -p /usr/local/include/duckdb/common
|
28
|
-
cp duckdb-v${DUCKDB_VERSION}/src/include/duckdb/common/winapi.hpp /usr/local/include/duckdb/common
|
29
23
|
|
30
24
|
- name: Build and test with Rake with Ruby ${{ matrix.ruby }}
|
31
25
|
run: |
|
@@ -8,8 +8,8 @@ jobs:
|
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
|
-
ruby: ['2.5.8', '2.6.
|
12
|
-
duckdb: ['0.2.
|
11
|
+
ruby: ['2.5.8', '2.6.7', '2.7.3', '3.0.1', 'head']
|
12
|
+
duckdb: ['0.2.6', '0.2.5']
|
13
13
|
|
14
14
|
steps:
|
15
15
|
- uses: actions/checkout@v2
|
@@ -19,14 +19,14 @@ jobs:
|
|
19
19
|
with:
|
20
20
|
ruby-version: ${{ matrix.ruby }}
|
21
21
|
|
22
|
-
- name: duckdb 0.2.
|
23
|
-
id: duckdb-cache-
|
22
|
+
- name: duckdb 0.2.6 cache
|
23
|
+
id: duckdb-cache-v0_2_6
|
24
24
|
uses: actions/cache@v1.1.0
|
25
25
|
with:
|
26
|
-
path: duckdb-v0.2.
|
27
|
-
key: ${{ runner.os }}-duckdb-
|
26
|
+
path: duckdb-v0.2.6
|
27
|
+
key: ${{ runner.os }}-duckdb-v0_2_6_001
|
28
28
|
restore-keys: |
|
29
|
-
${{ runner.os }}-duckdb-
|
29
|
+
${{ runner.os }}-duckdb-v0_2_6
|
30
30
|
|
31
31
|
- name: duckdb 0.2.5 cache
|
32
32
|
id: duckdb-cache-v0_2_5
|
@@ -37,15 +37,15 @@ jobs:
|
|
37
37
|
restore-keys: |
|
38
38
|
${{ runner.os }}-duckdb-v0_2_5
|
39
39
|
|
40
|
-
- name: Build duckdb 0.2.
|
41
|
-
if: steps.duckdb-cache-
|
40
|
+
- name: Build duckdb 0.2.6
|
41
|
+
if: steps.duckdb-cache-v0_2_6.outputs.cache-hit != 'true'
|
42
42
|
run: |
|
43
|
-
git clone -b v0.2.
|
44
|
-
cd duckdb-tmp-v0.2.
|
45
|
-
rm -rf duckdb-v0.2.
|
46
|
-
mkdir -p duckdb-v0.2.
|
47
|
-
cp -rip duckdb-tmp-v0.2.
|
48
|
-
cp -rip duckdb-tmp-v0.2.
|
43
|
+
git clone -b v0.2.6 https://github.com/cwida/duckdb.git duckdb-tmp-v0.2.6
|
44
|
+
cd duckdb-tmp-v0.2.6 && make && cd ..
|
45
|
+
rm -rf duckdb-v0.2.6
|
46
|
+
mkdir -p duckdb-v0.2.6/build/release/src duckdb-v0.2.6/src
|
47
|
+
cp -rip duckdb-tmp-v0.2.6/build/release/src/*.so duckdb-v0.2.6/build/release/src
|
48
|
+
cp -rip duckdb-tmp-v0.2.6/src/include duckdb-v0.2.6/src/
|
49
49
|
|
50
50
|
- name: Build duckdb 0.2.5
|
51
51
|
if: steps.duckdb-cache-v0_2_5.outputs.cache-hit != 'true'
|
data/.travis.yml
CHANGED
@@ -2,17 +2,17 @@ language: ruby
|
|
2
2
|
cache:
|
3
3
|
bundler: true
|
4
4
|
directories:
|
5
|
-
- ${HOME}/duckdb-v0.2.
|
5
|
+
- ${HOME}/duckdb-v0.2.6
|
6
6
|
before_install:
|
7
7
|
- yes | gem update --system
|
8
|
-
- if [[ ! -d ${HOME}/duckdb-v0.2.
|
8
|
+
- if [[ ! -d ${HOME}/duckdb-v0.2.6/build ]]; then cd ${HOME} && git clone -b v0.2.6 https://github.com/cwida/duckdb.git duckdb-v0.2.6 && cd duckdb-v0.2.6 && make && cd ${TRAVIS_BUILD_DIR}; fi
|
9
9
|
|
10
10
|
env:
|
11
|
-
- DUCKDB_VERSION=0.2.
|
11
|
+
- DUCKDB_VERSION=0.2.6
|
12
12
|
rvm:
|
13
13
|
- 2.5.8
|
14
|
-
- 2.6.
|
15
|
-
- 2.7.
|
16
|
-
- 3.0.
|
14
|
+
- 2.6.7
|
15
|
+
- 2.7.3
|
16
|
+
- 3.0.1
|
17
17
|
- ruby-head
|
18
18
|
script: bundle exec rake -- --with-duckdb-include=${HOME}/duckdb-v${DUCKDB_VERSION}/src/include --with-duckdb-lib=${HOME}/duckdb-v${DUCKDB_VERSION}/build/release/src/
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# ChangeLog
|
2
2
|
|
3
|
+
# 0.2.6.0
|
4
|
+
|
5
|
+
- change version policy
|
6
|
+
- ruby-duckdb W.X.Y.Z supports duckdb W.X.Y
|
7
|
+
- add DuckDB::Appender
|
8
|
+
- bump DuckDB to v0.2.6 in CI.
|
9
|
+
- remove unnecessary duckdb header file from MacOS CI.
|
10
|
+
- add DuckDB::Connection#prepared_statement.
|
11
|
+
|
3
12
|
## 0.0.12
|
4
13
|
|
5
14
|
- bump DuckDB to v0.2.5
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,315 @@
|
|
1
|
+
#include "ruby-duckdb.h"
|
2
|
+
|
3
|
+
#ifdef HAVE_DUCKDB_APPENDER_CREATE
|
4
|
+
|
5
|
+
static VALUE cDuckDBAppender;
|
6
|
+
|
7
|
+
static void deallocate(void *);
|
8
|
+
static VALUE allocate(VALUE klass);
|
9
|
+
static VALUE appender_initialize(VALUE klass, VALUE con, VALUE schema, VALUE table);
|
10
|
+
static VALUE appender_begin_row(VALUE self);
|
11
|
+
static VALUE appender_end_row(VALUE self);
|
12
|
+
static VALUE appender_append_bool(VALUE self, VALUE val);
|
13
|
+
static VALUE appender_append_int8(VALUE self, VALUE val);
|
14
|
+
static VALUE appender_append_int16(VALUE self, VALUE val);
|
15
|
+
static VALUE appender_append_int32(VALUE self, VALUE val);
|
16
|
+
static VALUE appender_append_int64(VALUE self, VALUE val);
|
17
|
+
static VALUE appender_append_uint8(VALUE self, VALUE val);
|
18
|
+
static VALUE appender_append_uint16(VALUE self, VALUE val);
|
19
|
+
static VALUE appender_append_uint32(VALUE self, VALUE val);
|
20
|
+
static VALUE appender_append_uint64(VALUE self, VALUE val);
|
21
|
+
static VALUE appender_append_float(VALUE self, VALUE val);
|
22
|
+
static VALUE appender_append_double(VALUE self, VALUE val);
|
23
|
+
static VALUE appender_append_varchar(VALUE self, VALUE val);
|
24
|
+
static VALUE appender_append_varchar_length(VALUE self, VALUE val, VALUE len);
|
25
|
+
static VALUE appender_append_blob(VALUE self, VALUE val);
|
26
|
+
static VALUE appender_append_null(VALUE self);
|
27
|
+
static VALUE appender_flush(VALUE self);
|
28
|
+
static VALUE appender_close(VALUE self);
|
29
|
+
|
30
|
+
static void deallocate(void * ctx)
|
31
|
+
{
|
32
|
+
rubyDuckDBAppender *p = (rubyDuckDBAppender *)ctx;
|
33
|
+
|
34
|
+
duckdb_appender_destroy(&(p->appender));
|
35
|
+
xfree(p);
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE allocate(VALUE klass)
|
39
|
+
{
|
40
|
+
rubyDuckDBAppender *ctx = xcalloc((size_t)1, sizeof(rubyDuckDBAppender));
|
41
|
+
return Data_Wrap_Struct(klass, NULL, deallocate, ctx);
|
42
|
+
}
|
43
|
+
|
44
|
+
static VALUE appender_initialize(VALUE self, VALUE con, VALUE schema, VALUE table) {
|
45
|
+
|
46
|
+
rubyDuckDBConnection *ctxcon;
|
47
|
+
rubyDuckDBAppender *ctx;
|
48
|
+
char *pschema = 0;
|
49
|
+
|
50
|
+
if (!rb_obj_is_kind_of(con, cDuckDBConnection)) {
|
51
|
+
rb_raise(rb_eTypeError, "1st argument should be instance of DackDB::Connection");
|
52
|
+
}
|
53
|
+
|
54
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
55
|
+
Data_Get_Struct(con, rubyDuckDBConnection, ctxcon);
|
56
|
+
|
57
|
+
if (schema != Qnil) {
|
58
|
+
pschema = StringValuePtr(schema);
|
59
|
+
}
|
60
|
+
|
61
|
+
if (duckdb_appender_create(ctxcon->con, pschema, StringValuePtr(table), &(ctx->appender)) == DuckDBError) {
|
62
|
+
rb_raise(eDuckDBError, "failed to create appender");
|
63
|
+
}
|
64
|
+
return self;
|
65
|
+
}
|
66
|
+
|
67
|
+
static VALUE appender_begin_row(VALUE self) {
|
68
|
+
rubyDuckDBAppender *ctx;
|
69
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
70
|
+
|
71
|
+
if (duckdb_appender_begin_row(ctx->appender) == DuckDBError) {
|
72
|
+
rb_raise(eDuckDBError, "failed to flush");
|
73
|
+
}
|
74
|
+
return self;
|
75
|
+
}
|
76
|
+
|
77
|
+
static VALUE appender_end_row(VALUE self) {
|
78
|
+
rubyDuckDBAppender *ctx;
|
79
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
80
|
+
|
81
|
+
if (duckdb_appender_end_row(ctx->appender) == DuckDBError) {
|
82
|
+
rb_raise(eDuckDBError, "failed to flush");
|
83
|
+
}
|
84
|
+
return self;
|
85
|
+
}
|
86
|
+
|
87
|
+
static VALUE appender_append_bool(VALUE self, VALUE val) {
|
88
|
+
rubyDuckDBAppender *ctx;
|
89
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
90
|
+
|
91
|
+
if (val != Qtrue && val != Qfalse) {
|
92
|
+
rb_raise(rb_eArgError, "argument must be boolean");
|
93
|
+
}
|
94
|
+
|
95
|
+
if (duckdb_append_bool(ctx->appender, (val == Qtrue)) == DuckDBError) {
|
96
|
+
rb_raise(eDuckDBError, "failed to append boolean");
|
97
|
+
}
|
98
|
+
return self;
|
99
|
+
}
|
100
|
+
|
101
|
+
static VALUE appender_append_int8(VALUE self, VALUE val) {
|
102
|
+
rubyDuckDBAppender *ctx;
|
103
|
+
int8_t i8val = (int8_t)NUM2INT(val);
|
104
|
+
|
105
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
106
|
+
|
107
|
+
if (duckdb_append_int8(ctx->appender, i8val) == DuckDBError) {
|
108
|
+
rb_raise(eDuckDBError, "failed to append");
|
109
|
+
}
|
110
|
+
return self;
|
111
|
+
}
|
112
|
+
|
113
|
+
static VALUE appender_append_int16(VALUE self, VALUE val) {
|
114
|
+
rubyDuckDBAppender *ctx;
|
115
|
+
int16_t i16val = NUM2INT(val);
|
116
|
+
|
117
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
118
|
+
|
119
|
+
if (duckdb_append_int16(ctx->appender, i16val) == DuckDBError) {
|
120
|
+
rb_raise(eDuckDBError, "failed to append");
|
121
|
+
}
|
122
|
+
return self;
|
123
|
+
}
|
124
|
+
|
125
|
+
static VALUE appender_append_int32(VALUE self, VALUE val) {
|
126
|
+
rubyDuckDBAppender *ctx;
|
127
|
+
int32_t i32val = (int32_t)NUM2INT(val);
|
128
|
+
|
129
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
130
|
+
|
131
|
+
if (duckdb_append_int32(ctx->appender, i32val) == DuckDBError) {
|
132
|
+
rb_raise(eDuckDBError, "failed to append");
|
133
|
+
}
|
134
|
+
return self;
|
135
|
+
}
|
136
|
+
|
137
|
+
static VALUE appender_append_int64(VALUE self, VALUE val) {
|
138
|
+
rubyDuckDBAppender *ctx;
|
139
|
+
int64_t i64val = NUM2LL(val);
|
140
|
+
|
141
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
142
|
+
|
143
|
+
if (duckdb_append_int64(ctx->appender, i64val) == DuckDBError) {
|
144
|
+
rb_raise(eDuckDBError, "failed to append");
|
145
|
+
}
|
146
|
+
return self;
|
147
|
+
}
|
148
|
+
|
149
|
+
static VALUE appender_append_uint8(VALUE self, VALUE val) {
|
150
|
+
rubyDuckDBAppender *ctx;
|
151
|
+
int8_t ui8val = (uint8_t)NUM2UINT(val);
|
152
|
+
|
153
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
154
|
+
|
155
|
+
if (duckdb_append_uint8(ctx->appender, ui8val) == DuckDBError) {
|
156
|
+
rb_raise(eDuckDBError, "failed to append");
|
157
|
+
}
|
158
|
+
return self;
|
159
|
+
}
|
160
|
+
|
161
|
+
static VALUE appender_append_uint16(VALUE self, VALUE val) {
|
162
|
+
rubyDuckDBAppender *ctx;
|
163
|
+
uint16_t ui16val = (uint16_t)NUM2UINT(val);
|
164
|
+
|
165
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
166
|
+
|
167
|
+
if (duckdb_append_uint16(ctx->appender, ui16val) == DuckDBError) {
|
168
|
+
rb_raise(eDuckDBError, "failed to append");
|
169
|
+
}
|
170
|
+
return self;
|
171
|
+
}
|
172
|
+
|
173
|
+
static VALUE appender_append_uint32(VALUE self, VALUE val) {
|
174
|
+
rubyDuckDBAppender *ctx;
|
175
|
+
uint32_t ui32val = (uint32_t)NUM2UINT(val);
|
176
|
+
|
177
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
178
|
+
|
179
|
+
if (duckdb_append_uint32(ctx->appender, ui32val) == DuckDBError) {
|
180
|
+
rb_raise(eDuckDBError, "failed to append");
|
181
|
+
}
|
182
|
+
return self;
|
183
|
+
}
|
184
|
+
|
185
|
+
static VALUE appender_append_uint64(VALUE self, VALUE val) {
|
186
|
+
rubyDuckDBAppender *ctx;
|
187
|
+
uint64_t ui64val = (int64_t)NUM2ULL(val);
|
188
|
+
|
189
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
190
|
+
|
191
|
+
if (duckdb_append_uint64(ctx->appender, ui64val) == DuckDBError) {
|
192
|
+
rb_raise(eDuckDBError, "failed to append");
|
193
|
+
}
|
194
|
+
return self;
|
195
|
+
}
|
196
|
+
|
197
|
+
static VALUE appender_append_float(VALUE self, VALUE val) {
|
198
|
+
rubyDuckDBAppender *ctx;
|
199
|
+
float fval = (float)NUM2DBL(val);
|
200
|
+
|
201
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
202
|
+
|
203
|
+
if (duckdb_append_float(ctx->appender, fval) == DuckDBError) {
|
204
|
+
rb_raise(eDuckDBError, "failed to append");
|
205
|
+
}
|
206
|
+
return self;
|
207
|
+
}
|
208
|
+
|
209
|
+
static VALUE appender_append_double(VALUE self, VALUE val) {
|
210
|
+
rubyDuckDBAppender *ctx;
|
211
|
+
double dval = NUM2DBL(val);
|
212
|
+
|
213
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
214
|
+
|
215
|
+
if (duckdb_append_double(ctx->appender, dval) == DuckDBError) {
|
216
|
+
rb_raise(eDuckDBError, "failed to append");
|
217
|
+
}
|
218
|
+
return self;
|
219
|
+
}
|
220
|
+
|
221
|
+
static VALUE appender_append_varchar(VALUE self, VALUE val) {
|
222
|
+
rubyDuckDBAppender *ctx;
|
223
|
+
char *pval = StringValuePtr(val);
|
224
|
+
|
225
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
226
|
+
|
227
|
+
if (duckdb_append_varchar(ctx->appender, pval) == DuckDBError) {
|
228
|
+
rb_raise(eDuckDBError, "failed to append");
|
229
|
+
}
|
230
|
+
return self;
|
231
|
+
}
|
232
|
+
|
233
|
+
static VALUE appender_append_varchar_length(VALUE self, VALUE val, VALUE len) {
|
234
|
+
rubyDuckDBAppender *ctx;
|
235
|
+
|
236
|
+
char *pval = StringValuePtr(val);
|
237
|
+
idx_t length = (idx_t)NUM2ULL(len);
|
238
|
+
|
239
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
240
|
+
|
241
|
+
if (duckdb_append_varchar_length(ctx->appender, pval, length) == DuckDBError) {
|
242
|
+
rb_raise(eDuckDBError, "failed to append");
|
243
|
+
}
|
244
|
+
return self;
|
245
|
+
}
|
246
|
+
|
247
|
+
static VALUE appender_append_blob(VALUE self, VALUE val) {
|
248
|
+
rubyDuckDBAppender *ctx;
|
249
|
+
|
250
|
+
char *pval = StringValuePtr(val);
|
251
|
+
idx_t length = (idx_t)RSTRING_LEN(val);
|
252
|
+
|
253
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
254
|
+
|
255
|
+
if (duckdb_append_blob(ctx->appender, (void *)pval, length) == DuckDBError) {
|
256
|
+
rb_raise(eDuckDBError, "failed to append");
|
257
|
+
}
|
258
|
+
return self;
|
259
|
+
}
|
260
|
+
|
261
|
+
static VALUE appender_append_null(VALUE self) {
|
262
|
+
rubyDuckDBAppender *ctx;
|
263
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
264
|
+
|
265
|
+
if (duckdb_append_null(ctx->appender) == DuckDBError) {
|
266
|
+
rb_raise(eDuckDBError, "failed to append");
|
267
|
+
}
|
268
|
+
return self;
|
269
|
+
}
|
270
|
+
|
271
|
+
static VALUE appender_flush(VALUE self) {
|
272
|
+
rubyDuckDBAppender *ctx;
|
273
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
274
|
+
|
275
|
+
if (duckdb_appender_flush(ctx->appender) == DuckDBError) {
|
276
|
+
rb_raise(eDuckDBError, "failed to flush");
|
277
|
+
}
|
278
|
+
return self;
|
279
|
+
}
|
280
|
+
|
281
|
+
static VALUE appender_close(VALUE self) {
|
282
|
+
rubyDuckDBAppender *ctx;
|
283
|
+
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
|
284
|
+
|
285
|
+
if (duckdb_appender_close(ctx->appender) == DuckDBError) {
|
286
|
+
rb_raise(eDuckDBError, "failed to flush");
|
287
|
+
}
|
288
|
+
return self;
|
289
|
+
}
|
290
|
+
|
291
|
+
void init_duckdb_appender(void) {
|
292
|
+
cDuckDBAppender = rb_define_class_under(mDuckDB, "Appender", rb_cObject);
|
293
|
+
rb_define_alloc_func(cDuckDBAppender, allocate);
|
294
|
+
rb_define_method(cDuckDBAppender, "initialize", appender_initialize, 3);
|
295
|
+
rb_define_method(cDuckDBAppender, "begin_row", appender_begin_row, 0);
|
296
|
+
rb_define_method(cDuckDBAppender, "end_row", appender_end_row, 0);
|
297
|
+
rb_define_method(cDuckDBAppender, "append_bool", appender_append_bool, 1);
|
298
|
+
rb_define_method(cDuckDBAppender, "append_int8", appender_append_int8, 1);
|
299
|
+
rb_define_method(cDuckDBAppender, "append_int16", appender_append_int16, 1);
|
300
|
+
rb_define_method(cDuckDBAppender, "append_int32", appender_append_int32, 1);
|
301
|
+
rb_define_method(cDuckDBAppender, "append_int64", appender_append_int64, 1);
|
302
|
+
rb_define_method(cDuckDBAppender, "append_uint8", appender_append_uint8, 1);
|
303
|
+
rb_define_method(cDuckDBAppender, "append_uint16", appender_append_uint16, 1);
|
304
|
+
rb_define_method(cDuckDBAppender, "append_uint32", appender_append_uint32, 1);
|
305
|
+
rb_define_method(cDuckDBAppender, "append_uint64", appender_append_uint64, 1);
|
306
|
+
rb_define_method(cDuckDBAppender, "append_float", appender_append_float, 1);
|
307
|
+
rb_define_method(cDuckDBAppender, "append_double", appender_append_double, 1);
|
308
|
+
rb_define_method(cDuckDBAppender, "append_varchar", appender_append_varchar, 1);
|
309
|
+
rb_define_method(cDuckDBAppender, "append_varchar_length", appender_append_varchar_length, 2);
|
310
|
+
rb_define_method(cDuckDBAppender, "append_blob", appender_append_blob, 1);
|
311
|
+
rb_define_method(cDuckDBAppender, "append_null", appender_append_null, 0);
|
312
|
+
rb_define_method(cDuckDBAppender, "flush", appender_flush, 0);
|
313
|
+
rb_define_method(cDuckDBAppender, "close", appender_close, 0);
|
314
|
+
}
|
315
|
+
#endif /* HAVE_DUCKDB_APPENDER_CREATE */
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#ifndef RUBY_DUCKDB_APPENDER_H
|
2
|
+
#define RUBY_DUCKDB_APPENDER_H
|
3
|
+
|
4
|
+
#ifdef HAVE_DUCKDB_APPENDER_CREATE
|
5
|
+
|
6
|
+
struct _rubyDuckDBAppender {
|
7
|
+
duckdb_appender appender;
|
8
|
+
};
|
9
|
+
|
10
|
+
typedef struct _rubyDuckDBAppender rubyDuckDBAppender;
|
11
|
+
|
12
|
+
void init_duckdb_appender(void);
|
13
|
+
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#endif
|
17
|
+
|
data/ext/duckdb/duckdb.c
CHANGED
data/ext/duckdb/extconf.rb
CHANGED
data/ext/duckdb/ruby-duckdb.h
CHANGED
@@ -15,6 +15,12 @@
|
|
15
15
|
|
16
16
|
#endif /* HAVE_DUCKDB_VALUE_BLOB */
|
17
17
|
|
18
|
+
#ifdef HAVE_DUCKDB_APPENDER_CREATE
|
19
|
+
|
20
|
+
#include "./appender.h"
|
21
|
+
|
22
|
+
#endif /* HAVE_DUCKDB_APPENDER_CREATE */
|
23
|
+
|
18
24
|
extern VALUE mDuckDB;
|
19
25
|
extern VALUE cDuckDBDatabase;
|
20
26
|
extern VALUE cDuckDBConnection;
|
data/lib/duckdb/connection.rb
CHANGED
@@ -44,6 +44,14 @@ module DuckDB
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
#
|
48
|
+
# returns PreparedStatement object.
|
49
|
+
# The first argument is SQL string.
|
50
|
+
#
|
51
|
+
def prepared_statement(str)
|
52
|
+
PreparedStatement.new(self, str)
|
53
|
+
end
|
54
|
+
|
47
55
|
alias execute query
|
48
56
|
alias open connect
|
49
57
|
alias close disconnect
|
data/lib/duckdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duckdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Suketa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -88,6 +88,8 @@ files:
|
|
88
88
|
- bin/console
|
89
89
|
- bin/setup
|
90
90
|
- duckdb.gemspec
|
91
|
+
- ext/duckdb/appender.c
|
92
|
+
- ext/duckdb/appender.h
|
91
93
|
- ext/duckdb/blob.c
|
92
94
|
- ext/duckdb/blob.h
|
93
95
|
- ext/duckdb/connection.c
|
@@ -131,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
133
|
- !ruby/object:Gem::Version
|
132
134
|
version: '0'
|
133
135
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.3.0.dev
|
135
137
|
signing_key:
|
136
138
|
specification_version: 4
|
137
139
|
summary: This module is Ruby binding for DuckDB database engine.
|