@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 47 lines 1.48 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 BatchCreatePartitionRequest extends Omit<
7 glue.BatchCreatePartitionRequest,
8 "DatabaseName" | "TableName" | "CatalogId"
9 > {}
10
11 /**
12 * Runtime binding for `glue:BatchCreatePartition`.
13 *
14 * Registers up to 100 partitions on the bound {@link Table} in one call —
15 * the bulk variant of `CreatePartition` for backfills. Per-partition
16 * failures come back in the response's `Errors` list. The database/table
17 * names and catalog id are injected from the binding. Provide the
18 * implementation with `Effect.provide(AWS.Glue.BatchCreatePartitionHttp)`.
19 * ### Managing Partitions
20 * **Example:** Backfill Partitions
21 * ```typescript
22 * // init
23 * const batchCreatePartition = yield* AWS.Glue.BatchCreatePartition(table);
24 *
25 * // runtime
26 * const { Errors } = yield* batchCreatePartition({
27 * PartitionInputList: days.map((dt) => ({ Values: [dt] })),
28 * });
29 * ```
30 *
31 * @binding
32 */
33 export interface BatchCreatePartition extends Binding.Service<
34 BatchCreatePartition,
35 "AWS.Glue.BatchCreatePartition",
36 (
37 table: Table,
38 ) => Effect.Effect<
39 (
40 request: BatchCreatePartitionRequest,
41 ) => Effect.Effect<glue.BatchCreatePartitionResponse, glue.BatchCreatePartitionError>
42 >
43 > {}
44
45 export const BatchCreatePartition = Binding.Service<BatchCreatePartition>(
46 "AWS.Glue.BatchCreatePartition",
47 );