duckdb 1.1.1.0 → 1.1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84935b6317fa4bef4b62197645f061b179e3358e93cba3b976672eb1988715fc
4
- data.tar.gz: 7ff6b2f4b46ea16bcfa2e7de486e9a5bb30aa7d4dccb14e32af7b9886d6fcac4
3
+ metadata.gz: 7b6ad88562489a943d5ed0a4fcf56c4f84c9c3aa1a9f28d6d1fc6431c3fcea0b
4
+ data.tar.gz: ac3047cf0098642db942d3547d1e8069fdb53ac0c8eb7f757a0f15c31465b895
5
5
  SHA512:
6
- metadata.gz: d90dbdbf57d5cc282049f6297d00674ff57d9fafbfd7bfab8db8c87fb1153d3c9ea93ceda3b440d066c24ceef5dd1e349dedea6f4b17557bda590bb92f93fc5a
7
- data.tar.gz: cbcbd5c50c6ddc92c01001b36cbe5aad8a87729ea5518a881dcf8c21621679d1c3740c0ed97672d597aca351ea09548d6f7b5e722fde32077cb811a57c3dfd40
6
+ metadata.gz: 5614558f8685681f3369dfb4d8e36ead416b7ba1e4b0de48ff5edcc375a99c43bc1c3d996eca1f083d2df0352ced146f1e6d23bff99fa193035c9f996674e63d
7
+ data.tar.gz: 2ace009816b0dfee961d8db1b0864e512239186ebf7b8b0ffe20a360e0a247a68afd11c4b97993e350f7b2a7f8eb29d4b4b3fcb367b31c575a6163d1d9d333c6
@@ -15,8 +15,8 @@ jobs:
15
15
  runs-on: macos-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: ['3.1.6', '3.2.5', '3.3.5', '3.4.0-preview1', 'head']
19
- duckdb: ['1.1.1', '1.1.0', '1.0.0']
18
+ ruby: ['3.1.6', '3.2.5', '3.3.5', '3.4.0-preview2', 'head']
19
+ duckdb: ['1.1.2', '1.1.1', '1.0.0']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v4
@@ -15,8 +15,8 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: ['3.1.6', '3.2.5', '3.3.5', '3.4.0-preview1', 'head']
19
- duckdb: ['1.1.1', '1.1.0', '1.0.0']
18
+ ruby: ['3.1.6', '3.2.5', '3.3.5', '3.4.0-preview2', 'head']
19
+ duckdb: ['1.1.2', '1.1.1', '1.0.0']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v4
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  ruby: ['3.1.6', '3.2.5', '3.3.5', 'ucrt', 'mingw', 'mswin', 'head']
19
- duckdb: ['1.1.1', '1.1.0', '1.0.0']
19
+ duckdb: ['1.1.2', '1.1.1', '1.0.0']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v4
data/.gitignore CHANGED
@@ -15,3 +15,4 @@
15
15
  *.obj
16
16
  *.so
17
17
  Makefile
18
+ ng_test
data/CHANGELOG.md CHANGED
@@ -3,8 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  # Unreleased
5
5
 
6
+ # 1.1.2.0 - 2024-10-20
7
+ - bump duckdb to 1.1.2.
8
+ - add `DuckDB::PreparedStatement#destroy`.
9
+ - `DuckDB::Connection#query`, `DuckDB::Connection#async_query`, `DuckDB::Connection#async_query_stream` call
10
+ `DuckDB::PreparedStatement#destroy` to free the prepared statement immediately (#775, #781).
11
+
6
12
  # 1.1.1.0 - 2024-10-06
7
- - bump duckdb 1.1.1.
13
+ - bump duckdb to 1.1.1.
8
14
  ## Breaking changes
9
15
  - drop duckdb v0.10.x.
10
16
 
data/CONTRIBUTION.md CHANGED
@@ -14,7 +14,7 @@ docker compose run --rm ubuntu bash
14
14
 
15
15
  In case you want custom ruby or duckdb versions, use `--build-arg` options
16
16
  ```
17
- docker-compose build ubuntu --build-arg RUBY_VERSION=3.1.3 --build-arg DUCKDB_VERSION=0.6.0
17
+ docker compose build ubuntu --build-arg RUBY_VERSION=3.1.3 --build-arg DUCKDB_VERSION=1.0.0
18
18
  ```
19
19
 
20
20
  ### Without docker
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  ARG RUBY_VERSION=3.3.5
2
2
  FROM ruby:${RUBY_VERSION}
3
3
 
4
- ARG DUCKDB_VERSION=1.1.1
4
+ ARG DUCKDB_VERSION=1.1.2
5
5
 
6
6
  RUN apt update -qq && \
7
7
  apt install -y build-essential curl git wget
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in duckdb.gemspec
4
4
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- duckdb (1.1.1.0)
4
+ duckdb (1.1.2.0)
5
5
  bigdecimal (>= 3.1.4)
6
6
 
7
7
  GEM
@@ -2,12 +2,14 @@
2
2
 
3
3
  VALUE cDuckDBPreparedStatement;
4
4
 
5
+ static void destroy_prepared_statement(rubyDuckDBPreparedStatement *p);
5
6
  static void deallocate(void *ctx);
6
7
  static VALUE allocate(VALUE klass);
7
8
  static size_t memsize(const void *p);
8
9
  static VALUE duckdb_prepared_statement_initialize(VALUE self, VALUE con, VALUE query);
9
10
  static VALUE duckdb_prepared_statement_nparams(VALUE self);
10
11
  static VALUE duckdb_prepared_statement_execute(VALUE self);
12
+ static VALUE duckdb_prepared_statement_destroy(VALUE self);
11
13
  static idx_t check_index(VALUE vidx);
12
14
 
13
15
  static VALUE duckdb_prepared_statement_bind_parameter_index(VALUE self, VALUE name);
@@ -37,10 +39,17 @@ static const rb_data_type_t prepared_statement_data_type = {
37
39
  0, 0, RUBY_TYPED_FREE_IMMEDIATELY
38
40
  };
39
41
 
42
+ static void destroy_prepared_statement(rubyDuckDBPreparedStatement *p) {
43
+ if (p->prepared_statement) {
44
+ duckdb_destroy_prepare(&(p->prepared_statement));
45
+ }
46
+ }
47
+
40
48
  static void deallocate(void *ctx) {
41
49
  rubyDuckDBPreparedStatement *p = (rubyDuckDBPreparedStatement *)ctx;
42
50
 
43
- duckdb_destroy_prepare(&(p->prepared_statement));
51
+ destroy_prepared_statement(p);
52
+ // duckdb_destroy_prepare(&(p->prepared_statement));
44
53
  xfree(p);
45
54
  }
46
55
 
@@ -91,7 +100,6 @@ static VALUE duckdb_prepared_statement_nparams(VALUE self) {
91
100
  return ULL2NUM(duckdb_nparams(ctx->prepared_statement));
92
101
  }
93
102
 
94
-
95
103
  static VALUE duckdb_prepared_statement_execute(VALUE self) {
96
104
  rubyDuckDBPreparedStatement *ctx;
97
105
  rubyDuckDBResult *ctxr;
@@ -105,6 +113,19 @@ static VALUE duckdb_prepared_statement_execute(VALUE self) {
105
113
  return result;
106
114
  }
107
115
 
116
+ /*
117
+ * :nodoc:
118
+ */
119
+ static VALUE duckdb_prepared_statement_destroy(VALUE self) {
120
+ rubyDuckDBPreparedStatement *ctx;
121
+ TypedData_Get_Struct(self, rubyDuckDBPreparedStatement, &prepared_statement_data_type, ctx);
122
+ destroy_prepared_statement(ctx);
123
+ /*
124
+ ctx->prepared_statement = NULL;
125
+ */
126
+ return Qnil;
127
+ }
128
+
108
129
  static idx_t check_index(VALUE vidx) {
109
130
  idx_t idx = NUM2ULL(vidx);
110
131
  if (idx <= 0) {
@@ -391,6 +412,7 @@ void rbduckdb_init_duckdb_prepared_statement(void) {
391
412
 
392
413
  rb_define_method(cDuckDBPreparedStatement, "initialize", duckdb_prepared_statement_initialize, 2);
393
414
  rb_define_method(cDuckDBPreparedStatement, "execute", duckdb_prepared_statement_execute, 0);
415
+ rb_define_method(cDuckDBPreparedStatement, "destroy", duckdb_prepared_statement_destroy, 0);
394
416
  rb_define_method(cDuckDBPreparedStatement, "nparams", duckdb_prepared_statement_nparams, 0);
395
417
  rb_define_method(cDuckDBPreparedStatement, "bind_parameter_index", duckdb_prepared_statement_bind_parameter_index, 1);
396
418
  rb_define_method(cDuckDBPreparedStatement, "parameter_name", duckdb_prepared_statement_parameter_name, 1);
@@ -31,6 +31,8 @@ module DuckDB
31
31
  stmt = PreparedStatement.new(self, sql)
32
32
  stmt.bind_args(*args, **kwargs)
33
33
  stmt.execute
34
+ ensure
35
+ stmt&.destroy
34
36
  end
35
37
 
36
38
  #
@@ -53,6 +55,8 @@ module DuckDB
53
55
  stmt = PreparedStatement.new(self, sql)
54
56
  stmt.bind_args(*args, **kwargs)
55
57
  stmt.pending_prepared
58
+ ensure
59
+ stmt&.destroy
56
60
  end
57
61
 
58
62
  #
@@ -76,6 +80,8 @@ module DuckDB
76
80
  stmt = PreparedStatement.new(self, sql)
77
81
  stmt.bind_args(*args, **kwargs)
78
82
  stmt.pending_prepared_stream
83
+ ensure
84
+ stmt&.destroy
79
85
  end
80
86
 
81
87
  #
@@ -3,5 +3,5 @@
3
3
  module DuckDB
4
4
  # The version string of ruby-duckdb.
5
5
  # Currently, ruby-duckdb is NOT semantic versioning.
6
- VERSION = '1.1.1.0'
6
+ VERSION = '1.1.2.0'
7
7
  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: 1.1.1.0
4
+ version: 1.1.2.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: 2024-10-06 00:00:00.000000000 Z
11
+ date: 2024-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal