duckdb 1.5.1.1 → 1.5.2.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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/README.md +18 -0
  4. data/duckdb.gemspec +16 -12
  5. data/ext/duckdb/aggregate_function.c +752 -0
  6. data/ext/duckdb/aggregate_function.h +18 -0
  7. data/ext/duckdb/appender.c +99 -31
  8. data/ext/duckdb/appender.h +1 -1
  9. data/ext/duckdb/client_context.c +5 -5
  10. data/ext/duckdb/client_context.h +2 -2
  11. data/ext/duckdb/column.c +13 -13
  12. data/ext/duckdb/column.h +1 -1
  13. data/ext/duckdb/connection.c +76 -31
  14. data/ext/duckdb/connection.h +2 -2
  15. data/ext/duckdb/converter.h +5 -9
  16. data/ext/duckdb/conveter.c +151 -18
  17. data/ext/duckdb/data_chunk.c +84 -15
  18. data/ext/duckdb/data_chunk.h +3 -2
  19. data/ext/duckdb/database.c +12 -56
  20. data/ext/duckdb/database.h +1 -1
  21. data/ext/duckdb/duckdb.c +20 -16
  22. data/ext/duckdb/expression.c +8 -8
  23. data/ext/duckdb/expression.h +1 -1
  24. data/ext/duckdb/extconf.rb +3 -4
  25. data/ext/duckdb/extracted_statements.c +16 -16
  26. data/ext/duckdb/extracted_statements.h +1 -1
  27. data/ext/duckdb/function_executor.c +261 -0
  28. data/ext/duckdb/function_executor.h +46 -0
  29. data/ext/duckdb/function_vector.c +207 -0
  30. data/ext/duckdb/function_vector.h +27 -0
  31. data/ext/duckdb/instance_cache.c +10 -10
  32. data/ext/duckdb/instance_cache.h +1 -1
  33. data/ext/duckdb/logical_type.c +94 -133
  34. data/ext/duckdb/logical_type.h +2 -2
  35. data/ext/duckdb/memory_helper.c +28 -28
  36. data/ext/duckdb/pending_result.c +27 -27
  37. data/ext/duckdb/pending_result.h +2 -2
  38. data/ext/duckdb/prepared_statement.c +116 -99
  39. data/ext/duckdb/prepared_statement.h +2 -2
  40. data/ext/duckdb/result.c +41 -33
  41. data/ext/duckdb/result.h +2 -3
  42. data/ext/duckdb/ruby-duckdb.h +12 -3
  43. data/ext/duckdb/scalar_function.c +56 -452
  44. data/ext/duckdb/table_description.c +144 -0
  45. data/ext/duckdb/table_description.h +16 -0
  46. data/ext/duckdb/table_function.c +81 -44
  47. data/ext/duckdb/table_function_bind_info.c +1 -1
  48. data/ext/duckdb/value.c +291 -0
  49. data/ext/duckdb/value.h +15 -0
  50. data/ext/duckdb/vector.c +20 -20
  51. data/ext/duckdb/vector.h +2 -2
  52. data/lib/duckdb/aggregate_function.rb +246 -0
  53. data/lib/duckdb/appender.rb +106 -7
  54. data/lib/duckdb/column_description.rb +32 -0
  55. data/lib/duckdb/connection.rb +56 -16
  56. data/lib/duckdb/converter.rb +30 -14
  57. data/lib/duckdb/data_chunk.rb +46 -31
  58. data/lib/duckdb/database.rb +44 -15
  59. data/lib/duckdb/extracted_statements.rb +2 -2
  60. data/lib/duckdb/function_type_validation.rb +50 -0
  61. data/lib/duckdb/interval.rb +15 -9
  62. data/lib/duckdb/logical_type.rb +1 -3
  63. data/lib/duckdb/prepared_statement.rb +19 -5
  64. data/lib/duckdb/scalar_function.rb +10 -49
  65. data/lib/duckdb/table_description.rb +79 -0
  66. data/lib/duckdb/table_function.rb +0 -1
  67. data/lib/duckdb/value.rb +267 -0
  68. data/lib/duckdb/version.rb +1 -1
  69. data/lib/duckdb.rb +5 -0
  70. metadata +21 -31
  71. data/.gitattributes +0 -1
  72. data/.github/FUNDING.yml +0 -3
  73. data/.github/copilot-instructions.md +0 -169
  74. data/.github/workflows/linter.yml +0 -30
  75. data/.github/workflows/make_documents.yml +0 -34
  76. data/.github/workflows/test_on_macos.yml +0 -103
  77. data/.github/workflows/test_on_ubuntu.yml +0 -108
  78. data/.github/workflows/test_on_windows.yml +0 -71
  79. data/.gitignore +0 -19
  80. data/.rubocop.yml +0 -34
  81. data/CONTRIBUTION.md +0 -45
  82. data/Dockerfile +0 -22
  83. data/Gemfile +0 -16
  84. data/Gemfile.lock +0 -77
  85. data/benchmark/converter_hugeint_ips.rb +0 -27
  86. data/benchmark/get_converter_module_ips.rb +0 -26
  87. data/benchmark/to_intern_ips.rb +0 -72
  88. data/docker-compose.yml +0 -11
  89. data/ext/duckdb/value_impl.c +0 -138
  90. data/ext/duckdb/value_impl.h +0 -15
  91. data/getduckdb.sh +0 -18
  92. data/sample/async_query.rb +0 -25
  93. data/sample/issue922.rb +0 -54
  94. data/sample/issue922_benchmark.rb +0 -169
  95. data/sample/issue930.rb +0 -49
  96. data/sample/issue930_benchmark.rb +0 -70
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0982b8680fcd79b493773dbbf39fd3f366fe11ccc952a8bfb4be0a140657e8fe'
4
- data.tar.gz: 34cc46de733b8bc215197e5ceab3eb3022b0067ac34376b828ded5106d4b1261
3
+ metadata.gz: 4c7c57e0282ec2213b1efb3844445804e5fbbc09e03496f2ba71c1bd24152843
4
+ data.tar.gz: 9057fa45fafeba0dc2110562f98cd49eecf53ec0f0a48a989756742525c82b4a
5
5
  SHA512:
6
- metadata.gz: 2b3043a60bbb99bd449f709befb3b84d1036d1e0643c9ed3a93eb50e88df48962095caa537f23881bfc9434a035b240230c8d81004b1d863742916baa6540902
7
- data.tar.gz: 34ff46b0100769147684a4092005838ba418ab1907fc5b0690bd37f883007b0004e4838a5fdfd04ca276d157d91d39523aba74eced99133f46a8039d52b3c036
6
+ metadata.gz: 78bbd166f587491085267791ffca949f2b310597f802424b7e0525c8c4f35f345c2362b17b33401bee374601d5f52746d10ac21f60ea8344bd3bf08e28d7f4b5
7
+ data.tar.gz: 6fc88b5e289ef3451691f57cb404c390b9deabbafddf81e8aedd300121276a9df62b0492559f2602eb4aeaa57ed2a83cc98ccfbef3a728771c34a565a022f78a
data/CHANGELOG.md CHANGED
@@ -4,6 +4,53 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  # Unreleased
6
6
 
7
+ # 1.5.2.1 - 2026-04-24
8
+
9
+ - add `DuckDB::AggregateFunction.create`.
10
+ - add `DuckDB::Appender#clear_columns`.
11
+ - add `DuckDB::Appender#add_column`.
12
+ - add `DuckDB::Appender#clear` to discard all unflushed data from the appender without writing it to the table (requires DuckDB >= 1.5.0).
13
+ - add `DuckDB::Value.create_decimal`.
14
+ - fix gemspec to use `git ls-files`, preventing precompiled x86_64 `.so` from being bundled into the gem and breaking non-x86 platforms.
15
+
16
+ # 1.5.2.0 - 2026-04-16
17
+
18
+ - add `DuckDB::DataChunk#reset` to clear a chunk's contents so it can be reused across multiple `Appender#append_data_chunk` calls without reallocation.
19
+ - add `DuckDB::Database.new(path = :memory, config: nil, &block)` to create a database instance. `path` is a positional argument (default `:memory` for in-memory database, or a String path for file database). `config:` accepts an optional `DuckDB::Config` object. When a block is given, the database is yielded and automatically closed afterwards.
20
+ - add `TIME_NS` column support to `DuckDB::Result`. `TIME_NS` values are returned as `Time` objects with nanoseconds truncated to microseconds.
21
+ - add `INTERVAL` as a supported `return_type` for `DuckDB::ScalarFunction`. The scalar function block can now return a `DuckDB::Interval` object and it will be written back to the result vector correctly.
22
+ - add `UUID` as a supported `return_type` for `DuckDB::ScalarFunction`. The scalar function block can now return a UUID string and it will be written back to the result vector correctly.
23
+ - add `DuckDB::Connection#extract` to extract multiple SQL statements as prepared statements without executing them.
24
+ - add `DuckDB::Connection#register_logical_type` to register a custom logical type with a connection.
25
+ - add `DuckDB::PreparedStatement#bind_value`.
26
+ - add `DuckDB::Value.create_bool`.
27
+ - add `DuckDB::Value.create_int8`.
28
+ - add `DuckDB::Value.create_int16`.
29
+ - add `DuckDB::Value.create_int32`.
30
+ - add `DuckDB::Value.create_int64`.
31
+ - add `DuckDB::Value.create_uint8`.
32
+ - add `DuckDB::Value.create_uint16`.
33
+ - add `DuckDB::Value.create_uint32`.
34
+ - add `DuckDB::Value.create_uint64`.
35
+ - add `DuckDB::Value.create_null`.
36
+ - add `DuckDB::Value.create_float`.
37
+ - add `DuckDB::Value.create_double`.
38
+ - add `DuckDB::Value.create_varchar`.
39
+ - add `DuckDB::Value.create_blob`.
40
+ - add `DuckDB::Value.create_hugeint`.
41
+ - add `DuckDB::Value.create_uhugeint`.
42
+ - add `DuckDB::Appender#append_value`.
43
+ - add `DuckDB::Appender#append_data_chunk` to append a `DuckDB::DataChunk` in one call.
44
+ - add `DuckDB::DataChunk.new(types)` to create an owned data chunk from Ruby logical types.
45
+ - add `DuckDB::AggregateFunction`.
46
+ - add `DuckDB::TableDescription` to retrieve metadata about a table (with DuckDB >= 1.5.0).
47
+ - add `DuckDB::ColumnDescription` to describe a column's name, logical type, and whether it has a default value (with DuckDB >= 1.5.0).
48
+
49
+ ## Breaking Changes
50
+ - rename `DuckDB::ValueImpl` to `DuckDB::Value`
51
+ - remove `DuckDB::ExtractedStatementsImpl`. use `DuckDB::ExtractedStatements`
52
+ - `DuckDB::Database.open` to delegate to `DuckDB::Database.new`. The signature changes from `open(dbpath = nil, config = nil)` to `open(path = :memory, config: nil)`. `DuckDB::Database.open` now accepts `:memory` symbol and `config:` keyword argument.
53
+
7
54
  # 1.5.1.1 - 2026-04-04
8
55
 
9
56
  - fix `DuckDB::ScalarFunction` to allow `HUGEINT` and `UHUGEINT` as `return_type` and parameter type (the C extension's vector write path was missing those cases).
data/README.md CHANGED
@@ -265,3 +265,21 @@ res.first.first # => 4
265
265
  #### Global configuration
266
266
 
267
267
  Set `DuckDB.default_timezone` to control how TIMESTAMP and TIME values without time zone are converted to Ruby `Time` objects. The default is `:local`, but you can use `:utc` for UTC conversion.
268
+
269
+ ## Versioning and DuckDB support
270
+
271
+ The first three digits of the gem version track the DuckDB release that the
272
+ gem is aligned with. For example, ruby-duckdb `1.5.1.0` runs with DuckDB
273
+ `1.5.1`.
274
+
275
+ All releases in the same `1.5.1.x` series target DuckDB `1.5.1`. The fourth
276
+ digit is reserved for ruby-duckdb-only releases, such as gem bug fixes or new
277
+ gem features. For example, `1.5.1.1` still targets DuckDB `1.5.1`.
278
+
279
+ We also aim to support the latest release from the previous minor series, so
280
+ the `1.5.1.x` series should also support DuckDB `1.4.x`.
281
+
282
+ In addition, we try to support DuckDB LTS releases whenever practical.
283
+
284
+ This gem aims to support most DuckDB minor releases, but we may occasionally
285
+ skip a minor series.
data/duckdb.gemspec CHANGED
@@ -1,33 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'duckdb/version'
3
+ require_relative 'lib/duckdb/version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'duckdb'
9
7
  spec.version = DuckDB::VERSION
10
8
  spec.authors = ['Masaki Suketa']
11
9
  spec.email = ['masaki.suketa@nifty.ne.jp']
12
-
13
- spec.summary = 'This module is Ruby binding for DuckDB database engine.'
14
- spec.description = 'This module is Ruby binding for DuckDB database engine. ' \
15
- 'You must have the DuckDB engine installed to build/use this module.'
16
10
  spec.homepage = 'https://github.com/suketa/ruby-duckdb'
17
11
  spec.license = 'MIT'
18
12
 
13
+ spec.summary = 'Ruby bindings for the DuckDB database engine.'
14
+ spec.description = <<~TEXT
15
+ This gem provides bindings for DuckDB, which is an in-process SQL database optimized for analytical queries on structured data.
16
+ It's lightweight, embeddable, and works directly with files like Parquet and CSV, making it popular for data analysis tasks.
17
+ TEXT
18
+
19
19
  spec.metadata['rubygems_mfa_required'] = 'true'
20
20
  spec.metadata['homepage_uri'] = spec.homepage
21
- spec.metadata['source_code_uri'] = 'https://github.com/suketa/ruby-duckdb'
22
- spec.metadata['changelog_uri'] = 'https://github.com/suketa/ruby-duckdb/blob/master/CHANGELOG.md'
21
+ spec.metadata['source_code_uri'] = spec.homepage
22
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
23
23
 
24
24
  # Specify which files should be added to the gem when it is released.
25
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
25
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features|sample|benchmark)/|^\.(?!rdoc_options)|
28
+ ^(HACKING|CONTRIBUTION)\.md$|
29
+ ^(Dockerfile|docker-compose\.yml|getduckdb\.sh|Gemfile(\.lock)?)$}x)
30
+ end
28
31
  end
32
+
29
33
  spec.require_paths = ['lib']
30
- spec.extensions = ['ext/duckdb/extconf.rb']
34
+ spec.extensions = ['ext/duckdb/extconf.rb']
31
35
  spec.required_ruby_version = '>= 3.2.0'
32
36
  spec.add_dependency 'bigdecimal', '>= 3.1.4'
33
37
  end