quicknode_sdk 0.4.0-x86_64-linux → 0.5.0-x86_64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0cc62b41ce1ccfe58aae591f19031672ec62d55cb42e414c9f3567da9e5fac4
4
- data.tar.gz: 67b845d63c6663806efe2f1ada01db25e932aa1f61e48be1a0a95910d9505eed
3
+ metadata.gz: cdd0567be01e72a476fed68f5fb0a298c7777c6048971c32218d78485ada5c61
4
+ data.tar.gz: 490893c43810b35f1240fcb792371f46960912fac3300cc5040ac68bc107b696
5
5
  SHA512:
6
- metadata.gz: 80accd7f523a3a36220c7fa85afab17dffceee9a61c828858fa4b92c91d335cc2ad6643bf9bda792005d42b92ea0b4a65f496b6ce25251869f76d8a9ed98685c
7
- data.tar.gz: aa30812e7fca37b93cb6944208eb7a96de650a5e7708ca4e1d05533ea3ab3cf14397ed6cc0e5b281f44b11b21d33fb6ca7466f718246e89a8b8699221164326a
6
+ metadata.gz: 92b6525f4e7cbf807118f8e904a9dd07671611d78ee5dbd38669580f9320a1cb433829454dc2da22855cbfeab3b131296b62b6d3a3664eea1d40905d92cae653
7
+ data.tar.gz: 668bd756854567423ad1f5a35d0efc48e0c61420b501734802a29e0a31ddbdcb32f012506ceafb499a2024d1838e87324dfe6d8b5bd85ef26d0119bb88abb43b
data/README.md CHANGED
@@ -46,6 +46,7 @@ This is one of four language bindings published from the same Rust core. See the
46
46
  - [KV Store Client](#kv-store-client)
47
47
  - [Sets](#sets)
48
48
  - [Lists](#lists)
49
+ - [SQL Client](#sql-client)
49
50
  - [Error Handling](#error-handling)
50
51
  - [License](#license)
51
52
 
@@ -55,7 +56,7 @@ This is one of four language bindings published from the same Rust core. See the
55
56
 
56
57
  ## Quick Start
57
58
 
58
- Construct the SDK once, then reach into the four sub-clients (`admin`, `streams`, `webhooks`, `kvstore`). Subsequent API Reference snippets assume you have a `qn` handle from one of these blocks.
59
+ Construct the SDK once, then reach into the five sub-clients (`admin`, `streams`, `webhooks`, `kvstore`, `sql`). Subsequent API Reference snippets assume you have a `qn` handle from one of these blocks.
59
60
 
60
61
  ```ruby
61
62
  # Ruby
@@ -94,6 +95,7 @@ Environment variables (prefix `QN_SDK__`, separator `__`):
94
95
  | `QN_SDK__STREAMS__BASE_URL` | no | `https://api.quicknode.com/streams/rest/v1/` | Override streams base URL |
95
96
  | `QN_SDK__WEBHOOKS__BASE_URL` | no | `https://api.quicknode.com/webhooks/rest/v1/` | Override webhooks base URL |
96
97
  | `QN_SDK__KVSTORE__BASE_URL` | no | `https://api.quicknode.com/kv/rest/v1/` | Override KV store base URL |
98
+ | `QN_SDK__SQL__BASE_URL` | no | `https://api.quicknode.com/sql/rest/v1/` | Override SQL Explorer base URL |
97
99
  | `QN_SDK__HTTP__HEADERS__<NAME>` | no | — | Custom HTTP header sent on every request. Overrides SDK-managed headers (see below). |
98
100
 
99
101
  ### Custom headers and `User-Agent`
@@ -1613,6 +1615,44 @@ Deletes a list and all of its items.
1613
1615
  qn.kvstore.delete_list(key: "my-list")
1614
1616
  ```
1615
1617
 
1618
+ ---
1619
+
1620
+ ### SQL Client
1621
+
1622
+ Accessed as `qn.sql`. Runs SQL queries against indexed blockchain data and fetches the database schema. Backed by `https://api.quicknode.com/sql/rest/v1/`.
1623
+
1624
+ ##### `query`
1625
+
1626
+ Executes a SQL query against a cluster and returns the result set. Paginate by writing `LIMIT`/`OFFSET` into the SQL.
1627
+
1628
+ **Parameters** (Hash): `query:` (String, required), `cluster_id:` (String, required).
1629
+
1630
+ **Returns** a Hash with `meta` (column metadata, each with `name` and `type`), `data` (rows as Hashes keyed by column name), `rows`, `rows_before_limit_at_least`, `statistics` (`elapsed`, `rows_read`, `bytes_read`), and `credits`. Access with `[]` or `dig`.
1631
+
1632
+ ```ruby
1633
+ # Ruby
1634
+ resp = qn.sql.query(
1635
+ query: "SELECT action_type, user FROM hyperliquid_system_actions ORDER BY block_time DESC LIMIT 100",
1636
+ cluster_id: "hyperliquid-core-mainnet"
1637
+ )
1638
+ puts resp[:rows]
1639
+ puts resp[:data].first
1640
+ ```
1641
+
1642
+ ##### `get_schema`
1643
+
1644
+ Fetches the database schema for a cluster: table names, columns, types, sort keys, and partition strategies.
1645
+
1646
+ **Parameters** (Hash): `cluster_id:` (String, required).
1647
+
1648
+ **Returns** a Hash with `chain`, `cluster_id`, and `tables` (each with `name`, `engine`, `total_rows`, `partition_key`, `sorting_key`, and `columns` of `{ name, type }`).
1649
+
1650
+ ```ruby
1651
+ # Ruby
1652
+ schema = qn.sql.get_schema(cluster_id: "hyperliquid-core-mainnet")
1653
+ puts schema[:tables].length
1654
+ ```
1655
+
1616
1656
  ## Error Handling
1617
1657
 
1618
1658
  Every binding exposes a typed exception hierarchy derived from the core `SdkError`
@@ -0,0 +1,4 @@
1
+ module QuicknodeSdk
2
+ class Sql < NativeDelegator
3
+ end
4
+ end
Binary file
@@ -34,5 +34,9 @@ module QuicknodeSdk
34
34
  def kvstore
35
35
  KvStore.new(@native.kvstore)
36
36
  end
37
+
38
+ def sql
39
+ Sql.new(@native.sql)
40
+ end
37
41
  end
38
42
  end
data/lib/quicknode_sdk.rb CHANGED
@@ -13,4 +13,5 @@ require_relative "quicknode_sdk/clients/admin"
13
13
  require_relative "quicknode_sdk/clients/streams"
14
14
  require_relative "quicknode_sdk/clients/webhooks"
15
15
  require_relative "quicknode_sdk/clients/kvstore"
16
+ require_relative "quicknode_sdk/clients/sql"
16
17
  require_relative "quicknode_sdk/sdk"
@@ -33,6 +33,7 @@ module QuicknodeSdk
33
33
  def streams: () -> Streams
34
34
  def webhooks: () -> Webhooks
35
35
  def kvstore: () -> KvStore
36
+ def sql: () -> Sql
36
37
  end
37
38
 
38
39
  class DestinationAttributes
@@ -158,4 +159,11 @@ module QuicknodeSdk
158
159
  def delete_list_item: (key: String, item: String) -> void
159
160
  def delete_list: (key: String) -> void
160
161
  end
162
+
163
+ class Sql
164
+ def initialize: (untyped native) -> void
165
+
166
+ def query: (query: String, cluster_id: String) -> untyped
167
+ def get_schema: (cluster_id: String) -> untyped
168
+ end
161
169
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quicknode_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Quicknode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-24 00:00:00.000000000 Z
11
+ date: 2026-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -34,6 +34,7 @@ files:
34
34
  - lib/quicknode_sdk.rb
35
35
  - lib/quicknode_sdk/clients/admin.rb
36
36
  - lib/quicknode_sdk/clients/kvstore.rb
37
+ - lib/quicknode_sdk/clients/sql.rb
37
38
  - lib/quicknode_sdk/clients/streams.rb
38
39
  - lib/quicknode_sdk/clients/webhooks.rb
39
40
  - lib/quicknode_sdk/native_delegator.rb