altertable-lakehouse 0.6.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/.github/FUNDING.yml +1 -0
- data/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- data/.github/workflows/ci.yml +9 -9
- data/.github/workflows/release-please.yml +6 -6
- data/.github/workflows/semantic-pr.yml +34 -0
- data/.github/workflows/semantic-pull-request.yml +12 -2
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +20 -0
- data/CODE_OF_CONDUCT.md +6 -6
- data/CONTRIBUTING.md +1 -1
- data/Gemfile.lock +4 -1
- data/README.md +4 -2
- data/SECURITY.md +1 -1
- data/altertable-lakehouse.gemspec +1 -0
- data/lib/altertable/lakehouse/adapters.rb +14 -8
- data/lib/altertable/lakehouse/client.rb +17 -4
- data/lib/altertable/lakehouse/models.rb +4 -2
- data/lib/altertable/lakehouse/version.rb +1 -1
- data/rbi/altertable/lakehouse.rbi +17 -12
- data/sig/altertable/lakehouse/adapters.rbs +5 -4
- data/sig/altertable/lakehouse/client.rbs +2 -1
- data/sig/altertable/lakehouse/models.rbs +3 -1
- metadata +18 -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/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [altertable-ai]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## What
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR do? One sentence is fine. -->
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
<!-- Link an issue or explain the motivation. -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] Tests added or updated
|
|
12
|
+
- [ ] `CHANGELOG.md` updated (skip for docs/CI-only changes)
|
|
13
|
+
- [ ] Breaking change noted in commit footer (`BREAKING CHANGE: …`) and changelog
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -6,7 +6,7 @@ on:
|
|
|
6
6
|
pull_request: {}
|
|
7
7
|
jobs:
|
|
8
8
|
test:
|
|
9
|
-
runs-on: ubuntu-
|
|
9
|
+
runs-on: ubuntu-24.04
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
12
|
ruby-version: ["3.2", "3.3", "3.4", "4.0"]
|
|
@@ -26,12 +26,12 @@ jobs:
|
|
|
26
26
|
--health-start-period 10s
|
|
27
27
|
|
|
28
28
|
steps:
|
|
29
|
-
- uses: actions/checkout@v4
|
|
29
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
30
30
|
with:
|
|
31
31
|
submodules: recursive
|
|
32
32
|
|
|
33
33
|
- name: Set up Ruby
|
|
34
|
-
uses: ruby/setup-ruby@v1
|
|
34
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
|
|
35
35
|
with:
|
|
36
36
|
ruby-version: ${{ matrix.ruby-version }}
|
|
37
37
|
bundler-cache: true
|
|
@@ -40,11 +40,11 @@ jobs:
|
|
|
40
40
|
run: bundle exec rake spec
|
|
41
41
|
|
|
42
42
|
lint:
|
|
43
|
-
runs-on: ubuntu-
|
|
43
|
+
runs-on: ubuntu-24.04
|
|
44
44
|
steps:
|
|
45
|
-
- uses: actions/checkout@v4
|
|
45
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
46
46
|
- name: Set up Ruby
|
|
47
|
-
uses: ruby/setup-ruby@v1
|
|
47
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
|
|
48
48
|
with:
|
|
49
49
|
ruby-version: "3.4"
|
|
50
50
|
bundler-cache: true
|
|
@@ -53,11 +53,11 @@ jobs:
|
|
|
53
53
|
|
|
54
54
|
typing:
|
|
55
55
|
name: "Typing"
|
|
56
|
-
runs-on: ubuntu-
|
|
56
|
+
runs-on: ubuntu-24.04
|
|
57
57
|
steps:
|
|
58
|
-
- uses: actions/checkout@v4
|
|
58
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
59
59
|
- name: Set up Ruby
|
|
60
|
-
uses: ruby/setup-ruby@v1
|
|
60
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
|
|
61
61
|
with:
|
|
62
62
|
ruby-version: "3.4"
|
|
63
63
|
bundler-cache: true
|
|
@@ -7,14 +7,14 @@ on:
|
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
check:
|
|
10
|
-
runs-on: ubuntu-
|
|
10
|
+
runs-on: ubuntu-24.04
|
|
11
11
|
|
|
12
12
|
permissions:
|
|
13
13
|
contents: write
|
|
14
14
|
pull-requests: write
|
|
15
15
|
|
|
16
16
|
steps:
|
|
17
|
-
- uses: googleapis/release-please-action@v4
|
|
17
|
+
- uses: googleapis/release-please-action@8b8fd2cc23b2e18957157a9d923d75aa0c6f6ad5 # v4
|
|
18
18
|
id: release
|
|
19
19
|
with:
|
|
20
20
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -29,7 +29,7 @@ jobs:
|
|
|
29
29
|
|
|
30
30
|
if: ${{ needs.check.outputs.release_created }}
|
|
31
31
|
|
|
32
|
-
runs-on: ubuntu-
|
|
32
|
+
runs-on: ubuntu-24.04
|
|
33
33
|
|
|
34
34
|
permissions:
|
|
35
35
|
contents: write
|
|
@@ -37,11 +37,11 @@ jobs:
|
|
|
37
37
|
id-token: write
|
|
38
38
|
|
|
39
39
|
steps:
|
|
40
|
-
- uses: actions/checkout@v4
|
|
40
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
41
41
|
with:
|
|
42
42
|
persist-credentials: false
|
|
43
|
-
- uses: ruby/setup-ruby@v1
|
|
43
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
|
|
44
44
|
with:
|
|
45
45
|
ruby-version: 3.4
|
|
46
46
|
bundler-cache: true
|
|
47
|
-
- uses: rubygems/release-gem@v1
|
|
47
|
+
- uses: rubygems/release-gem@052cc82692552de3ef2b81fd670e41d13cba8092 # v1
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Semantic Pull Request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
semantic-pr:
|
|
15
|
+
name: Validate PR title
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- name: Validate title
|
|
19
|
+
uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
|
|
20
|
+
env:
|
|
21
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
with:
|
|
23
|
+
types: |
|
|
24
|
+
feat
|
|
25
|
+
fix
|
|
26
|
+
perf
|
|
27
|
+
revert
|
|
28
|
+
docs
|
|
29
|
+
style
|
|
30
|
+
chore
|
|
31
|
+
refactor
|
|
32
|
+
test
|
|
33
|
+
build
|
|
34
|
+
ci
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
name: Semantic Pull Request
|
|
2
|
+
|
|
2
3
|
on:
|
|
3
4
|
pull_request_target:
|
|
4
5
|
types:
|
|
@@ -6,12 +7,21 @@ on:
|
|
|
6
7
|
- edited
|
|
7
8
|
- synchronize
|
|
8
9
|
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: semantic-pr-${{ github.event.pull_request.number }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
9
17
|
jobs:
|
|
10
18
|
main:
|
|
11
19
|
name: Validate PR title
|
|
12
|
-
runs-on: ubuntu-
|
|
20
|
+
runs-on: ubuntu-24.04
|
|
21
|
+
timeout-minutes: 5
|
|
13
22
|
steps:
|
|
14
|
-
-
|
|
23
|
+
- name: Validate pull request title
|
|
24
|
+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
|
|
15
25
|
env:
|
|
16
26
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
17
27
|
with:
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
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
|
+
|
|
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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* pass proxy through as a raw options override ([#50](https://github.com/altertable-ai/altertable-lakehouse-ruby/issues/50)) ([f2af534](https://github.com/altertable-ai/altertable-lakehouse-ruby/commit/f2af53452b42b8421f6529d532e23546ffe80c16))
|
|
24
|
+
|
|
5
25
|
## [0.6.0](https://github.com/altertable-ai/altertable-lakehouse-ruby/compare/altertable-lakehouse/v0.5.1...altertable-lakehouse/v0.6.0) (2026-06-30)
|
|
6
26
|
|
|
7
27
|
|
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -70,14 +70,14 @@ Community leaders will follow these Community Impact Guidelines in determining t
|
|
|
70
70
|
|
|
71
71
|
## Attribution
|
|
72
72
|
|
|
73
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][v2.1].
|
|
74
74
|
|
|
75
75
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
76
76
|
|
|
77
|
-
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq/][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations/][translations].
|
|
78
78
|
|
|
79
79
|
[homepage]: https://www.contributor-covenant.org
|
|
80
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct
|
|
81
|
-
[Mozilla CoC]: https://github.com/mozilla/
|
|
82
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
83
|
-
[translations]: https://www.contributor-covenant.org/translations
|
|
80
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct/
|
|
81
|
+
[Mozilla CoC]: https://github.com/mozilla/inclusion
|
|
82
|
+
[FAQ]: https://www.contributor-covenant.org/faq/
|
|
83
|
+
[translations]: https://www.contributor-covenant.org/translations/
|
data/CONTRIBUTING.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
altertable-lakehouse (0.
|
|
4
|
+
altertable-lakehouse (0.8.0)
|
|
5
5
|
base64
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -108,6 +108,8 @@ GEM
|
|
|
108
108
|
rexml (>= 3.2.6)
|
|
109
109
|
sorbet-static-and-runtime (>= 0.5.10187)
|
|
110
110
|
thor (>= 0.19.2)
|
|
111
|
+
stub_env (1.0.4)
|
|
112
|
+
rspec (>= 2.0, < 4.0)
|
|
111
113
|
tapioca (0.17.7)
|
|
112
114
|
benchmark
|
|
113
115
|
bundler (>= 2.2.25)
|
|
@@ -150,6 +152,7 @@ DEPENDENCIES
|
|
|
150
152
|
rubocop (~> 1.50)
|
|
151
153
|
sorbet
|
|
152
154
|
sorbet-runtime
|
|
155
|
+
stub_env
|
|
153
156
|
tapioca
|
|
154
157
|
testcontainers
|
|
155
158
|
|
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
|
```
|
|
@@ -58,7 +59,8 @@ client = Altertable::Lakehouse::Client.new(
|
|
|
58
59
|
password: "your_password",
|
|
59
60
|
base_url: "https://api.altertable.ai", # Optional
|
|
60
61
|
timeout: 10, # Optional
|
|
61
|
-
open_timeout: 5 # Optional
|
|
62
|
+
open_timeout: 5, # Optional
|
|
63
|
+
proxy: nil # Optional; omit to honor HTTP(S)_PROXY, or pass nil/a custom proxy URL to override
|
|
62
64
|
)
|
|
63
65
|
|
|
64
66
|
# 2. Pre-encoded Basic Auth Token
|
data/SECURITY.md
CHANGED
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.add_development_dependency "rake", "~> 13.0"
|
|
35
35
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
36
36
|
spec.add_development_dependency "rubocop", "~> 1.50"
|
|
37
|
+
spec.add_development_dependency "stub_env"
|
|
37
38
|
spec.add_development_dependency "testcontainers"
|
|
38
39
|
spec.add_development_dependency "rbs"
|
|
39
40
|
spec.add_development_dependency "sorbet"
|
|
@@ -4,11 +4,12 @@ module Altertable
|
|
|
4
4
|
Response = Struct.new(:status, :body, :headers)
|
|
5
5
|
|
|
6
6
|
class Base
|
|
7
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {})
|
|
7
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options)
|
|
8
8
|
@base_url = base_url
|
|
9
9
|
@timeout = timeout
|
|
10
10
|
@open_timeout = open_timeout
|
|
11
11
|
@headers = headers
|
|
12
|
+
@options = options
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
def get(path, body: nil, params: {}, headers: {}, &_block)
|
|
@@ -25,17 +26,18 @@ module Altertable
|
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
class FaradayAdapter < Base
|
|
28
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {})
|
|
29
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options)
|
|
29
30
|
super
|
|
30
31
|
require "faraday"
|
|
31
32
|
require "faraday/retry"
|
|
32
33
|
require "faraday/net_http"
|
|
33
|
-
|
|
34
|
+
|
|
34
35
|
@conn = Faraday.new(url: @base_url) do |f|
|
|
35
36
|
@headers.each { |k, v| f.headers[k] = v }
|
|
36
37
|
f.options.timeout = @timeout
|
|
37
38
|
f.options.open_timeout = @open_timeout
|
|
38
39
|
f.request :retry, max: 3, interval: 0.05, backoff_factor: 2
|
|
40
|
+
f.proxy = options[:proxy] if options.key?(:proxy)
|
|
39
41
|
f.adapter Faraday.default_adapter
|
|
40
42
|
end
|
|
41
43
|
end
|
|
@@ -80,16 +82,18 @@ module Altertable
|
|
|
80
82
|
end
|
|
81
83
|
|
|
82
84
|
class HttpxAdapter < Base
|
|
83
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {})
|
|
85
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options)
|
|
84
86
|
super
|
|
85
87
|
require "httpx"
|
|
86
88
|
# Configure retries plugin if available or implement manual retries?
|
|
87
89
|
# Httpx has built-in retries via plugin.
|
|
88
|
-
|
|
90
|
+
http_options = {
|
|
89
91
|
timeout: { operation_timeout: @timeout, connect_timeout: @open_timeout },
|
|
90
92
|
headers: @headers,
|
|
91
93
|
base_url: @base_url
|
|
92
|
-
|
|
94
|
+
}
|
|
95
|
+
http_options[:proxy] = options[:proxy] if options.key?(:proxy)
|
|
96
|
+
@client = HTTPX.plugin(:retries).with(**http_options)
|
|
93
97
|
end
|
|
94
98
|
|
|
95
99
|
def get(path, body: nil, params: {}, headers: {}, &_block) # rubocop:disable Lint/UnusedMethodArgument
|
|
@@ -135,7 +139,7 @@ module Altertable
|
|
|
135
139
|
end
|
|
136
140
|
|
|
137
141
|
class NetHttpAdapter < Base
|
|
138
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {})
|
|
142
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options)
|
|
139
143
|
super
|
|
140
144
|
require "net/http"
|
|
141
145
|
require "uri"
|
|
@@ -166,7 +170,9 @@ module Altertable
|
|
|
166
170
|
req.body = body if body
|
|
167
171
|
|
|
168
172
|
# Net::HTTP start
|
|
169
|
-
|
|
173
|
+
start_args = [uri.host, uri.port]
|
|
174
|
+
start_args << @options[:proxy] if @options.key?(:proxy)
|
|
175
|
+
Net::HTTP.start(*start_args, use_ssl: uri.scheme == "https", open_timeout: @open_timeout, read_timeout: @timeout) do |http|
|
|
170
176
|
if block_given?
|
|
171
177
|
http.request(req) do |response|
|
|
172
178
|
# Stream the body if block is given
|
|
@@ -12,7 +12,7 @@ module Altertable
|
|
|
12
12
|
DEFAULT_TIMEOUT = 10
|
|
13
13
|
DEFAULT_OPEN_TIMEOUT = 5
|
|
14
14
|
|
|
15
|
-
def initialize(username: nil, password: nil, basic_auth_token: nil, base_url: nil, timeout: nil, open_timeout: nil, user_agent: nil, adapter: nil, headers: {})
|
|
15
|
+
def initialize(username: nil, password: nil, basic_auth_token: nil, base_url: nil, timeout: nil, open_timeout: nil, user_agent: nil, adapter: nil, headers: {}, **options)
|
|
16
16
|
# 1. Try passed basic_auth_token
|
|
17
17
|
# 2. Try passed username/password
|
|
18
18
|
# 3. Try ENV["ALTERTABLE_BASIC_AUTH_TOKEN"]
|
|
@@ -40,7 +40,7 @@ module Altertable
|
|
|
40
40
|
"User-Agent" => @user_agent
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
@adapter = select_adapter(adapter, base_url: @base_url, timeout: @timeout, open_timeout: @open_timeout, headers: default_headers.merge(headers))
|
|
43
|
+
@adapter = select_adapter(adapter, base_url: @base_url, timeout: @timeout, open_timeout: @open_timeout, headers: default_headers.merge(headers), **options)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
# POST /append
|
|
@@ -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
|
|
@@ -65,10 +65,11 @@ module Altertable
|
|
|
65
65
|
open_timeout: T.nilable(T.any(Integer, Float)),
|
|
66
66
|
user_agent: T.nilable(String),
|
|
67
67
|
adapter: T.nilable(Symbol),
|
|
68
|
-
headers: T::Hash[String, String]
|
|
68
|
+
headers: T::Hash[String, String],
|
|
69
|
+
options: T.untyped
|
|
69
70
|
).void
|
|
70
71
|
end
|
|
71
|
-
def initialize(username: nil, password: nil, basic_auth_token: nil, base_url: nil, timeout: nil, open_timeout: nil, user_agent: nil, adapter: nil, headers: {}); end
|
|
72
|
+
def initialize(username: nil, password: nil, basic_auth_token: nil, base_url: nil, timeout: nil, open_timeout: nil, user_agent: nil, adapter: nil, headers: {}, **options); end
|
|
72
73
|
|
|
73
74
|
sig do
|
|
74
75
|
params(
|
|
@@ -299,6 +300,9 @@ module Altertable
|
|
|
299
300
|
sig { returns(T.nilable(T::Boolean)) }
|
|
300
301
|
def cache; end
|
|
301
302
|
|
|
303
|
+
sig { returns(T.nilable(T.any(T::Hash[String, T.untyped], T::Array[T.untyped]))) }
|
|
304
|
+
def params; end
|
|
305
|
+
|
|
302
306
|
sig do
|
|
303
307
|
params(
|
|
304
308
|
statement: String,
|
|
@@ -314,10 +318,11 @@ module Altertable
|
|
|
314
318
|
visible: T.nilable(T::Boolean),
|
|
315
319
|
requested_by: T.nilable(String),
|
|
316
320
|
query_id: T.nilable(String),
|
|
317
|
-
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]))
|
|
318
323
|
).void
|
|
319
324
|
end
|
|
320
|
-
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
|
|
321
326
|
|
|
322
327
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
323
328
|
def to_h; end
|
|
@@ -676,8 +681,8 @@ module Altertable
|
|
|
676
681
|
end
|
|
677
682
|
|
|
678
683
|
class Base
|
|
679
|
-
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String]).void }
|
|
680
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {}); end
|
|
684
|
+
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String], options: T.untyped).void }
|
|
685
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options); end
|
|
681
686
|
|
|
682
687
|
sig do
|
|
683
688
|
params(
|
|
@@ -714,8 +719,8 @@ module Altertable
|
|
|
714
719
|
end
|
|
715
720
|
|
|
716
721
|
class FaradayAdapter < Base
|
|
717
|
-
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String]).void }
|
|
718
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {}); end
|
|
722
|
+
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String], options: T.untyped).void }
|
|
723
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options); end
|
|
719
724
|
|
|
720
725
|
sig do
|
|
721
726
|
params(
|
|
@@ -757,8 +762,8 @@ module Altertable
|
|
|
757
762
|
end
|
|
758
763
|
|
|
759
764
|
class HttpxAdapter < Base
|
|
760
|
-
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String]).void }
|
|
761
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {}); end
|
|
765
|
+
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String], options: T.untyped).void }
|
|
766
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options); end
|
|
762
767
|
|
|
763
768
|
sig do
|
|
764
769
|
params(
|
|
@@ -800,8 +805,8 @@ module Altertable
|
|
|
800
805
|
end
|
|
801
806
|
|
|
802
807
|
class NetHttpAdapter < Base
|
|
803
|
-
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String]).void }
|
|
804
|
-
def initialize(base_url:, timeout:, open_timeout:, headers: {}); end
|
|
808
|
+
sig { params(base_url: String, timeout: T.any(Integer, Float), open_timeout: T.any(Integer, Float), headers: T::Hash[String, String], options: T.untyped).void }
|
|
809
|
+
def initialize(base_url:, timeout:, open_timeout:, headers: {}, **options); end
|
|
805
810
|
|
|
806
811
|
sig do
|
|
807
812
|
params(
|
|
@@ -14,8 +14,9 @@ module Altertable
|
|
|
14
14
|
@timeout: Integer | Float
|
|
15
15
|
@open_timeout: Integer | Float
|
|
16
16
|
@headers: ::Hash[String, String]
|
|
17
|
+
@options: ::Hash[Symbol, untyped]
|
|
17
18
|
|
|
18
|
-
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
|
|
19
|
+
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String], **untyped options) -> void
|
|
19
20
|
def get: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
20
21
|
def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
21
22
|
def delete: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
@@ -24,7 +25,7 @@ module Altertable
|
|
|
24
25
|
class FaradayAdapter < Base
|
|
25
26
|
@conn: untyped
|
|
26
27
|
|
|
27
|
-
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
|
|
28
|
+
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String], **untyped options) -> void
|
|
28
29
|
def get: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
29
30
|
def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
30
31
|
def delete: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
@@ -37,7 +38,7 @@ module Altertable
|
|
|
37
38
|
class HttpxAdapter < Base
|
|
38
39
|
@client: untyped
|
|
39
40
|
|
|
40
|
-
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
|
|
41
|
+
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String], **untyped options) -> void
|
|
41
42
|
def get: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
42
43
|
def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
43
44
|
def delete: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
@@ -50,7 +51,7 @@ module Altertable
|
|
|
50
51
|
class NetHttpAdapter < Base
|
|
51
52
|
@uri: URI::HTTP | URI::HTTPS
|
|
52
53
|
|
|
53
|
-
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
|
|
54
|
+
def initialize: (base_url: String, timeout: Integer | Float, open_timeout: Integer | Float, ?headers: ::Hash[String, String], **untyped options) -> void
|
|
54
55
|
def get: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
55
56
|
def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
56
57
|
def delete: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped], ?headers: ::Hash[String, String]) -> Response
|
|
@@ -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]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: altertable-lakehouse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Altertable AI
|
|
@@ -121,6 +121,20 @@ dependencies:
|
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
123
|
version: '1.50'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: stub_env
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0'
|
|
131
|
+
type: :development
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0'
|
|
124
138
|
- !ruby/object:Gem::Dependency
|
|
125
139
|
name: testcontainers
|
|
126
140
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -184,10 +198,13 @@ executables: []
|
|
|
184
198
|
extensions: []
|
|
185
199
|
extra_rdoc_files: []
|
|
186
200
|
files:
|
|
201
|
+
- ".github/FUNDING.yml"
|
|
187
202
|
- ".github/ISSUE_TEMPLATE/bug_report.yml"
|
|
188
203
|
- ".github/ISSUE_TEMPLATE/feature_request.yml"
|
|
204
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
189
205
|
- ".github/workflows/ci.yml"
|
|
190
206
|
- ".github/workflows/release-please.yml"
|
|
207
|
+
- ".github/workflows/semantic-pr.yml"
|
|
191
208
|
- ".github/workflows/semantic-pull-request.yml"
|
|
192
209
|
- ".gitignore"
|
|
193
210
|
- ".gitmodules"
|