@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 42 lines 1.27 KB
Raw
1 import type * as glue from "@distilled.cloud/aws/glue";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Table } from "./Table.ts";
5
6 export interface GetTableRequest extends Omit<
7 glue.GetTableRequest,
8 "DatabaseName" | "Name" | "CatalogId"
9 > {}
10
11 /**
12 * Runtime binding for `glue:GetTable`.
13 *
14 * Reads the bound {@link Table}'s full catalog definition — columns, storage
15 * descriptor, partition keys, and parameters — so a function can introspect
16 * the schema it is writing against. The database/table names and catalog id
17 * are injected from the binding. Provide the implementation with
18 * `Effect.provide(AWS.Glue.GetTableHttp)`.
19 * ### Reading the Data Catalog
20 * **Example:** Introspect the Table Schema
21 * ```typescript
22 * // init
23 * const getTable = yield* AWS.Glue.GetTable(table);
24 *
25 * // runtime
26 * const { Table } = yield* getTable();
27 * const columns = Table?.StorageDescriptor?.Columns ?? [];
28 * ```
29 *
30 * @binding
31 */
32 export interface GetTable extends Binding.Service<
33 GetTable,
34 "AWS.Glue.GetTable",
35 (
36 table: Table,
37 ) => Effect.Effect<
38 (request?: GetTableRequest) => Effect.Effect<glue.GetTableResponse, glue.GetTableError>
39 >
40 > {}
41
42 export const GetTable = Binding.Service<GetTable>("AWS.Glue.GetTable");