@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.31 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 { Database } from "./Database.ts";
5
6 export interface GetTablesRequest extends Omit<
7 glue.GetTablesRequest,
8 "DatabaseName" | "CatalogId"
9 > {}
10
11 /**
12 * Runtime binding for `glue:GetTables`.
13 *
14 * Lists the table definitions of the bound {@link Database} (optionally
15 * filtered by an `Expression` pattern, paginated via `NextToken`) — runtime
16 * schema discovery over the Data Catalog. The database name and catalog id
17 * are injected from the binding. Provide the implementation with
18 * `Effect.provide(AWS.Glue.GetTablesHttp)`.
19 * ### Reading the Data Catalog
20 * **Example:** Enumerate a Database's Tables
21 * ```typescript
22 * // init
23 * const getTables = yield* AWS.Glue.GetTables(database);
24 *
25 * // runtime
26 * const { TableList } = yield* getTables({ Expression: "events_*" });
27 * const names = (TableList ?? []).map((t) => t.Name);
28 * ```
29 *
30 * @binding
31 */
32 export interface GetTables extends Binding.Service<
33 GetTables,
34 "AWS.Glue.GetTables",
35 (
36 database: Database,
37 ) => Effect.Effect<
38 (request?: GetTablesRequest) => Effect.Effect<glue.GetTablesResponse, glue.GetTablesError>
39 >
40 > {}
41
42 export const GetTables = Binding.Service<GetTables>("AWS.Glue.GetTables");