altertable-lakehouse 0.7.0 → 0.8.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 +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/altertable/lakehouse/client.rb +15 -2
- data/lib/altertable/lakehouse/models.rb +4 -2
- data/lib/altertable/lakehouse/version.rb +1 -1
- data/rbi/altertable/lakehouse.rbi +6 -2
- data/sig/altertable/lakehouse/models.rbs +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dfae05324ea00439f1b6dba1529227cc10707bf59a1089b8342400f3a61407a
|
|
4
|
+
data.tar.gz: 0c336d73acd7751552a6806dba593b3c0590b19e84d999c2631c326f08385d8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7b17d9d68b20e4d6aed748ee3626fa6a89949a5e4311845f16181cfe9486ad23fdf915e21220f39b4f704122d9046102e3383fa150a958a195136016d877293
|
|
7
|
+
data.tar.gz: eddc49cf94b2d6fc1e14fb2b2326385e4c79013ab7d324eeaa9961b9732295ce492698b7b4f16ca03700a55eddf5d5c95a7a877b66ffe9b88fcb3781546ec774
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Support named and positional bind values through `QueryRequest#params`.
|
|
10
|
+
|
|
11
|
+
## [0.8.0](https://github.com/altertable-ai/altertable-lakehouse-ruby/compare/altertable-lakehouse/v0.7.0...altertable-lakehouse/v0.8.0) (2026-10-07)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **query:** support bind parameters ([#52](https://github.com/altertable-ai/altertable-lakehouse-ruby/issues/52)) ([33b2fb3](https://github.com/altertable-ai/altertable-lakehouse-ruby/commit/33b2fb38d82714a344263e1d77e4552e152b9aaa))
|
|
17
|
+
|
|
5
18
|
## [0.7.0](https://github.com/altertable-ai/altertable-lakehouse-ruby/compare/altertable-lakehouse/v0.6.0...altertable-lakehouse/v0.7.0) (2026-08-26)
|
|
6
19
|
|
|
7
20
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -40,7 +40,8 @@ client.append(
|
|
|
40
40
|
|
|
41
41
|
# Query data
|
|
42
42
|
result = client.query_all(
|
|
43
|
-
statement: "SELECT * FROM main.public.events
|
|
43
|
+
statement: "SELECT * FROM main.public.events WHERE age >= $min_age",
|
|
44
|
+
params: { "min_age" => 25 }
|
|
44
45
|
)
|
|
45
46
|
result[:rows].each { |row| puts row }
|
|
46
47
|
```
|
|
@@ -282,7 +282,7 @@ module Altertable
|
|
|
282
282
|
include Enumerable
|
|
283
283
|
|
|
284
284
|
# metadata: the stream header object (first NDJSON line)
|
|
285
|
-
# columns: array of column
|
|
285
|
+
# columns: array of column names or typed column descriptors (second NDJSON line)
|
|
286
286
|
attr_reader :metadata, :columns
|
|
287
287
|
|
|
288
288
|
def initialize(enum)
|
|
@@ -304,7 +304,7 @@ module Altertable
|
|
|
304
304
|
when 0
|
|
305
305
|
@metadata = item
|
|
306
306
|
when 1
|
|
307
|
-
@columns = item
|
|
307
|
+
@columns = normalize_columns(item)
|
|
308
308
|
else
|
|
309
309
|
if @columns.is_a?(Array) && item.is_a?(Array)
|
|
310
310
|
block.call(@columns.zip(item).to_h)
|
|
@@ -315,6 +315,19 @@ module Altertable
|
|
|
315
315
|
line_index += 1
|
|
316
316
|
end
|
|
317
317
|
end
|
|
318
|
+
|
|
319
|
+
private
|
|
320
|
+
|
|
321
|
+
# The query service emits typed column descriptors, such as
|
|
322
|
+
# { "name" => "id", "type" => "INTEGER" }. Keep the public result
|
|
323
|
+
# shape stable by exposing names and using them as row keys.
|
|
324
|
+
def normalize_columns(columns)
|
|
325
|
+
return columns unless columns.is_a?(Array)
|
|
326
|
+
|
|
327
|
+
columns.map do |column|
|
|
328
|
+
column.is_a?(Hash) && column.key?("name") ? column["name"] : column
|
|
329
|
+
end
|
|
330
|
+
end
|
|
318
331
|
end
|
|
319
332
|
|
|
320
333
|
end
|
|
@@ -54,9 +54,9 @@ module Altertable
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
class QueryRequest < Request
|
|
57
|
-
attr_reader :statement, :catalog, :schema, :session_id, :compute_size, :sanitize, :limit, :offset, :timezone, :ephemeral, :visible, :requested_by, :query_id, :cache
|
|
57
|
+
attr_reader :statement, :catalog, :schema, :session_id, :compute_size, :sanitize, :limit, :offset, :timezone, :ephemeral, :visible, :requested_by, :query_id, :cache, :params
|
|
58
58
|
|
|
59
|
-
def initialize(statement:, catalog: nil, schema: nil, session_id: nil, compute_size: nil, sanitize: nil, limit: nil, offset: nil, timezone: nil, ephemeral: nil, visible: nil, requested_by: nil, query_id: nil, cache: nil)
|
|
59
|
+
def initialize(statement:, catalog: nil, schema: nil, session_id: nil, compute_size: nil, sanitize: nil, limit: nil, offset: nil, timezone: nil, ephemeral: nil, visible: nil, requested_by: nil, query_id: nil, cache: nil, params: nil)
|
|
60
60
|
@statement = statement
|
|
61
61
|
@catalog = catalog
|
|
62
62
|
@schema = schema
|
|
@@ -71,6 +71,7 @@ module Altertable
|
|
|
71
71
|
@requested_by = requested_by
|
|
72
72
|
@query_id = query_id
|
|
73
73
|
@cache = cache
|
|
74
|
+
@params = params
|
|
74
75
|
end
|
|
75
76
|
|
|
76
77
|
def to_h
|
|
@@ -88,6 +89,7 @@ module Altertable
|
|
|
88
89
|
h[:requested_by] = @requested_by if @requested_by
|
|
89
90
|
h[:query_id] = @query_id if @query_id
|
|
90
91
|
h[:cache] = @cache unless @cache.nil?
|
|
92
|
+
h[:params] = @params unless @params.nil?
|
|
91
93
|
h
|
|
92
94
|
end
|
|
93
95
|
end
|
|
@@ -300,6 +300,9 @@ module Altertable
|
|
|
300
300
|
sig { returns(T.nilable(T::Boolean)) }
|
|
301
301
|
def cache; end
|
|
302
302
|
|
|
303
|
+
sig { returns(T.nilable(T.any(T::Hash[String, T.untyped], T::Array[T.untyped]))) }
|
|
304
|
+
def params; end
|
|
305
|
+
|
|
303
306
|
sig do
|
|
304
307
|
params(
|
|
305
308
|
statement: String,
|
|
@@ -315,10 +318,11 @@ module Altertable
|
|
|
315
318
|
visible: T.nilable(T::Boolean),
|
|
316
319
|
requested_by: T.nilable(String),
|
|
317
320
|
query_id: T.nilable(String),
|
|
318
|
-
cache: T.nilable(T::Boolean)
|
|
321
|
+
cache: T.nilable(T::Boolean),
|
|
322
|
+
params: T.nilable(T.any(T::Hash[String, T.untyped], T::Array[T.untyped]))
|
|
319
323
|
).void
|
|
320
324
|
end
|
|
321
|
-
def initialize(statement:, catalog: nil, schema: nil, session_id: nil, compute_size: nil, sanitize: nil, limit: nil, offset: nil, timezone: nil, ephemeral: nil, visible: nil, requested_by: nil, query_id: nil, cache: nil); end
|
|
325
|
+
def initialize(statement:, catalog: nil, schema: nil, session_id: nil, compute_size: nil, sanitize: nil, limit: nil, offset: nil, timezone: nil, ephemeral: nil, visible: nil, requested_by: nil, query_id: nil, cache: nil, params: nil); end
|
|
322
326
|
|
|
323
327
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
324
328
|
def to_h; end
|
|
@@ -45,6 +45,7 @@ module Altertable
|
|
|
45
45
|
attr_reader requested_by: String?
|
|
46
46
|
attr_reader query_id: String?
|
|
47
47
|
attr_reader cache: bool?
|
|
48
|
+
attr_reader params: (::Hash[String, untyped] | ::Array[untyped])?
|
|
48
49
|
|
|
49
50
|
def initialize: (
|
|
50
51
|
statement: String,
|
|
@@ -60,7 +61,8 @@ module Altertable
|
|
|
60
61
|
?visible: bool?,
|
|
61
62
|
?requested_by: String?,
|
|
62
63
|
?query_id: String?,
|
|
63
|
-
?cache: bool
|
|
64
|
+
?cache: bool?,
|
|
65
|
+
?params: (::Hash[String, untyped] | ::Array[untyped])?
|
|
64
66
|
) -> void
|
|
65
67
|
|
|
66
68
|
def to_h: () -> ::Hash[Symbol, untyped]
|