The best way to control Claude Code, Codex and more from any computer or phone

main
ts 41 lines 1.33 KB
Raw
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 { DataCatalog } from "./DataCatalog.ts";
5
6 /**
7 * Runtime binding for `athena:GetTableMetadata`.
8 *
9 * Reads a single table's metadata (columns, partition keys, table type) from
10 * the bound data catalog — the catalog name is injected automatically.
11 * Provide the implementation with
12 * `Effect.provide(AWS.Athena.GetTableMetadataHttp)`.
13 * ### Browsing Catalog Metadata
14 * **Example:** Read a Table's Columns
15 * ```typescript
16 * // init — bind the operation to the data catalog
17 * const getTableMetadata = yield* AWS.Athena.GetTableMetadata(catalog);
18 *
19 * // runtime
20 * const res = yield* getTableMetadata({
21 * DatabaseName: "analytics",
22 * TableName: "orders",
23 * });
24 * console.log(res.TableMetadata?.Columns?.map((c) => c.Name));
25 * ```
26 *
27 * @binding
28 */
29 export interface GetTableMetadata extends Binding.Service<
30 GetTableMetadata,
31 "AWS.Athena.GetTableMetadata",
32 (
33 catalog: DataCatalog,
34 ) => Effect.Effect<
35 (
36 request: Omit<athena.GetTableMetadataInput, "CatalogName">,
37 ) => Effect.Effect<athena.GetTableMetadataOutput, athena.GetTableMetadataError>
38 >
39 > {}
40
41 export const GetTableMetadata = Binding.Service<GetTableMetadata>("AWS.Athena.GetTableMetadata");