| 1 | import type * as SVC from "@distilled.cloud/aws/finspace"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { KxEnvironment } from "./KxEnvironment.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `finspace:UpdateKxDataview` — advances a dataview of a kdb database in the bound environment to a new changeset (or new segment configurations) — how ingestion pipelines roll fresh data out to readers. |
| 8 | * Provide the implementation with |
| 9 | * `Effect.provide(AWS.FinSpace.UpdateKxDataviewHttp)`. |
| 10 | * ### Managing Dataviews |
| 11 | * **Example:** Advance a Dataview to a Changeset |
| 12 | * ```typescript |
| 13 | * const updateDataview = yield* AWS.FinSpace.UpdateKxDataview(kdb); |
| 14 | * |
| 15 | * yield* updateDataview({ |
| 16 | * databaseName: "ticks", |
| 17 | * dataviewName: "latest", |
| 18 | * changesetId, |
| 19 | * clientToken: crypto.randomUUID(), |
| 20 | * }); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface UpdateKxDataview extends Binding.Service< |
| 26 | UpdateKxDataview, |
| 27 | "AWS.FinSpace.UpdateKxDataview", |
| 28 | <K extends KxEnvironment>( |
| 29 | environment: K, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<SVC.UpdateKxDataviewRequest, "environmentId">, |
| 33 | ) => Effect.Effect<SVC.UpdateKxDataviewResponse, SVC.UpdateKxDataviewError> |
| 34 | > |
| 35 | > {} |
| 36 | export const UpdateKxDataview = Binding.Service<UpdateKxDataview>( |
| 37 | "AWS.FinSpace.UpdateKxDataview", |
| 38 | ); |