duckdb 0.2.6.1 → 0.2.7.0

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: 1e40641b43de4613a5417e6f06fb50e23277394f4ba54aadc524afa319e15dbb
4
- data.tar.gz: a5c578bb6fd9dee33ca0ab5af5d853e623fefec7fc9b74a43b4d6432cdec6fb5
3
+ metadata.gz: 309d9f5ae00645a93cd5bf8bd706f12391e1386336516d172e1963b963df5ab4
4
+ data.tar.gz: 8814748ae38a1b501d21b69f47b262124771ddc382dfcdbba3d7b3b88b3cb691
5
5
  SHA512:
6
- metadata.gz: 2db7f176dc767856e43a2f8e4991c0bd6229f4174e2c1e91595436f36320f4f2b2eb1db52186644641b0ed45e38798a2bf76688e398abe27d4c3b81eda780939
7
- data.tar.gz: 0343b460f0f62393ecd6e550ce468fa28c0098ce236a87968ad2bc8eb2f4764e87448c7df80f328e39b1f07da1acef6e5a931dfafe91af222dc201ef41812f36
6
+ metadata.gz: 96d87f3dfa1e8366e98a0a93e1f6506508c885131eb4287ec2463eea8040fb1cc87436a10871cecb83b524d97173443d9b1c42330a5f311c210ffb921b64a7d9
7
+ data.tar.gz: fed84bbde6a9c6b696e9a52bf769810788b7b49d845ddca065cafcfc535540d62127d395524ca4fee86cfba9213c82fe74204063ea674d14498d7f82f0c34e33
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  matrix:
11
11
  ruby: ['2.5.8', '2.6.7', '2.7.3', '3.0.1', 'head']
12
- duckdb: ['0.2.6', '0.2.5']
12
+ duckdb: ['0.2.6', '0.2.7']
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
@@ -28,14 +28,14 @@ jobs:
28
28
  restore-keys: |
29
29
  ${{ runner.os }}-duckdb-v0_2_6
30
30
 
31
- - name: duckdb 0.2.5 cache
32
- id: duckdb-cache-v0_2_5
31
+ - name: duckdb 0.2.7 cache
32
+ id: duckdb-cache-v0_2_7
33
33
  uses: actions/cache@v1.1.0
34
34
  with:
35
- path: duckdb-v0.2.5
36
- key: ${{ runner.os }}-duckdb-v0_2_5_001
35
+ path: duckdb-v0.2.7
36
+ key: ${{ runner.os }}-duckdb-v0_2_7_001
37
37
  restore-keys: |
38
- ${{ runner.os }}-duckdb-v0_2_5
38
+ ${{ runner.os }}-duckdb-v0_2_7
39
39
 
40
40
  - name: Build duckdb 0.2.6
41
41
  if: steps.duckdb-cache-v0_2_6.outputs.cache-hit != 'true'
@@ -47,15 +47,15 @@ jobs:
47
47
  cp -rip duckdb-tmp-v0.2.6/build/release/src/*.so duckdb-v0.2.6/build/release/src
48
48
  cp -rip duckdb-tmp-v0.2.6/src/include duckdb-v0.2.6/src/
49
49
 
50
- - name: Build duckdb 0.2.5
51
- if: steps.duckdb-cache-v0_2_5.outputs.cache-hit != 'true'
50
+ - name: Build duckdb 0.2.7
51
+ if: steps.duckdb-cache-v0_2_7.outputs.cache-hit != 'true'
52
52
  run: |
53
- git clone -b v0.2.5 https://github.com/cwida/duckdb.git duckdb-tmp-v0.2.5
54
- cd duckdb-tmp-v0.2.5 && make && cd ..
55
- rm -rf duckdb-v0.2.5
56
- mkdir -p duckdb-v0.2.5/build/release/src duckdb-v0.2.5/src
57
- cp -rip duckdb-tmp-v0.2.5/build/release/src/*.so duckdb-v0.2.5/build/release/src
58
- cp -rip duckdb-tmp-v0.2.5/src/include duckdb-v0.2.5/src/
53
+ git clone -b v0.2.7 https://github.com/cwida/duckdb.git duckdb-tmp-v0.2.7
54
+ cd duckdb-tmp-v0.2.7 && make && cd ..
55
+ rm -rf duckdb-v0.2.7
56
+ mkdir -p duckdb-v0.2.7/build/release/src duckdb-v0.2.7/src
57
+ cp -rip duckdb-tmp-v0.2.7/build/release/src/*.so duckdb-v0.2.7/build/release/src
58
+ cp -rip duckdb-tmp-v0.2.7/src/include duckdb-v0.2.7/src/
59
59
 
60
60
  - name: Build and test with Rake with Ruby ${{ matrix.ruby }}
61
61
  env:
@@ -0,0 +1,37 @@
1
+ name: Windows
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: windows-latest
8
+ strategy:
9
+ matrix:
10
+ ruby: ['2.5.8', '2.6.7', '2.7.3', '3.0.1', 'head']
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+
20
+ - name: download duckdb binary for windows 64bit
21
+ run: |
22
+ curl -OL https://github.com/duckdb/duckdb/releases/download/v0.2.6/libduckdb-windows-amd64.zip
23
+
24
+ - name: extract zip file
25
+ run: |
26
+ 7z x libduckdb-windows-amd64.zip
27
+
28
+ - name: Build with Rake with Ruby ${{ matrix.ruby }}
29
+ run: |
30
+ bundle install
31
+ bundle exec rake build -- --with-duckdb-include=../../../.. --with-duckdb-lib=../../../..
32
+
33
+ # FIXME: rake test fails with LoadError
34
+ # C:/hostedtoolcache/windows/Ruby/2.7.3/x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': 126: The specified module could not be found. - D:/a/ruby-duckdb/ruby-duckdb/lib/duckdb/duckdb_native.so (LoadError)`
35
+ # - name: rake test
36
+ # run: |
37
+ # rake test
data/.travis.yml CHANGED
@@ -2,13 +2,13 @@ language: ruby
2
2
  cache:
3
3
  bundler: true
4
4
  directories:
5
- - ${HOME}/duckdb-v0.2.6
5
+ - ${HOME}/duckdb-v0.2.7
6
6
  before_install:
7
7
  - yes | gem update --system
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
8
+ - if [[ ! -d ${HOME}/duckdb-v0.2.7/build ]]; then cd ${HOME} && git clone -b v0.2.7 https://github.com/cwida/duckdb.git duckdb-v0.2.7 && cd duckdb-v0.2.7 && make && cd ${TRAVIS_BUILD_DIR}; fi
9
9
 
10
10
  env:
11
- - DUCKDB_VERSION=0.2.6
11
+ - DUCKDB_VERSION=0.2.7
12
12
  rvm:
13
13
  - 2.5.8
14
14
  - 2.6.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # ChangeLog
2
2
 
3
+ # 0.2.7.0
4
+
5
+ - call duckdb_free after calling duckdb_value_blob, duckdb_value_varchar.
6
+ - bump DuckDB to v0.2.7 in CI
7
+ - rake build on Windows in github actions.
8
+ - There is a issue (LoadError) when running rake test on Windows (in GitHub actions).
9
+
3
10
  # 0.2.6.1
4
11
 
5
12
  - add DuckDB::PreparedStatement#bind_int8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (0.2.6.1)
4
+ duckdb (0.2.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -103,8 +103,6 @@ def insert
103
103
  10000.times do
104
104
  con.query("INSERT into users VALUES(1, 'Alice')")
105
105
  end
106
- # r = con.query('SELECT count(*) from users')
107
- # p r.each.first
108
106
  end
109
107
  end
110
108
  end
@@ -135,8 +133,6 @@ def append
135
133
  appender.end_row
136
134
  end
137
135
  appender.flush
138
- # r = con.query('SELECT count(*) from users')
139
- # p r.each.first
140
136
  end
141
137
  end
142
138
  end
@@ -5,5 +5,6 @@ if have_library('duckdb')
5
5
  have_func('duckdb_value_blob', 'duckdb.h')
6
6
  have_func('duckdb_bind_blob', 'duckdb.h')
7
7
  have_func('duckdb_appender_create', 'duckdb.h')
8
+ have_func('duckdb_free', 'duckdb.h')
8
9
  create_makefile('duckdb/duckdb_native')
9
10
  end
data/ext/duckdb/result.c CHANGED
@@ -55,8 +55,19 @@ static VALUE to_ruby_obj_double(duckdb_result *result, idx_t col_idx, idx_t row_
55
55
  #ifdef HAVE_DUCKDB_VALUE_BLOB
56
56
  static VALUE to_ruby_obj_string_from_blob(duckdb_result *result, idx_t col_idx, idx_t row_idx)
57
57
  {
58
+ VALUE str;
58
59
  duckdb_blob bval = duckdb_value_blob(result, col_idx, row_idx);
59
- return rb_str_new(bval.data, bval.size);
60
+ str = rb_str_new(bval.data, bval.size);
61
+
62
+ if (bval.data) {
63
+ #ifdef HAVE_DUCKDB_FREE
64
+ duckdb_free(bval.data);
65
+ #else
66
+ free(bval.data);
67
+ #endif
68
+ }
69
+
70
+ return str;
60
71
  }
61
72
  #endif /* HAVE_DUCKDB_VALUE_BLOB */
62
73
 
@@ -86,10 +97,16 @@ static VALUE to_ruby_obj(duckdb_result *result, idx_t col_idx, idx_t row_idx)
86
97
  #endif /* HAVE_DUCKDB_VALUE_BLOB */
87
98
  default:
88
99
  p = duckdb_value_varchar(result, col_idx, row_idx);
89
- obj = rb_str_new2(p);
90
- free(p);
91
- if (result->columns[col_idx].type == DUCKDB_TYPE_HUGEINT) {
92
- obj = rb_funcall(obj, rb_intern("to_i"), 0);
100
+ if (p) {
101
+ obj = rb_str_new2(p);
102
+ #ifdef HAVE_DUCKDB_FREE
103
+ duckdb_free(p);
104
+ #else
105
+ free(p);
106
+ #endif /* HAVE_DUCKDB_FREE */
107
+ if (result->columns[col_idx].type == DUCKDB_TYPE_HUGEINT) {
108
+ obj = rb_funcall(obj, rb_intern("to_i"), 0);
109
+ }
93
110
  }
94
111
  }
95
112
  return obj;
@@ -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.2.6.1'.freeze
4
+ VERSION = '0.2.7.0'.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.2.6.1
4
+ version: 0.2.7.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-06-14 00:00:00.000000000 Z
11
+ date: 2021-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,6 +77,7 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - ".github/workflows/test_on_macos.yml"
79
79
  - ".github/workflows/test_on_ubuntu.yml"
80
+ - ".github/workflows/test_on_windows.yml"
80
81
  - ".gitignore"
81
82
  - ".travis.yml"
82
83
  - CHANGELOG.md