sequel-duckdb 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/sequel/adapters/duckdb.rb +3 -3
- data/lib/sequel/adapters/shared/duckdb.rb +17 -17
- data/lib/sequel/duckdb/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d1a28241665b1678903381a6230815dc1d8bc03b54f0778dfa86ee1042f04edb
|
|
4
|
+
data.tar.gz: a855f1bcac746a4f495ac1d003f015da38afac13f0663675c65d2df704baef66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c26aef724f16dd8f29b396f2e63338fbcfd72ab9d739614638038e46a41e2ea051dbca9bd6a6cbb2d935d1aec99853651019cc8b803958eedc63c0cc7ccdb984
|
|
7
|
+
data.tar.gz: fa3cc4c38ae41d572095bb09ccd16547519645f935beae228866591180997e7846cbd274817c486bc95d1c5edbbe333ce592e1926322e0366f18020d1db98a8a
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.1] - 2026-10-02
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Point homepage and changelog links at outcomesinsights/sequel-duckdb ([69fa0db](https://github.com/outcomesinsights/sequel-duckdb/commit/69fa0db723f6a579cc5451df450f568452968ce0))
|
|
13
|
+
|
|
8
14
|
## [0.3.0] - 2026-10-01
|
|
9
15
|
|
|
10
16
|
### Breaking changes
|
|
@@ -64,12 +64,12 @@ module Sequel
|
|
|
64
64
|
|
|
65
65
|
@duckdb_database = if database_path == ":memory:" || database_path.nil?
|
|
66
66
|
::DuckDB::Database.open(":memory:")
|
|
67
|
-
|
|
67
|
+
else
|
|
68
68
|
if database_path.match?(/^[a-zA-Z]/) && !database_path.start_with?(":")
|
|
69
69
|
database_path = "/#{database_path}"
|
|
70
70
|
end
|
|
71
71
|
::DuckDB::Database.open(database_path)
|
|
72
|
-
|
|
72
|
+
end
|
|
73
73
|
rescue ::DuckDB::Error => e
|
|
74
74
|
raise Sequel::DatabaseConnectionError, "Failed to connect to DuckDB database: #{e.message}"
|
|
75
75
|
rescue StandardError => e
|
|
@@ -123,7 +123,7 @@ module Sequel
|
|
|
123
123
|
private
|
|
124
124
|
|
|
125
125
|
def database_error_classes
|
|
126
|
-
[::DuckDB::Error]
|
|
126
|
+
[ ::DuckDB::Error ]
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def _execute(type, sql, opts, &block)
|
|
@@ -56,7 +56,7 @@ module Sequel
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# Whether to quote identifiers by default for this database
|
|
59
|
-
def quote_identifiers_default
|
|
59
|
+
def quote_identifiers_default
|
|
60
60
|
true
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -103,10 +103,10 @@ module Sequel
|
|
|
103
103
|
sql = if schema_ref.is_a?(Sequel::SQL::QualifiedIdentifier)
|
|
104
104
|
"SELECT table_name FROM information_schema.tables " \
|
|
105
105
|
"WHERE table_catalog = '#{schema_ref.table}' AND table_schema = '#{schema_ref.column}' AND table_type = 'BASE TABLE'"
|
|
106
|
-
|
|
106
|
+
else
|
|
107
107
|
"SELECT table_name FROM information_schema.tables " \
|
|
108
108
|
"WHERE table_schema = '#{schema_ref}' AND table_type = 'BASE TABLE'"
|
|
109
|
-
|
|
109
|
+
end
|
|
110
110
|
|
|
111
111
|
tables = []
|
|
112
112
|
execute(sql) do |row|
|
|
@@ -171,7 +171,7 @@ module Sequel
|
|
|
171
171
|
column_info[:precision] = row[:numeric_precision] if row[:numeric_precision]
|
|
172
172
|
column_info[:scale] = row[:numeric_scale] if row[:numeric_scale]
|
|
173
173
|
|
|
174
|
-
columns << [column_name, column_info]
|
|
174
|
+
columns << [ column_name, column_info ]
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
# Update primary key information
|
|
@@ -249,13 +249,13 @@ module Sequel
|
|
|
249
249
|
|
|
250
250
|
# Format value appropriately for SQL
|
|
251
251
|
formatted_value = case value
|
|
252
|
-
|
|
252
|
+
when String
|
|
253
253
|
"'#{value.gsub("'", "''")}'" # Escape single quotes
|
|
254
|
-
|
|
254
|
+
when TrueClass, FalseClass, Numeric
|
|
255
255
|
value.to_s
|
|
256
|
-
|
|
256
|
+
else
|
|
257
257
|
"'#{value}'"
|
|
258
|
-
|
|
258
|
+
end
|
|
259
259
|
|
|
260
260
|
# Execute PRAGMA statement
|
|
261
261
|
pragma_sql = "PRAGMA #{pragma_key} = #{formatted_value}"
|
|
@@ -341,10 +341,10 @@ module Sequel
|
|
|
341
341
|
sql = if schema_ref.is_a?(Sequel::SQL::QualifiedIdentifier)
|
|
342
342
|
"SELECT table_name FROM information_schema.tables " \
|
|
343
343
|
"WHERE table_catalog = '#{schema_ref.table}' AND table_schema = '#{schema_ref.column}' AND table_type = 'VIEW'"
|
|
344
|
-
|
|
344
|
+
else
|
|
345
345
|
"SELECT table_name FROM information_schema.tables " \
|
|
346
346
|
"WHERE table_schema = '#{schema_ref}' AND table_type = 'VIEW'"
|
|
347
|
-
|
|
347
|
+
end
|
|
348
348
|
|
|
349
349
|
views = []
|
|
350
350
|
execute(sql) do |row|
|
|
@@ -754,13 +754,13 @@ module Sequel
|
|
|
754
754
|
read_something_sql(some_paths, options).then do |read_stmt|
|
|
755
755
|
from(read_stmt)
|
|
756
756
|
end.sql
|
|
757
|
-
|
|
757
|
+
elsif source.is_a?(Dataset)
|
|
758
758
|
source.sql
|
|
759
|
-
|
|
759
|
+
elsif source.is_a?(String)
|
|
760
760
|
source
|
|
761
|
-
|
|
761
|
+
else
|
|
762
762
|
raise Sequel::Error, "Unsupported source type: #{source.class}"
|
|
763
|
-
|
|
763
|
+
end
|
|
764
764
|
|
|
765
765
|
sql = String.new
|
|
766
766
|
sql << "#{create_view_prefix_sql(name, options)} AS #{source}"
|
|
@@ -863,7 +863,7 @@ module Sequel
|
|
|
863
863
|
}.freeze
|
|
864
864
|
|
|
865
865
|
# Override select SQL clause order to support VALUES
|
|
866
|
-
Dataset.def_sql_method(self, :select, [["if opts[:values]", %w[values compounds order limit]], ["else", %w[with select distinct columns from join where group having compounds order limit lock]]])
|
|
866
|
+
Dataset.def_sql_method(self, :select, [ [ "if opts[:values]", %w[values compounds order limit] ], [ "else", %w[with select distinct columns from join where group having compounds order limit lock] ] ])
|
|
867
867
|
|
|
868
868
|
private
|
|
869
869
|
|
|
@@ -1123,12 +1123,12 @@ module Sequel
|
|
|
1123
1123
|
if value.negative?
|
|
1124
1124
|
Sequel.lit("INTERVAL (#{value}) #{unit}")
|
|
1125
1125
|
else
|
|
1126
|
-
Sequel.lit(["INTERVAL ", " #{unit}"], value)
|
|
1126
|
+
Sequel.lit([ "INTERVAL ", " #{unit}" ], value)
|
|
1127
1127
|
end
|
|
1128
1128
|
else
|
|
1129
1129
|
# Expression: INTERVAL (column_name) HOUR
|
|
1130
1130
|
# Note: expressions already include negation from date_sub
|
|
1131
|
-
Sequel.lit(["INTERVAL (", ") #{unit}"], value)
|
|
1131
|
+
Sequel.lit([ "INTERVAL (", ") #{unit}" ], value)
|
|
1132
1132
|
end
|
|
1133
1133
|
end
|
|
1134
1134
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sequel-duckdb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Duryea
|
|
@@ -99,6 +99,20 @@ dependencies:
|
|
|
99
99
|
- - "~>"
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
101
|
version: '1.21'
|
|
102
|
+
- !ruby/object:Gem::Dependency
|
|
103
|
+
name: rubocop-rails-omakase
|
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - "~>"
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '1.1'
|
|
109
|
+
type: :development
|
|
110
|
+
prerelease: false
|
|
111
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
113
|
+
- - "~>"
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '1.1'
|
|
102
116
|
- !ruby/object:Gem::Dependency
|
|
103
117
|
name: rubocop-minitest
|
|
104
118
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -173,13 +187,14 @@ files:
|
|
|
173
187
|
- lib/sequel/duckdb/helpers/copier.rb
|
|
174
188
|
- lib/sequel/duckdb/helpers/pathifier.rb
|
|
175
189
|
- lib/sequel/duckdb/version.rb
|
|
176
|
-
homepage: https://github.com/
|
|
190
|
+
homepage: https://github.com/outcomesinsights/sequel-duckdb
|
|
177
191
|
licenses:
|
|
178
192
|
- MIT
|
|
179
193
|
metadata:
|
|
180
194
|
allowed_push_host: https://rubygems.org
|
|
181
|
-
homepage_uri: https://github.com/
|
|
182
|
-
|
|
195
|
+
homepage_uri: https://github.com/outcomesinsights/sequel-duckdb
|
|
196
|
+
source_code_uri: https://github.com/outcomesinsights/sequel-duckdb
|
|
197
|
+
changelog_uri: https://github.com/outcomesinsights/sequel-duckdb/blob/main/CHANGELOG.md
|
|
183
198
|
rubygems_mfa_required: 'true'
|
|
184
199
|
rdoc_options: []
|
|
185
200
|
require_paths:
|