@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 06:00 UTC

main
ts 38 lines 1.23 KB
Raw
1 import * as DynamoDB from "@distilled.cloud/aws/dynamodb";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Table } from "./Table.ts";
5
6 export interface ExecuteStatementRequest extends DynamoDB.ExecuteStatementInput {}
7
8 /**
9 * Runtime binding for DynamoDB PartiQL `ExecuteStatement`.
10 *
11 * This binding scopes IAM to a specific table, but the statement text is still
12 * user-provided. Statements must only reference the bound table or its indexes.
13 * ### PartiQL
14 * **Example:** Execute a Statement Against One Table
15 * ```typescript
16 * const executeStatement = yield* AWS.DynamoDB.ExecuteStatement(table);
17 *
18 * const response = yield* executeStatement({
19 * Statement: `SELECT * FROM "${yield* table.tableName}" WHERE pk=?`,
20 * Parameters: [{ S: "user#1" }],
21 * });
22 * ```
23 *
24 * @binding
25 */
26 export interface ExecuteStatement extends Binding.Service<
27 ExecuteStatement,
28 "AWS.DynamoDB.ExecuteStatement",
29 <T extends Table>(
30 table: T,
31 ) => Effect.Effect<
32 (
33 request: ExecuteStatementRequest,
34 ) => Effect.Effect<DynamoDB.ExecuteStatementOutput, DynamoDB.ExecuteStatementError>
35 >
36 > {}
37
38 export const ExecuteStatement = Binding.Service<ExecuteStatement>("AWS.DynamoDB.ExecuteStatement");