duckdb 0.7.0 → 0.7.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/.github/workflows/test_on_macos.yml +1 -1
- data/.github/workflows/test_on_ubuntu.yml +1 -1
- data/.github/workflows/test_on_windows.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTION.md +35 -14
- data/Dockerfile +21 -0
- data/Gemfile.lock +1 -4
- data/docker-compose.yml +12 -0
- data/ext/duckdb/extconf.rb +2 -5
- data/ext/duckdb/prepared_statement.c +2 -2
- data/ext/duckdb/result.c +1 -1
- data/ext/duckdb/ruby-duckdb.h +4 -4
- data/getduckdb.sh +10 -0
- data/lib/duckdb/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 469588c48fb9f9d16254cd6f78f3fd4ceb1e6886e3fc859a507d635542ba50fa
|
4
|
+
data.tar.gz: 1ccee32eb696806c13da87d5c8825965575575e83c45e466712a69bfa107547e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd03d8e45cb57530924a62c94e02df312b6d93624c303a1f05fb1a886b9c92aaae208feaa4419774dc325ba4078c3d90b281819dbc695f0d5a37139c787a481
|
7
|
+
data.tar.gz: 6096e668ea12bd32950cea838844537ea3ed872398d944e88473f4efc9f9088320dc8f565cd62e9c48522596062a2034d3c89456afc4b2952df42d57492b0b2a
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTION.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# Contribution Guide
|
2
2
|
|
3
|
+
## Environment setup
|
4
|
+
|
5
|
+
### With docker
|
6
|
+
|
7
|
+
1. Fork the repository and `git clone` to your local machine.
|
8
|
+
2. Build and access to docker container
|
9
|
+
|
10
|
+
```
|
11
|
+
docker-compose build ubuntu
|
12
|
+
docker-compose run --rm ubuntu bash
|
13
|
+
```
|
14
|
+
|
15
|
+
In case you want custom ruby or duckdb versions, use `--build-arg` options
|
16
|
+
```
|
17
|
+
docker-compose build ubuntu --build-arg RUBY_VERSION=3.1.3 --build-arg DUCKDB_VERSION=0.6.0
|
18
|
+
```
|
19
|
+
|
20
|
+
### Without docker
|
21
|
+
|
22
|
+
1. Install [Ruby](https://www.ruby-lang.org/) into your local machine.
|
23
|
+
2. Install [duckdb](https://duckdb.org/) into your local machine.
|
24
|
+
3. Fork the repository and `git clone` to your local machine.
|
25
|
+
4. Run `bundle install`
|
26
|
+
5. Run `rake build`
|
27
|
+
or you might run with C duckdb header and library directories:
|
28
|
+
`rake build -- --with-duckdb-include=/duckdb_header_directory --with-duckdb-lib=/duckdb_library_directory`
|
29
|
+
|
30
|
+
|
3
31
|
## Issue
|
4
32
|
|
5
33
|
If you spot a problem, [search if an issue already exists](https://github.com/suketa/ruby-duckdb/issues).
|
@@ -8,17 +36,10 @@ If a related issue doesn't exist, you can open a [new issue](https://github.com/
|
|
8
36
|
|
9
37
|
## Fix Issues or Add New Features.
|
10
38
|
|
11
|
-
1.
|
12
|
-
2.
|
13
|
-
3.
|
14
|
-
4.
|
15
|
-
5.
|
16
|
-
|
17
|
-
|
18
|
-
6. run `rake test`
|
19
|
-
7. create new branch to change the code.
|
20
|
-
8. change the code.
|
21
|
-
9. write test.
|
22
|
-
10. run `rake test` and confirm all tests pass.
|
23
|
-
11. git push.
|
24
|
-
12. create PR.
|
39
|
+
1. Run `rake test`
|
40
|
+
2. Create new branch to change the code.
|
41
|
+
3. Change the code.
|
42
|
+
4. Write test.
|
43
|
+
5. Run `rake test` and confirm all tests pass.
|
44
|
+
6. Git push.
|
45
|
+
7. Create PR.
|
data/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
ARG RUBY_VERSION=3.2.1
|
2
|
+
FROM ruby:${RUBY_VERSION}
|
3
|
+
|
4
|
+
ARG DUCKDB_VERSION=0.7.1
|
5
|
+
|
6
|
+
RUN apt update -qq && \
|
7
|
+
apt install -y build-essential curl git wget
|
8
|
+
|
9
|
+
COPY getduckdb.sh .
|
10
|
+
RUN ./getduckdb.sh
|
11
|
+
|
12
|
+
RUN unzip duckdb.zip -d libduckdb
|
13
|
+
RUN mv libduckdb/duckdb.* /usr/local/include
|
14
|
+
RUN mv libduckdb/libduckdb.so /usr/local/lib
|
15
|
+
RUN ldconfig /usr/local/lib
|
16
|
+
|
17
|
+
COPY . /root/ruby-duckdb
|
18
|
+
WORKDIR /root/ruby-duckdb
|
19
|
+
RUN git config --global --add safe.directory /root/ruby-duckdb
|
20
|
+
RUN bundle install
|
21
|
+
RUN rake build
|
data/Gemfile.lock
CHANGED
data/docker-compose.yml
ADDED
data/ext/duckdb/extconf.rb
CHANGED
@@ -22,13 +22,10 @@ dir_config('duckdb')
|
|
22
22
|
|
23
23
|
check_duckdb_library('duckdb_pending_prepared', '0.5.0')
|
24
24
|
|
25
|
-
# check duckdb >= 0.3.3
|
26
|
-
# ducdb >= 0.3.3 if duckdb_append_data_chunk() is defined.
|
27
|
-
have_func('duckdb_append_data_chunk', 'duckdb.h')
|
28
|
-
|
29
25
|
# check duckdb >= 0.6.0
|
30
26
|
have_func('duckdb_value_string', 'duckdb.h')
|
31
27
|
|
32
|
-
|
28
|
+
# check duckdb >= 0.7.0
|
29
|
+
have_func('duckdb_extract_statements', 'duckdb.h')
|
33
30
|
|
34
31
|
create_makefile('duckdb/duckdb_native')
|
@@ -68,7 +68,7 @@ static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE q
|
|
68
68
|
static VALUE duckdb_prepared_statement_nparams(VALUE self) {
|
69
69
|
rubyDuckDBPreparedStatement *ctx;
|
70
70
|
TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
|
71
|
-
return
|
71
|
+
return ULL2NUM(duckdb_nparams(ctx->prepared_statement));
|
72
72
|
}
|
73
73
|
|
74
74
|
|
@@ -86,7 +86,7 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
|
|
86
86
|
}
|
87
87
|
|
88
88
|
static idx_t check_index(VALUE vidx) {
|
89
|
-
idx_t idx =
|
89
|
+
idx_t idx = NUM2ULL(vidx);
|
90
90
|
if (idx <= 0) {
|
91
91
|
rb_raise(rb_eArgError, "index of parameter must be greater than 0");
|
92
92
|
}
|
data/ext/duckdb/result.c
CHANGED
@@ -87,7 +87,7 @@ static VALUE to_ruby_obj_integer(duckdb_result *result, idx_t col_idx, idx_t row
|
|
87
87
|
|
88
88
|
static VALUE to_ruby_obj_bigint(duckdb_result *result, idx_t col_idx, idx_t row_idx) {
|
89
89
|
int64_t i64val = duckdb_value_int64(result, col_idx, row_idx);
|
90
|
-
return
|
90
|
+
return LL2NUM(i64val);
|
91
91
|
}
|
92
92
|
|
93
93
|
static VALUE to_ruby_obj_hugeint(duckdb_result *result, idx_t col_idx, idx_t row_idx) {
|
data/ext/duckdb/ruby-duckdb.h
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
#include "ruby.h"
|
5
5
|
#include <duckdb.h>
|
6
6
|
|
7
|
-
#ifdef HAVE_DUCKDB_APPEND_DATA_CHUNK
|
8
|
-
#define HAVE_DUCKDB_H_GE_V033 1
|
9
|
-
#endif
|
10
|
-
|
11
7
|
#ifdef HAVE_DUCKDB_VALUE_STRING
|
12
8
|
#define HAVE_DUCKDB_H_GE_V060 1
|
13
9
|
#endif
|
14
10
|
|
11
|
+
#ifdef HAVE_DUCKDB_EXTRACT_STATEMENTS
|
12
|
+
#define HAVE_DUCKDB_H_GE_V070 1
|
13
|
+
#endif
|
14
|
+
|
15
15
|
#include "./error.h"
|
16
16
|
#include "./database.h"
|
17
17
|
#include "./connection.h"
|
data/getduckdb.sh
ADDED
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Suketa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- ".gitignore"
|
82
82
|
- CHANGELOG.md
|
83
83
|
- CONTRIBUTION.md
|
84
|
+
- Dockerfile
|
84
85
|
- Gemfile
|
85
86
|
- Gemfile.lock
|
86
87
|
- LICENSE
|
@@ -88,6 +89,7 @@ files:
|
|
88
89
|
- Rakefile
|
89
90
|
- bin/console
|
90
91
|
- bin/setup
|
92
|
+
- docker-compose.yml
|
91
93
|
- duckdb.gemspec
|
92
94
|
- ext/duckdb/appender.c
|
93
95
|
- ext/duckdb/appender.h
|
@@ -112,6 +114,7 @@ files:
|
|
112
114
|
- ext/duckdb/ruby-duckdb.h
|
113
115
|
- ext/duckdb/util.c
|
114
116
|
- ext/duckdb/util.h
|
117
|
+
- getduckdb.sh
|
115
118
|
- lib/duckdb.rb
|
116
119
|
- lib/duckdb/appender.rb
|
117
120
|
- lib/duckdb/column.rb
|