duckdb 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4780513bea94513e38b460cf9580b9bad9b9128d913a46f58f2054451cf838d
4
- data.tar.gz: 5cbfe5da32da9562d121d634a7a45fdc153222bb4c5b8c79a2f37dbff6f57f27
3
+ metadata.gz: 469588c48fb9f9d16254cd6f78f3fd4ceb1e6886e3fc859a507d635542ba50fa
4
+ data.tar.gz: 1ccee32eb696806c13da87d5c8825965575575e83c45e466712a69bfa107547e
5
5
  SHA512:
6
- metadata.gz: 04acc6297bac9ae7d217072d1fec3b7c603f407270143d654f738462e0f540a2e8ebdb67fa4d466ff13636dab279a0d245241201c9b3f829f4e97fbf628fb086
7
- data.tar.gz: aa200fce49d05edee27095771e4c7e394a7431b8b1881e58d053f46dafc628920e4924c899159619c2fd337c6607eeed55f5863ea0e119f13ec2236d72c33f6b
6
+ metadata.gz: ebd03d8e45cb57530924a62c94e02df312b6d93624c303a1f05fb1a886b9c92aaae208feaa4419774dc325ba4078c3d90b281819dbc695f0d5a37139c787a481
7
+ data.tar.gz: 6096e668ea12bd32950cea838844537ea3ed872398d944e88473f4efc9f9088320dc8f565cd62e9c48522596062a2034d3c89456afc4b2952df42d57492b0b2a
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['2.7.7', '3.0.5', '3.1.3', '3.2.1', 'head']
19
- duckdb: ['0.7.0', '0.6.1']
19
+ duckdb: ['0.7.1', '0.6.1']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v3
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['2.7.7', '3.0.5', '3.1.3', '3.2.1', 'head']
19
- duckdb: ['0.7.0', '0.6.1']
19
+ duckdb: ['0.7.1', '0.6.1']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v3
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['2.7.7', '3.0.5', '3.1.3', '3.2.1', 'ucrt', 'mingw', 'mswin', 'head']
19
- duckdb: ['0.7.0', '0.6.1']
19
+ duckdb: ['0.7.1', '0.6.1']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # ChangeLog
2
2
 
3
+ - bump duckdb to 0.7.1
4
+ - fix docker build error on M1 Mac
5
+
3
6
  # 0.7.0
4
7
  - bump duckdb to 0.7.0
5
8
  - fix have_func argument order
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. install [Ruby](https://www.ruby-lang.org/) into your local machine.
12
- 2. install [duckdb](https://duckdb.org/) into your local machine.
13
- 3. fork the repository and `git clone` to your local machine.
14
- 4. run `bundle install`
15
- 5. run `rake build`
16
- or you might run with C duckdb header and library directories:
17
- `rake build -- --with-duckdb-include=/duckdb_header_directory --with-duckdb-lib=/duckdb_library_directory`
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (0.7.0)
4
+ duckdb (0.7.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,6 +21,3 @@ DEPENDENCIES
21
21
  minitest (~> 5.0)
22
22
  rake (~> 13.0)
23
23
  rake-compiler
24
-
25
- BUNDLED WITH
26
- 2.3.22
@@ -0,0 +1,12 @@
1
+ version: '3'
2
+ services:
3
+ ubuntu:
4
+ build:
5
+ context: .
6
+ dockerfile: ./Dockerfile
7
+ args:
8
+ - RUBY_VERSION
9
+ - DUCKDB_VERSION
10
+ working_dir: /root/ruby-duckdb
11
+ volumes:
12
+ - .:/root/ruby-duckdb
@@ -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
- have_func('duckdb_free', 'duckdb.h')
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 rb_int2big(duckdb_nparams(ctx->prepared_statement));
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 = FIX2INT(vidx);
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 rb_int2big(i64val);
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) {
@@ -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
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+
3
+ MACHINE=`uname -m`
4
+
5
+ case "$MACHINE" in
6
+ "x86_64" ) ARC=amd64 ;;
7
+ "aarch64" ) ARC=aarch64 ;;
8
+ esac
9
+
10
+ wget -O duckdb.zip "https://github.com/duckdb/duckdb/releases/download/v$DUCKDB_VERSION/libduckdb-linux-$ARC.zip"
@@ -1,5 +1,5 @@
1
1
  module DuckDB
2
2
  # The version string of ruby-duckdb.
3
3
  # Currently, ruby-duckdb is NOT semantic versioning.
4
- VERSION = '0.7.0'.freeze
4
+ VERSION = '0.7.1'.freeze
5
5
  end
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.0
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-02-18 00:00:00.000000000 Z
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