robosystems-client 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl
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.
Potentially problematic release.
This version of robosystems-client might be problematic. Click here for more details.
- robosystems_client/api/agent/auto_select_agent.py +1 -41
- robosystems_client/api/agent/batch_process_queries.py +1 -41
- robosystems_client/api/agent/execute_specific_agent.py +1 -41
- robosystems_client/api/agent/get_agent_metadata.py +5 -49
- robosystems_client/api/agent/list_agents.py +4 -42
- robosystems_client/api/agent/recommend_agent.py +5 -45
- robosystems_client/api/auth/generate_sso_token.py +0 -18
- robosystems_client/api/auth/get_current_auth_user.py +14 -74
- robosystems_client/api/auth/logout_user.py +14 -50
- robosystems_client/api/auth/refresh_auth_session.py +14 -50
- robosystems_client/api/auth/resend_verification_email.py +14 -74
- robosystems_client/api/backup/create_backup.py +5 -45
- robosystems_client/api/backup/get_backup_download_url.py +4 -42
- robosystems_client/api/backup/get_backup_stats.py +5 -49
- robosystems_client/api/backup/list_backups.py +4 -42
- robosystems_client/api/backup/restore_backup.py +5 -45
- robosystems_client/api/connections/create_connection.py +5 -45
- robosystems_client/api/connections/create_link_token.py +5 -45
- robosystems_client/api/connections/delete_connection.py +5 -49
- robosystems_client/api/connections/exchange_link_token.py +5 -45
- robosystems_client/api/connections/get_connection.py +5 -49
- robosystems_client/api/connections/get_connection_options.py +5 -49
- robosystems_client/api/connections/init_o_auth.py +5 -45
- robosystems_client/api/connections/list_connections.py +4 -42
- robosystems_client/api/connections/oauth_callback.py +5 -45
- robosystems_client/api/connections/sync_connection.py +5 -45
- robosystems_client/api/graph_analytics/get_graph_metrics.py +5 -49
- robosystems_client/api/graph_analytics/get_graph_usage_stats.py +4 -42
- robosystems_client/api/graph_billing/get_current_graph_bill.py +5 -49
- robosystems_client/api/graph_billing/get_graph_billing_history.py +4 -42
- robosystems_client/api/graph_billing/get_graph_monthly_bill.py +5 -49
- robosystems_client/api/graph_billing/get_graph_usage_details.py +4 -42
- robosystems_client/api/graph_credits/check_credit_balance.py +0 -38
- robosystems_client/api/graph_credits/check_storage_limits.py +1 -45
- robosystems_client/api/graph_credits/get_credit_summary.py +1 -45
- robosystems_client/api/graph_credits/get_storage_usage.py +0 -38
- robosystems_client/api/graph_credits/list_credit_transactions.py +4 -42
- robosystems_client/api/graph_health/get_database_health.py +5 -49
- robosystems_client/api/graph_info/get_database_info.py +5 -49
- robosystems_client/api/graph_limits/get_graph_limits.py +5 -49
- robosystems_client/api/graphs/create_graph.py +21 -57
- robosystems_client/api/graphs/get_available_extensions.py +131 -15
- robosystems_client/api/graphs/get_graphs.py +154 -79
- robosystems_client/api/graphs/select_graph.py +117 -49
- robosystems_client/api/mcp/call_mcp_tool.py +24 -47
- robosystems_client/api/mcp/list_mcp_tools.py +13 -61
- robosystems_client/api/operations/cancel_operation.py +1 -45
- robosystems_client/api/operations/get_operation_status.py +1 -45
- robosystems_client/api/query/execute_cypher_query.py +69 -53
- robosystems_client/api/schema/export_graph_schema.py +223 -65
- robosystems_client/api/schema/get_graph_schema.py +137 -79
- robosystems_client/api/schema/validate_schema.py +5 -45
- robosystems_client/api/subgraphs/create_subgraph.py +5 -45
- robosystems_client/api/subgraphs/delete_subgraph.py +5 -45
- robosystems_client/api/subgraphs/get_subgraph_info.py +5 -49
- robosystems_client/api/subgraphs/get_subgraph_quota.py +5 -49
- robosystems_client/api/subgraphs/list_subgraphs.py +5 -49
- robosystems_client/api/tables/delete_file.py +181 -301
- robosystems_client/api/tables/get_file_info.py +117 -265
- robosystems_client/api/tables/get_upload_url.py +193 -389
- robosystems_client/api/tables/ingest_tables.py +277 -465
- robosystems_client/api/tables/list_table_files.py +193 -373
- robosystems_client/api/tables/list_tables.py +189 -361
- robosystems_client/api/tables/query_tables.py +85 -141
- robosystems_client/api/tables/update_file_status.py +205 -349
- robosystems_client/api/user/create_user_api_key.py +1 -41
- robosystems_client/api/user/get_all_credit_summaries.py +14 -111
- robosystems_client/api/user/get_current_user.py +14 -75
- robosystems_client/api/user/list_user_api_keys.py +14 -75
- robosystems_client/api/user/revoke_user_api_key.py +1 -45
- robosystems_client/api/user/update_user.py +1 -41
- robosystems_client/api/user/update_user_api_key.py +1 -41
- robosystems_client/api/user/update_user_password.py +1 -41
- robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -38
- robosystems_client/api/user_analytics/get_user_usage_overview.py +14 -75
- robosystems_client/api/user_limits/get_all_shared_repository_limits.py +14 -105
- robosystems_client/api/user_limits/get_shared_repository_limits.py +1 -45
- robosystems_client/api/user_limits/get_user_limits.py +14 -75
- robosystems_client/api/user_limits/get_user_usage.py +14 -75
- robosystems_client/api/user_subscriptions/cancel_shared_repository_subscription.py +1 -45
- robosystems_client/api/user_subscriptions/get_repository_credits.py +1 -45
- robosystems_client/api/user_subscriptions/get_shared_repository_credits.py +14 -75
- robosystems_client/api/user_subscriptions/get_user_shared_subscriptions.py +0 -38
- robosystems_client/api/user_subscriptions/subscribe_to_shared_repository.py +1 -41
- robosystems_client/api/user_subscriptions/upgrade_shared_repository_subscription.py +1 -41
- robosystems_client/extensions/__init__.py +8 -1
- robosystems_client/extensions/auth_integration.py +1 -2
- robosystems_client/extensions/query_client.py +3 -2
- robosystems_client/extensions/sse_client.py +1 -1
- robosystems_client/extensions/table_ingest_client.py +5 -0
- robosystems_client/extensions/utils.py +2 -2
- robosystems_client/models/__init__.py +4 -4
- robosystems_client/models/create_graph_request.py +4 -3
- robosystems_client/models/cypher_query_request.py +5 -22
- robosystems_client/models/schema_export_response.py +4 -2
- robosystems_client/models/schema_info_response.py +77 -0
- robosystems_client/models/{get_graph_schema_response_getgraphschema.py → schema_info_response_schema.py} +6 -6
- robosystems_client/models/schema_validation_response.py +7 -6
- robosystems_client/models/table_query_request.py +37 -2
- {robosystems_client-0.2.3.dist-info → robosystems_client-0.2.4.dist-info}/METADATA +2 -4
- {robosystems_client-0.2.3.dist-info → robosystems_client-0.2.4.dist-info}/RECORD +103 -102
- {robosystems_client-0.2.3.dist-info → robosystems_client-0.2.4.dist-info}/WHEEL +0 -0
- {robosystems_client-0.2.3.dist-info → robosystems_client-0.2.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,35 +9,19 @@ from ...models.error_response import ErrorResponse
|
|
|
9
9
|
from ...models.http_validation_error import HTTPValidationError
|
|
10
10
|
from ...models.table_query_request import TableQueryRequest
|
|
11
11
|
from ...models.table_query_response import TableQueryResponse
|
|
12
|
-
from ...types import
|
|
12
|
+
from ...types import Response
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def _get_kwargs(
|
|
16
16
|
graph_id: str,
|
|
17
17
|
*,
|
|
18
18
|
body: TableQueryRequest,
|
|
19
|
-
token: Union[None, Unset, str] = UNSET,
|
|
20
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
21
19
|
) -> dict[str, Any]:
|
|
22
20
|
headers: dict[str, Any] = {}
|
|
23
|
-
if not isinstance(authorization, Unset):
|
|
24
|
-
headers["authorization"] = authorization
|
|
25
|
-
|
|
26
|
-
params: dict[str, Any] = {}
|
|
27
|
-
|
|
28
|
-
json_token: Union[None, Unset, str]
|
|
29
|
-
if isinstance(token, Unset):
|
|
30
|
-
json_token = UNSET
|
|
31
|
-
else:
|
|
32
|
-
json_token = token
|
|
33
|
-
params["token"] = json_token
|
|
34
|
-
|
|
35
|
-
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
36
21
|
|
|
37
22
|
_kwargs: dict[str, Any] = {
|
|
38
23
|
"method": "post",
|
|
39
24
|
"url": f"/v1/graphs/{graph_id}/tables/query",
|
|
40
|
-
"params": params,
|
|
41
25
|
}
|
|
42
26
|
|
|
43
27
|
_kwargs["json"] = body.to_dict()
|
|
@@ -110,17 +94,23 @@ def sync_detailed(
|
|
|
110
94
|
*,
|
|
111
95
|
client: AuthenticatedClient,
|
|
112
96
|
body: TableQueryRequest,
|
|
113
|
-
token: Union[None, Unset, str] = UNSET,
|
|
114
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
115
97
|
) -> Response[Union[Any, ErrorResponse, HTTPValidationError, TableQueryResponse]]:
|
|
116
|
-
"""Query Staging Tables with SQL
|
|
98
|
+
r"""Query Staging Tables with SQL
|
|
117
99
|
|
|
118
100
|
Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
119
101
|
|
|
120
|
-
**Purpose:**
|
|
121
102
|
Query raw staging data directly with SQL before ingestion into the graph database.
|
|
122
103
|
Useful for data quality checks, validation, and exploratory analysis.
|
|
123
104
|
|
|
105
|
+
**Security Best Practice - Use Parameterized Queries:**
|
|
106
|
+
ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
|
|
107
|
+
- ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: [\"Company\", 100]`
|
|
108
|
+
- ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated
|
|
109
|
+
into SQL string
|
|
110
|
+
|
|
111
|
+
Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters
|
|
112
|
+
array.
|
|
113
|
+
|
|
124
114
|
**Use Cases:**
|
|
125
115
|
- Validate data quality before graph ingestion
|
|
126
116
|
- Inspect row-level data for debugging
|
|
@@ -140,27 +130,15 @@ def sync_detailed(
|
|
|
140
130
|
- Aggregations, window functions, CTEs
|
|
141
131
|
- Multiple table joins across staging area
|
|
142
132
|
|
|
143
|
-
**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
SELECT identifier, COUNT(*) as cnt
|
|
153
|
-
FROM Entity
|
|
154
|
-
GROUP BY identifier
|
|
155
|
-
HAVING COUNT(*) > 1;
|
|
156
|
-
|
|
157
|
-
-- Join across tables
|
|
158
|
-
SELECT e.name, COUNT(t.id) as transaction_count
|
|
159
|
-
FROM Entity e
|
|
160
|
-
LEFT JOIN Transaction t ON e.identifier = t.entity_id
|
|
161
|
-
GROUP BY e.name
|
|
162
|
-
ORDER BY transaction_count DESC;
|
|
163
|
-
```
|
|
133
|
+
**Common Operations:**
|
|
134
|
+
- Count rows: `SELECT COUNT(*) FROM Entity`
|
|
135
|
+
- Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters:
|
|
136
|
+
[\"Company\", 100]`
|
|
137
|
+
- Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
|
|
138
|
+
- Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING
|
|
139
|
+
COUNT(*) > 1`
|
|
140
|
+
- Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters:
|
|
141
|
+
[1000, \"2024-01-01\"]`
|
|
164
142
|
|
|
165
143
|
**Limits:**
|
|
166
144
|
- Query timeout: 30 seconds
|
|
@@ -173,12 +151,10 @@ def sync_detailed(
|
|
|
173
151
|
Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
174
152
|
|
|
175
153
|
**Note:**
|
|
176
|
-
Staging table queries are included - no credit consumption
|
|
154
|
+
Staging table queries are included - no credit consumption
|
|
177
155
|
|
|
178
156
|
Args:
|
|
179
|
-
graph_id (str):
|
|
180
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
181
|
-
authorization (Union[None, Unset, str]):
|
|
157
|
+
graph_id (str):
|
|
182
158
|
body (TableQueryRequest):
|
|
183
159
|
|
|
184
160
|
Raises:
|
|
@@ -192,8 +168,6 @@ def sync_detailed(
|
|
|
192
168
|
kwargs = _get_kwargs(
|
|
193
169
|
graph_id=graph_id,
|
|
194
170
|
body=body,
|
|
195
|
-
token=token,
|
|
196
|
-
authorization=authorization,
|
|
197
171
|
)
|
|
198
172
|
|
|
199
173
|
response = client.get_httpx_client().request(
|
|
@@ -208,17 +182,23 @@ def sync(
|
|
|
208
182
|
*,
|
|
209
183
|
client: AuthenticatedClient,
|
|
210
184
|
body: TableQueryRequest,
|
|
211
|
-
token: Union[None, Unset, str] = UNSET,
|
|
212
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
213
185
|
) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, TableQueryResponse]]:
|
|
214
|
-
"""Query Staging Tables with SQL
|
|
186
|
+
r"""Query Staging Tables with SQL
|
|
215
187
|
|
|
216
188
|
Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
217
189
|
|
|
218
|
-
**Purpose:**
|
|
219
190
|
Query raw staging data directly with SQL before ingestion into the graph database.
|
|
220
191
|
Useful for data quality checks, validation, and exploratory analysis.
|
|
221
192
|
|
|
193
|
+
**Security Best Practice - Use Parameterized Queries:**
|
|
194
|
+
ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
|
|
195
|
+
- ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: [\"Company\", 100]`
|
|
196
|
+
- ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated
|
|
197
|
+
into SQL string
|
|
198
|
+
|
|
199
|
+
Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters
|
|
200
|
+
array.
|
|
201
|
+
|
|
222
202
|
**Use Cases:**
|
|
223
203
|
- Validate data quality before graph ingestion
|
|
224
204
|
- Inspect row-level data for debugging
|
|
@@ -238,27 +218,15 @@ def sync(
|
|
|
238
218
|
- Aggregations, window functions, CTEs
|
|
239
219
|
- Multiple table joins across staging area
|
|
240
220
|
|
|
241
|
-
**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
SELECT identifier, COUNT(*) as cnt
|
|
251
|
-
FROM Entity
|
|
252
|
-
GROUP BY identifier
|
|
253
|
-
HAVING COUNT(*) > 1;
|
|
254
|
-
|
|
255
|
-
-- Join across tables
|
|
256
|
-
SELECT e.name, COUNT(t.id) as transaction_count
|
|
257
|
-
FROM Entity e
|
|
258
|
-
LEFT JOIN Transaction t ON e.identifier = t.entity_id
|
|
259
|
-
GROUP BY e.name
|
|
260
|
-
ORDER BY transaction_count DESC;
|
|
261
|
-
```
|
|
221
|
+
**Common Operations:**
|
|
222
|
+
- Count rows: `SELECT COUNT(*) FROM Entity`
|
|
223
|
+
- Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters:
|
|
224
|
+
[\"Company\", 100]`
|
|
225
|
+
- Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
|
|
226
|
+
- Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING
|
|
227
|
+
COUNT(*) > 1`
|
|
228
|
+
- Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters:
|
|
229
|
+
[1000, \"2024-01-01\"]`
|
|
262
230
|
|
|
263
231
|
**Limits:**
|
|
264
232
|
- Query timeout: 30 seconds
|
|
@@ -271,12 +239,10 @@ def sync(
|
|
|
271
239
|
Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
272
240
|
|
|
273
241
|
**Note:**
|
|
274
|
-
Staging table queries are included - no credit consumption
|
|
242
|
+
Staging table queries are included - no credit consumption
|
|
275
243
|
|
|
276
244
|
Args:
|
|
277
|
-
graph_id (str):
|
|
278
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
279
|
-
authorization (Union[None, Unset, str]):
|
|
245
|
+
graph_id (str):
|
|
280
246
|
body (TableQueryRequest):
|
|
281
247
|
|
|
282
248
|
Raises:
|
|
@@ -291,8 +257,6 @@ def sync(
|
|
|
291
257
|
graph_id=graph_id,
|
|
292
258
|
client=client,
|
|
293
259
|
body=body,
|
|
294
|
-
token=token,
|
|
295
|
-
authorization=authorization,
|
|
296
260
|
).parsed
|
|
297
261
|
|
|
298
262
|
|
|
@@ -301,17 +265,23 @@ async def asyncio_detailed(
|
|
|
301
265
|
*,
|
|
302
266
|
client: AuthenticatedClient,
|
|
303
267
|
body: TableQueryRequest,
|
|
304
|
-
token: Union[None, Unset, str] = UNSET,
|
|
305
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
306
268
|
) -> Response[Union[Any, ErrorResponse, HTTPValidationError, TableQueryResponse]]:
|
|
307
|
-
"""Query Staging Tables with SQL
|
|
269
|
+
r"""Query Staging Tables with SQL
|
|
308
270
|
|
|
309
271
|
Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
310
272
|
|
|
311
|
-
**Purpose:**
|
|
312
273
|
Query raw staging data directly with SQL before ingestion into the graph database.
|
|
313
274
|
Useful for data quality checks, validation, and exploratory analysis.
|
|
314
275
|
|
|
276
|
+
**Security Best Practice - Use Parameterized Queries:**
|
|
277
|
+
ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
|
|
278
|
+
- ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: [\"Company\", 100]`
|
|
279
|
+
- ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated
|
|
280
|
+
into SQL string
|
|
281
|
+
|
|
282
|
+
Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters
|
|
283
|
+
array.
|
|
284
|
+
|
|
315
285
|
**Use Cases:**
|
|
316
286
|
- Validate data quality before graph ingestion
|
|
317
287
|
- Inspect row-level data for debugging
|
|
@@ -331,27 +301,15 @@ async def asyncio_detailed(
|
|
|
331
301
|
- Aggregations, window functions, CTEs
|
|
332
302
|
- Multiple table joins across staging area
|
|
333
303
|
|
|
334
|
-
**
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
SELECT identifier, COUNT(*) as cnt
|
|
344
|
-
FROM Entity
|
|
345
|
-
GROUP BY identifier
|
|
346
|
-
HAVING COUNT(*) > 1;
|
|
347
|
-
|
|
348
|
-
-- Join across tables
|
|
349
|
-
SELECT e.name, COUNT(t.id) as transaction_count
|
|
350
|
-
FROM Entity e
|
|
351
|
-
LEFT JOIN Transaction t ON e.identifier = t.entity_id
|
|
352
|
-
GROUP BY e.name
|
|
353
|
-
ORDER BY transaction_count DESC;
|
|
354
|
-
```
|
|
304
|
+
**Common Operations:**
|
|
305
|
+
- Count rows: `SELECT COUNT(*) FROM Entity`
|
|
306
|
+
- Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters:
|
|
307
|
+
[\"Company\", 100]`
|
|
308
|
+
- Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
|
|
309
|
+
- Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING
|
|
310
|
+
COUNT(*) > 1`
|
|
311
|
+
- Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters:
|
|
312
|
+
[1000, \"2024-01-01\"]`
|
|
355
313
|
|
|
356
314
|
**Limits:**
|
|
357
315
|
- Query timeout: 30 seconds
|
|
@@ -364,12 +322,10 @@ async def asyncio_detailed(
|
|
|
364
322
|
Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
365
323
|
|
|
366
324
|
**Note:**
|
|
367
|
-
Staging table queries are included - no credit consumption
|
|
325
|
+
Staging table queries are included - no credit consumption
|
|
368
326
|
|
|
369
327
|
Args:
|
|
370
|
-
graph_id (str):
|
|
371
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
372
|
-
authorization (Union[None, Unset, str]):
|
|
328
|
+
graph_id (str):
|
|
373
329
|
body (TableQueryRequest):
|
|
374
330
|
|
|
375
331
|
Raises:
|
|
@@ -383,8 +339,6 @@ async def asyncio_detailed(
|
|
|
383
339
|
kwargs = _get_kwargs(
|
|
384
340
|
graph_id=graph_id,
|
|
385
341
|
body=body,
|
|
386
|
-
token=token,
|
|
387
|
-
authorization=authorization,
|
|
388
342
|
)
|
|
389
343
|
|
|
390
344
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -397,17 +351,23 @@ async def asyncio(
|
|
|
397
351
|
*,
|
|
398
352
|
client: AuthenticatedClient,
|
|
399
353
|
body: TableQueryRequest,
|
|
400
|
-
token: Union[None, Unset, str] = UNSET,
|
|
401
|
-
authorization: Union[None, Unset, str] = UNSET,
|
|
402
354
|
) -> Optional[Union[Any, ErrorResponse, HTTPValidationError, TableQueryResponse]]:
|
|
403
|
-
"""Query Staging Tables with SQL
|
|
355
|
+
r"""Query Staging Tables with SQL
|
|
404
356
|
|
|
405
357
|
Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
406
358
|
|
|
407
|
-
**Purpose:**
|
|
408
359
|
Query raw staging data directly with SQL before ingestion into the graph database.
|
|
409
360
|
Useful for data quality checks, validation, and exploratory analysis.
|
|
410
361
|
|
|
362
|
+
**Security Best Practice - Use Parameterized Queries:**
|
|
363
|
+
ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
|
|
364
|
+
- ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: [\"Company\", 100]`
|
|
365
|
+
- ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated
|
|
366
|
+
into SQL string
|
|
367
|
+
|
|
368
|
+
Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters
|
|
369
|
+
array.
|
|
370
|
+
|
|
411
371
|
**Use Cases:**
|
|
412
372
|
- Validate data quality before graph ingestion
|
|
413
373
|
- Inspect row-level data for debugging
|
|
@@ -427,27 +387,15 @@ async def asyncio(
|
|
|
427
387
|
- Aggregations, window functions, CTEs
|
|
428
388
|
- Multiple table joins across staging area
|
|
429
389
|
|
|
430
|
-
**
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
SELECT identifier, COUNT(*) as cnt
|
|
440
|
-
FROM Entity
|
|
441
|
-
GROUP BY identifier
|
|
442
|
-
HAVING COUNT(*) > 1;
|
|
443
|
-
|
|
444
|
-
-- Join across tables
|
|
445
|
-
SELECT e.name, COUNT(t.id) as transaction_count
|
|
446
|
-
FROM Entity e
|
|
447
|
-
LEFT JOIN Transaction t ON e.identifier = t.entity_id
|
|
448
|
-
GROUP BY e.name
|
|
449
|
-
ORDER BY transaction_count DESC;
|
|
450
|
-
```
|
|
390
|
+
**Common Operations:**
|
|
391
|
+
- Count rows: `SELECT COUNT(*) FROM Entity`
|
|
392
|
+
- Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters:
|
|
393
|
+
[\"Company\", 100]`
|
|
394
|
+
- Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
|
|
395
|
+
- Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING
|
|
396
|
+
COUNT(*) > 1`
|
|
397
|
+
- Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters:
|
|
398
|
+
[1000, \"2024-01-01\"]`
|
|
451
399
|
|
|
452
400
|
**Limits:**
|
|
453
401
|
- Query timeout: 30 seconds
|
|
@@ -460,12 +408,10 @@ async def asyncio(
|
|
|
460
408
|
Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
461
409
|
|
|
462
410
|
**Note:**
|
|
463
|
-
Staging table queries are included - no credit consumption
|
|
411
|
+
Staging table queries are included - no credit consumption
|
|
464
412
|
|
|
465
413
|
Args:
|
|
466
|
-
graph_id (str):
|
|
467
|
-
token (Union[None, Unset, str]): JWT token for SSE authentication
|
|
468
|
-
authorization (Union[None, Unset, str]):
|
|
414
|
+
graph_id (str):
|
|
469
415
|
body (TableQueryRequest):
|
|
470
416
|
|
|
471
417
|
Raises:
|
|
@@ -481,7 +427,5 @@ async def asyncio(
|
|
|
481
427
|
graph_id=graph_id,
|
|
482
428
|
client=client,
|
|
483
429
|
body=body,
|
|
484
|
-
token=token,
|
|
485
|
-
authorization=authorization,
|
|
486
430
|
)
|
|
487
431
|
).parsed
|