duckdb 1.5.1.0 → 1.5.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +18 -0
  4. data/ext/duckdb/aggregate_function.c +791 -0
  5. data/ext/duckdb/aggregate_function.h +18 -0
  6. data/ext/duckdb/appender.c +27 -0
  7. data/ext/duckdb/connection.c +69 -0
  8. data/ext/duckdb/converter.h +9 -1
  9. data/ext/duckdb/conveter.c +173 -2
  10. data/ext/duckdb/data_chunk.c +69 -0
  11. data/ext/duckdb/data_chunk.h +1 -0
  12. data/ext/duckdb/database.c +5 -49
  13. data/ext/duckdb/duckdb.c +6 -1
  14. data/ext/duckdb/extconf.rb +0 -2
  15. data/ext/duckdb/extracted_statements.c +4 -4
  16. data/ext/duckdb/function_executor.c +261 -0
  17. data/ext/duckdb/function_executor.h +46 -0
  18. data/ext/duckdb/function_vector.c +207 -0
  19. data/ext/duckdb/function_vector.h +27 -0
  20. data/ext/duckdb/logical_type.c +147 -0
  21. data/ext/duckdb/memory_helper.c +2 -10
  22. data/ext/duckdb/prepared_statement.c +17 -0
  23. data/ext/duckdb/result.c +12 -21
  24. data/ext/duckdb/ruby-duckdb.h +9 -3
  25. data/ext/duckdb/scalar_function.c +53 -404
  26. data/ext/duckdb/scalar_function_set.c +86 -0
  27. data/ext/duckdb/scalar_function_set.h +14 -0
  28. data/ext/duckdb/table_description.c +144 -0
  29. data/ext/duckdb/table_description.h +16 -0
  30. data/ext/duckdb/table_function.c +78 -41
  31. data/ext/duckdb/util.c +16 -0
  32. data/ext/duckdb/util.h +1 -0
  33. data/ext/duckdb/value.c +279 -0
  34. data/ext/duckdb/value.h +15 -0
  35. data/lib/duckdb/aggregate_function.rb +47 -0
  36. data/lib/duckdb/appender.rb +32 -7
  37. data/lib/duckdb/column_description.rb +32 -0
  38. data/lib/duckdb/connection.rb +77 -0
  39. data/lib/duckdb/converter.rb +36 -16
  40. data/lib/duckdb/data_chunk.rb +46 -31
  41. data/lib/duckdb/database.rb +44 -15
  42. data/lib/duckdb/duckdb_native.so +0 -0
  43. data/lib/duckdb/extracted_statements.rb +2 -2
  44. data/lib/duckdb/function_type_validation.rb +50 -0
  45. data/lib/duckdb/interval.rb +15 -9
  46. data/lib/duckdb/logical_type.rb +66 -0
  47. data/lib/duckdb/prepared_statement.rb +18 -4
  48. data/lib/duckdb/scalar_function.rb +17 -51
  49. data/lib/duckdb/scalar_function_set.rb +31 -0
  50. data/lib/duckdb/table_description.rb +79 -0
  51. data/lib/duckdb/value.rb +248 -0
  52. data/lib/duckdb/version.rb +1 -1
  53. data/lib/duckdb.rb +6 -0
  54. metadata +25 -32
  55. data/.gitattributes +0 -1
  56. data/.github/FUNDING.yml +0 -3
  57. data/.github/copilot-instructions.md +0 -169
  58. data/.github/workflows/linter.yml +0 -30
  59. data/.github/workflows/make_documents.yml +0 -34
  60. data/.github/workflows/test_on_macos.yml +0 -103
  61. data/.github/workflows/test_on_ubuntu.yml +0 -108
  62. data/.github/workflows/test_on_windows.yml +0 -71
  63. data/.gitignore +0 -19
  64. data/.rubocop.yml +0 -34
  65. data/CONTRIBUTION.md +0 -45
  66. data/Dockerfile +0 -22
  67. data/Gemfile +0 -16
  68. data/Gemfile.lock +0 -77
  69. data/benchmark/converter_hugeint_ips.rb +0 -27
  70. data/benchmark/get_converter_module_ips.rb +0 -26
  71. data/benchmark/to_intern_ips.rb +0 -72
  72. data/docker-compose.yml +0 -11
  73. data/duckdb.gemspec +0 -33
  74. data/ext/duckdb/value_impl.c +0 -126
  75. data/ext/duckdb/value_impl.h +0 -15
  76. data/getduckdb.sh +0 -18
  77. data/sample/async_query.rb +0 -25
  78. data/sample/issue922.rb +0 -54
  79. data/sample/issue922_benchmark.rb +0 -169
  80. data/sample/issue930.rb +0 -49
  81. data/sample/issue930_benchmark.rb +0 -70
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c55213e9e388de53b04f29987c7714975ab5c1a8fa10a40ae378189507dae752
4
- data.tar.gz: a96e6256ce85583fd395d936994d2a871727af8f7ba11fadc40a9d9ca79c15fa
3
+ metadata.gz: 295ef9eeb24957c23fe7b581094e8961b3c6ce818040246e6b027fd97d462984
4
+ data.tar.gz: 01e6c633d11f6c25ed15a3326250a4c3c107c8257e0a29b6149ea66bde2c4d46
5
5
  SHA512:
6
- metadata.gz: 67c2d5de633c5999ca07e3deb7c98a091b4eaedb70eacce2d2f7c34b9e8795b012d4415e197d5996ca80eb9c526dc28e86ced8f1d977cc040fcfd8c59a9a3ad2
7
- data.tar.gz: 38de479e2069a0b4dd1fa8684b2174d6f42c15375d54269f56983b530e2b7ea43150284b8825879cdceca1fe959f1c05b8043bb1c2202b30456c63eac8dbc6ab
6
+ metadata.gz: e3472308ea3a5fd362ebe0d2f048451e88b40d35bd14f987f6adc31c050355e340a47897b73ff1c272f409a161950b1ce7dd26c29e63598acfba8695eb4a7249
7
+ data.tar.gz: b31c79510aab7118f0ef0b60d3704135a6e3920eca7bef4835e866b919ea45c796bad353a06c0c0274fab3baac215be763a63bb1911958350abc0acb9c545939
data/CHANGELOG.md CHANGED
@@ -4,6 +4,55 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  # Unreleased
6
6
 
7
+ # 1.5.2.0 - 2026-04-16
8
+
9
+ - add `DuckDB::DataChunk#reset` to clear a chunk's contents so it can be reused across multiple `Appender#append_data_chunk` calls without reallocation.
10
+ - 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.
11
+ - add `TIME_NS` column support to `DuckDB::Result`. `TIME_NS` values are returned as `Time` objects with nanoseconds truncated to microseconds.
12
+ - 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.
13
+ - 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.
14
+ - add `DuckDB::Connection#extract` to extract multiple SQL statements as prepared statements without executing them.
15
+ - add `DuckDB::Connection#register_logical_type` to register a custom logical type with a connection.
16
+ - add `DuckDB::PreparedStatement#bind_value`.
17
+ - add `DuckDB::Value.create_bool`.
18
+ - add `DuckDB::Value.create_int8`.
19
+ - add `DuckDB::Value.create_int16`.
20
+ - add `DuckDB::Value.create_int32`.
21
+ - add `DuckDB::Value.create_int64`.
22
+ - add `DuckDB::Value.create_uint8`.
23
+ - add `DuckDB::Value.create_uint16`.
24
+ - add `DuckDB::Value.create_uint32`.
25
+ - add `DuckDB::Value.create_uint64`.
26
+ - add `DuckDB::Value.create_null`.
27
+ - add `DuckDB::Value.create_float`.
28
+ - add `DuckDB::Value.create_double`.
29
+ - add `DuckDB::Value.create_varchar`.
30
+ - add `DuckDB::Value.create_blob`.
31
+ - add `DuckDB::Value.create_hugeint`.
32
+ - add `DuckDB::Value.create_uhugeint`.
33
+ - add `DuckDB::Appender#append_value`.
34
+ - add `DuckDB::Appender#append_data_chunk` to append a `DuckDB::DataChunk` in one call.
35
+ - add `DuckDB::DataChunk.new(types)` to create an owned data chunk from Ruby logical types.
36
+ - add `DuckDB::AggregateFunction`.
37
+ - add `DuckDB::TableDescription` to retrieve metadata about a table (with DuckDB >= 1.5.0).
38
+ - add `DuckDB::ColumnDescription` to describe a column's name, logical type, and whether it has a default value (with DuckDB >= 1.5.0).
39
+
40
+ ## Breaking Changes
41
+ - rename `DuckDB::ValueImpl` to `DuckDB::Value`
42
+ - remove `DuckDB::ExtractedStatementsImpl`. use `DuckDB::ExtractedStatements`
43
+ - `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.
44
+
45
+ # 1.5.1.1 - 2026-04-04
46
+
47
+ - 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).
48
+ - add `DuckDB::ScalarFunctionSet` to register multiple overloads of a scalar function under one name (wraps `duckdb_scalar_function_set`).
49
+ - add `DuckDB::ScalarFunctionSet#add` to add a `DuckDB::ScalarFunction` overload to the set (wraps `duckdb_add_scalar_function_to_set`).
50
+ - add `DuckDB::Connection#register_scalar_function_set` to register a `DuckDB::ScalarFunctionSet` with the connection (wraps `duckdb_register_scalar_function_set`).
51
+ - `DuckDB::ScalarFunction.create` now accepts `name: nil` (optional) to allow creating nameless functions for use inside a `ScalarFunctionSet`.
52
+ - add `DuckDB::LogicalType.create_struct` to create a struct logical type.
53
+ - add `DuckDB::LogicalType.create_enum` to create an enum logical type.
54
+ - add `DuckDB::LogicalType.create_decimal` to create a decimal logical type.
55
+
7
56
  # 1.5.1.0 - 2026-03-29
8
57
 
9
58
  - add `DuckDB::ScalarFunction#varargs_type=` to register a scalar function that accepts a variable number of arguments of a given type (wraps `duckdb_scalar_function_set_varargs`).
@@ -17,6 +66,7 @@ All notable changes to this project will be documented in this file.
17
66
  - add `DuckDB::ScalarFunction::BindInfo#get_argument(index)` to return the expression at the given argument index as a `DuckDB::Expression` object (wraps `duckdb_scalar_function_bind_get_argument`). Raises `ArgumentError` for out-of-range index.
18
67
  - add `DuckDB::Expression#foldable?` to check whether an expression can be folded to a constant at query planning time (wraps `duckdb_expression_is_foldable`). Returns `true` for literals and constant arithmetic, `false` for column references and non-deterministic functions.
19
68
  - add `DuckDB::LogicalType.create_map` to create a map logical type.
69
+ - add `DuckDB::LogicalType.create_union` to create a union logical type.
20
70
  - bump duckdb to 1.5.1 on CI
21
71
  - add `DuckDB::ScalarFunction::BindInfo#client_context` to return the client context of the bind phase as a `DuckDB::ClientContext` object (wraps `duckdb_scalar_function_get_client_context`).
22
72
  - add `DuckDB::ClientContext#connection_id` to return the connection id of the client context (wraps `duckdb_client_context_get_connection_id`).
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.