Class: Infrawrench::SqlNamespace
- Inherits:
-
Object
- Object
- Infrawrench::SqlNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.sql
Instance Method Summary collapse
-
#estimate(body:, org_id: nil, request_options: nil) ⇒ Hash
Dry-run cost estimate (e.g. BigQuery byte scan).
-
#execute(body:, org_id: nil, request_options: nil) ⇒ Hash
Run an INSERT/UPDATE/DELETE/DDL statement.
-
#initialize(transport) ⇒ SqlNamespace
constructor
private
A new instance of SqlNamespace.
-
#query(body:, org_id: nil, request_options: nil) ⇒ Hash
Run a read-only SQL query.
Constructor Details
#initialize(transport) ⇒ SqlNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SqlNamespace.
3725 3726 3727 |
# File 'lib/infrawrench/client.rb', line 3725 def initialize(transport) @transport = transport end |
Instance Method Details
#estimate(body:, org_id: nil, request_options: nil) ⇒ Hash
Dry-run cost estimate (e.g. BigQuery byte scan)
Requires permission: resources:read.
POST /api/org/orgId/sql/estimate
Raises on 400: Bad request
Raises on 404: Not found
3745 3746 3747 3748 3749 3750 3751 3752 3753 |
# File 'lib/infrawrench/client.rb', line 3745 def estimate(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sql/estimate", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#execute(body:, org_id: nil, request_options: nil) ⇒ Hash
Run an INSERT/UPDATE/DELETE/DDL statement
Requires permission: resources:execute.
POST /api/org/orgId/sql/execute
Raises on 400: Bad request
Raises on 404: Not found
3772 3773 3774 3775 3776 3777 3778 3779 3780 |
# File 'lib/infrawrench/client.rb', line 3772 def execute(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sql/execute", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#query(body:, org_id: nil, request_options: nil) ⇒ Hash
Run a read-only SQL query
Routes to the right driver: REST executeQuery (BigQuery, Databricks),
per-resource SQL driver (Neon, Turso) or account-level SQL driver
(Postgres, MySQL).
Requires permission: resources:execute.
POST /api/org/orgId/sql/query
Raises on 400: Bad request
Raises on 404: Not found
3803 3804 3805 3806 3807 3808 3809 3810 3811 |
# File 'lib/infrawrench/client.rb', line 3803 def query(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sql/query", path_params: { "orgId" => org_id }, body: body, request_options: ) end |