The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import type * as athena from "@distilled.cloud/aws/athena"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { WorkGroup } from "./WorkGroup.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `athena:GetQueryResults`. |
| 8 | * |
| 9 | * Reads one page of a completed query's result set (raw rows + column |
| 10 | * metadata) — use `NextToken`/`MaxResults` to paginate large results. For the |
| 11 | * common run-and-decode flow, prefer the composite {@link Query} binding. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.Athena.GetQueryResultsHttp)`. |
| 14 | * ### Reading Results |
| 15 | * **Example:** Page Through Query Results |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the workgroup |
| 18 | * const getQueryResults = yield* AWS.Athena.GetQueryResults(workGroup); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const page = yield* getQueryResults({ QueryExecutionId: id, MaxResults: 100 }); |
| 22 | * console.log(page.ResultSet?.Rows?.length, page.NextToken); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetQueryResults extends Binding.Service< |
| 28 | GetQueryResults, |
| 29 | "AWS.Athena.GetQueryResults", |
| 30 | ( |
| 31 | workGroup: WorkGroup, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: athena.GetQueryResultsInput, |
| 35 | ) => Effect.Effect<athena.GetQueryResultsOutput, athena.GetQueryResultsError> |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const GetQueryResults = Binding.Service<GetQueryResults>("AWS.Athena.GetQueryResults"); |