@514labs/moose-lib 0.6.320 → 0.6.321-ci-5-ga23d35fe

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
- import { IJsonSchemaCollection as IJsonSchemaCollection$1 } from 'typia';
1
+ import { tags, IJsonSchemaCollection as IJsonSchemaCollection$1 } from 'typia';
2
2
  import { IJsonSchemaCollection } from 'typia/src/schemas/json/IJsonSchemaCollection';
3
+ import { Pattern, TagBase } from 'typia/lib/tags';
3
4
  import { Readable } from 'node:stream';
4
5
  import { ClickHouseClient, ResultSet, CommandResult } from '@clickhouse/client';
5
6
  import { Client } from '@temporalio/client';
@@ -172,19 +173,184 @@ declare class TypedBase<T, C> {
172
173
  constructor(name: string, config: C, schema?: IJsonSchemaCollection.IV3_1, columns?: Column[], validators?: TypiaValidators<T>, allowExtraFields?: boolean);
173
174
  }
174
175
 
175
- interface MaterializedViewCreateOptions {
176
- name: string;
177
- destinationTable: string;
178
- select: string;
179
- }
180
- interface PopulateTableOptions {
181
- destinationTable: string;
182
- select: string;
183
- }
184
- interface Blocks {
185
- setup: string[];
186
- teardown: string[];
187
- }
176
+ type ClickHousePrecision<P extends number> = {
177
+ _clickhouse_precision?: P;
178
+ };
179
+ declare const DecimalRegex: "^-?\\d+(\\.\\d+)?$";
180
+ type ClickHouseDecimal<P extends number, S extends number> = {
181
+ _clickhouse_precision?: P;
182
+ _clickhouse_scale?: S;
183
+ } & Pattern<typeof DecimalRegex>;
184
+ type ClickHouseFixedStringSize<N extends number> = {
185
+ _clickhouse_fixed_string_size?: N;
186
+ };
187
+ /**
188
+ * FixedString(N) - Fixed-length string of exactly N bytes.
189
+ *
190
+ * ClickHouse stores exactly N bytes, padding shorter values with null bytes.
191
+ * Values exceeding N bytes will throw an exception.
192
+ *
193
+ * Use for binary data: hashes, IP addresses, UUIDs, MAC addresses.
194
+ *
195
+ * @example
196
+ * interface BinaryData {
197
+ * md5_hash: string & FixedString<16>; // 16-byte MD5
198
+ * sha256_hash: string & FixedString<32>; // 32-byte SHA256
199
+ * }
200
+ */
201
+ type FixedString<N extends number> = string & ClickHouseFixedStringSize<N>;
202
+ type ClickHouseByteSize<N extends number> = {
203
+ _clickhouse_byte_size?: N;
204
+ };
205
+ type LowCardinality = {
206
+ _LowCardinality?: true;
207
+ };
208
+ type DateTime = Date;
209
+ type DateTime64<P extends number> = Date & ClickHousePrecision<P>;
210
+ type DateTimeString = string & tags.Format<"date-time">;
211
+ /**
212
+ * JS Date objects cannot hold microsecond precision.
213
+ * Use string as the runtime type to avoid losing information.
214
+ */
215
+ type DateTime64String<P extends number> = string & tags.Format<"date-time"> & ClickHousePrecision<P>;
216
+ type Float32 = number & ClickHouseFloat<"float32">;
217
+ type Float64 = number & ClickHouseFloat<"float64">;
218
+ type Int8 = number & ClickHouseInt<"int8">;
219
+ type Int16 = number & ClickHouseInt<"int16">;
220
+ type Int32 = number & ClickHouseInt<"int32">;
221
+ type Int64 = number & ClickHouseInt<"int64">;
222
+ type UInt8 = number & ClickHouseInt<"uint8">;
223
+ type UInt16 = number & ClickHouseInt<"uint16">;
224
+ type UInt32 = number & ClickHouseInt<"uint32">;
225
+ type UInt64 = number & ClickHouseInt<"uint64">;
226
+ type Decimal<P extends number, S extends number> = string & ClickHouseDecimal<P, S>;
227
+ /**
228
+ * Attach compression codec to a column type.
229
+ *
230
+ * Any valid ClickHouse codec expression is allowed. ClickHouse validates the codec at runtime.
231
+ *
232
+ * @template T The base data type
233
+ * @template CodecExpr The codec expression (single codec or chain)
234
+ *
235
+ * @example
236
+ * interface Metrics {
237
+ * // Single codec
238
+ * log_blob: string & ClickHouseCodec<"ZSTD(3)">;
239
+ *
240
+ * // Codec chain (processed left-to-right)
241
+ * timestamp: Date & ClickHouseCodec<"Delta, LZ4">;
242
+ * temperature: number & ClickHouseCodec<"Gorilla, ZSTD">;
243
+ *
244
+ * // Specialized codecs
245
+ * counter: number & ClickHouseCodec<"DoubleDelta">;
246
+ *
247
+ * // Can combine with other annotations
248
+ * count: UInt64 & ClickHouseCodec<"DoubleDelta, LZ4">;
249
+ * }
250
+ */
251
+ type ClickHouseCodec<CodecExpr extends string> = {
252
+ _clickhouse_codec?: CodecExpr;
253
+ };
254
+ type ClickHouseFloat<Value extends "float32" | "float64"> = tags.Type<Value extends "float32" ? "float" : "double">;
255
+ type ClickHouseInt<Value extends "int8" | "int16" | "int32" | "int64" | "uint8" | "uint16" | "uint32" | "uint64"> = Value extends "int32" | "int64" | "uint32" | "uint64" ? tags.Type<Value> : TagBase<{
256
+ target: "number";
257
+ kind: "type";
258
+ value: Value;
259
+ validate: Value extends "int8" ? "-128 <= $input && $input <= 127" : Value extends "int16" ? "-32768 <= $input && $input <= 32767" : Value extends "uint8" ? "0 <= $input && $input <= 255" : Value extends "uint16" ? "0 <= $input && $input <= 65535" : never;
260
+ exclusive: true;
261
+ schema: {
262
+ type: "integer";
263
+ };
264
+ }>;
265
+ /**
266
+ * By default, nested objects map to the `Nested` type in clickhouse.
267
+ * Write `nestedObject: AnotherInterfaceType & ClickHouseNamedTuple`
268
+ * to map AnotherInterfaceType to the named tuple type.
269
+ */
270
+ type ClickHouseNamedTuple = {
271
+ _clickhouse_mapped_type?: "namedTuple";
272
+ };
273
+ type ClickHouseJson<maxDynamicPaths extends number | undefined = undefined, maxDynamicTypes extends number | undefined = undefined, skipPaths extends string[] = [], skipRegexes extends string[] = []> = {
274
+ _clickhouse_mapped_type?: "JSON";
275
+ _clickhouse_json_settings?: {
276
+ maxDynamicPaths?: maxDynamicPaths;
277
+ maxDynamicTypes?: maxDynamicTypes;
278
+ skipPaths?: skipPaths;
279
+ skipRegexes?: skipRegexes;
280
+ };
281
+ };
282
+ type ClickHousePoint = [number, number] & {
283
+ _clickhouse_mapped_type?: "Point";
284
+ };
285
+ type ClickHouseRing = ClickHousePoint[] & {
286
+ _clickhouse_mapped_type?: "Ring";
287
+ };
288
+ type ClickHouseLineString = ClickHousePoint[] & {
289
+ _clickhouse_mapped_type?: "LineString";
290
+ };
291
+ type ClickHouseMultiLineString = ClickHouseLineString[] & {
292
+ _clickhouse_mapped_type?: "MultiLineString";
293
+ };
294
+ type ClickHousePolygon = ClickHouseRing[] & {
295
+ _clickhouse_mapped_type?: "Polygon";
296
+ };
297
+ type ClickHouseMultiPolygon = ClickHousePolygon[] & {
298
+ _clickhouse_mapped_type?: "MultiPolygon";
299
+ };
300
+ /**
301
+ * typia may have trouble handling this type.
302
+ * In which case, use {@link WithDefault} as a workaround
303
+ *
304
+ * @example
305
+ * { field: number & ClickHouseDefault<"0"> }
306
+ */
307
+ type ClickHouseDefault<SqlExpression extends string> = {
308
+ _clickhouse_default?: SqlExpression;
309
+ };
310
+ /**
311
+ * @example
312
+ * {
313
+ * ...
314
+ * timestamp: Date;
315
+ * debugMessage: string & ClickHouseTTL<"timestamp + INTERVAL 1 WEEK">;
316
+ * }
317
+ */
318
+ type ClickHouseTTL<SqlExpression extends string> = {
319
+ _clickhouse_ttl?: SqlExpression;
320
+ };
321
+ /**
322
+ * ClickHouse MATERIALIZED column annotation.
323
+ * The column value is computed at INSERT time and physically stored.
324
+ * Cannot be explicitly inserted by users.
325
+ *
326
+ * @example
327
+ * interface Events {
328
+ * eventTime: DateTime;
329
+ * // Extract date component - computed and stored at insert time
330
+ * eventDate: Date & ClickHouseMaterialized<"toDate(event_time)">;
331
+ *
332
+ * userId: string;
333
+ * // Precompute hash for fast lookups
334
+ * userHash: UInt64 & ClickHouseMaterialized<"cityHash64(userId)">;
335
+ * }
336
+ *
337
+ * @remarks
338
+ * - MATERIALIZED and DEFAULT are mutually exclusive
339
+ * - Can be combined with ClickHouseCodec for compression
340
+ * - Changing the expression modifies the column in-place (existing values preserved)
341
+ */
342
+ type ClickHouseMaterialized<SqlExpression extends string> = {
343
+ _clickhouse_materialized?: SqlExpression;
344
+ };
345
+ /**
346
+ * See also {@link ClickHouseDefault}
347
+ *
348
+ * @example{ updated_at: WithDefault<Date, "now()"> }
349
+ */
350
+ type WithDefault<T, _SqlExpression extends string> = T;
351
+ /**
352
+ * ClickHouse table engine types supported by Moose.
353
+ */
188
354
  declare enum ClickHouseEngines {
189
355
  MergeTree = "MergeTree",
190
356
  ReplacingMergeTree = "ReplacingMergeTree",
@@ -206,24 +372,6 @@ declare enum ClickHouseEngines {
206
372
  ReplicatedCollapsingMergeTree = "ReplicatedCollapsingMergeTree",
207
373
  ReplicatedVersionedCollapsingMergeTree = "ReplicatedVersionedCollapsingMergeTree"
208
374
  }
209
- /**
210
- * Drops an existing view if it exists.
211
- */
212
- declare function dropView(name: string): string;
213
- /**
214
- * Creates a materialized view.
215
- */
216
- declare function createMaterializedView(options: MaterializedViewCreateOptions): string;
217
- /**
218
- * @deprecated Population of tables is now handled automatically by the Rust infrastructure.
219
- * This function is kept for backwards compatibility but will be ignored.
220
- * The framework now intelligently determines when to populate based on:
221
- * - Whether the materialized view is new or being replaced
222
- * - Whether the source is an S3Queue table (which doesn't support SELECT)
223
- *
224
- * Populates a table with data.
225
- */
226
- declare function populateTable(options: PopulateTableOptions): string;
227
375
 
228
376
  /**
229
377
  * Defines how Moose manages the lifecycle of database resources when your code changes.
@@ -2208,4 +2356,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2208
2356
  _argType?: ArgType;
2209
2357
  };
2210
2358
 
2211
- export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getView as K, LifeCycle as L, MaterializedView as M, getViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2359
+ export { type ClickHouseInt as $, type Aggregated as A, getSqlResource as B, ClickHouseEngines as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflows as G, getWorkflow as H, IngestApi as I, getWebApps as J, getWebApp as K, LifeCycle as L, MaterializedView as M, getView as N, OlapTable as O, getViews as P, getMaterializedView as Q, getMaterializedViews as R, type SimpleAggregated as S, Task as T, type ClickHousePrecision as U, View as V, Workflow as W, type ClickHouseDecimal as X, type ClickHouseByteSize as Y, type ClickHouseFixedStringSize as Z, type ClickHouseFloat as _, type OlapConfig as a, type ClickHouseJson as a0, type LowCardinality as a1, type ClickHouseNamedTuple as a2, type ClickHouseDefault as a3, type ClickHouseTTL as a4, type ClickHouseMaterialized as a5, type WithDefault as a6, type ClickHouseCodec as a7, type DateTime as a8, type DateTime64 as a9, getValueFromParameter as aA, createClickhouseParameter as aB, mapToClickHouseType as aC, type MooseUtils as aD, MooseClient as aE, type ClickHousePoint as aF, type ClickHouseRing as aG, type ClickHouseLineString as aH, type ClickHouseMultiLineString as aI, type ClickHousePolygon as aJ, type ClickHouseMultiPolygon as aK, QueryClient as aL, WorkflowClient as aM, getTemporalClient as aN, ApiHelpers as aO, ConsumptionHelpers as aP, joinQueries as aQ, type ConsumerConfig as aR, type TransformConfig as aS, type TaskContext as aT, type TaskConfig as aU, type IngestPipelineConfig as aV, type MaterializedViewConfig as aW, type DateTimeString as aa, type DateTime64String as ab, type FixedString as ac, type Float32 as ad, type Float64 as ae, type Int8 as af, type Int16 as ag, type Int32 as ah, type Int64 as ai, type UInt8 as aj, type UInt16 as ak, type UInt32 as al, type UInt64 as am, type Decimal as an, type ApiUtil as ao, type ConsumptionUtil as ap, quoteIdentifier as aq, type IdentifierBrandedString as ar, type NonIdentifierBrandedString as as, type Value as at, type RawValue as au, sql as av, Sql as aw, toStaticQuery as ax, toQuery as ay, toQueryPreview as az, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, ConsumptionApi as j, IngestPipeline as k, SqlResource as l, ETLPipeline as m, type ETLPipelineConfig as n, WebApp as o, type WebAppConfig as p, type WebAppHandler as q, getTables as r, getTable as s, getStreams as t, getStream as u, getIngestApis as v, getIngestApi as w, getApis as x, getApi as y, getSqlResources as z };
@@ -1,5 +1,6 @@
1
- import { IJsonSchemaCollection as IJsonSchemaCollection$1 } from 'typia';
1
+ import { tags, IJsonSchemaCollection as IJsonSchemaCollection$1 } from 'typia';
2
2
  import { IJsonSchemaCollection } from 'typia/src/schemas/json/IJsonSchemaCollection';
3
+ import { Pattern, TagBase } from 'typia/lib/tags';
3
4
  import { Readable } from 'node:stream';
4
5
  import { ClickHouseClient, ResultSet, CommandResult } from '@clickhouse/client';
5
6
  import { Client } from '@temporalio/client';
@@ -172,19 +173,184 @@ declare class TypedBase<T, C> {
172
173
  constructor(name: string, config: C, schema?: IJsonSchemaCollection.IV3_1, columns?: Column[], validators?: TypiaValidators<T>, allowExtraFields?: boolean);
173
174
  }
174
175
 
175
- interface MaterializedViewCreateOptions {
176
- name: string;
177
- destinationTable: string;
178
- select: string;
179
- }
180
- interface PopulateTableOptions {
181
- destinationTable: string;
182
- select: string;
183
- }
184
- interface Blocks {
185
- setup: string[];
186
- teardown: string[];
187
- }
176
+ type ClickHousePrecision<P extends number> = {
177
+ _clickhouse_precision?: P;
178
+ };
179
+ declare const DecimalRegex: "^-?\\d+(\\.\\d+)?$";
180
+ type ClickHouseDecimal<P extends number, S extends number> = {
181
+ _clickhouse_precision?: P;
182
+ _clickhouse_scale?: S;
183
+ } & Pattern<typeof DecimalRegex>;
184
+ type ClickHouseFixedStringSize<N extends number> = {
185
+ _clickhouse_fixed_string_size?: N;
186
+ };
187
+ /**
188
+ * FixedString(N) - Fixed-length string of exactly N bytes.
189
+ *
190
+ * ClickHouse stores exactly N bytes, padding shorter values with null bytes.
191
+ * Values exceeding N bytes will throw an exception.
192
+ *
193
+ * Use for binary data: hashes, IP addresses, UUIDs, MAC addresses.
194
+ *
195
+ * @example
196
+ * interface BinaryData {
197
+ * md5_hash: string & FixedString<16>; // 16-byte MD5
198
+ * sha256_hash: string & FixedString<32>; // 32-byte SHA256
199
+ * }
200
+ */
201
+ type FixedString<N extends number> = string & ClickHouseFixedStringSize<N>;
202
+ type ClickHouseByteSize<N extends number> = {
203
+ _clickhouse_byte_size?: N;
204
+ };
205
+ type LowCardinality = {
206
+ _LowCardinality?: true;
207
+ };
208
+ type DateTime = Date;
209
+ type DateTime64<P extends number> = Date & ClickHousePrecision<P>;
210
+ type DateTimeString = string & tags.Format<"date-time">;
211
+ /**
212
+ * JS Date objects cannot hold microsecond precision.
213
+ * Use string as the runtime type to avoid losing information.
214
+ */
215
+ type DateTime64String<P extends number> = string & tags.Format<"date-time"> & ClickHousePrecision<P>;
216
+ type Float32 = number & ClickHouseFloat<"float32">;
217
+ type Float64 = number & ClickHouseFloat<"float64">;
218
+ type Int8 = number & ClickHouseInt<"int8">;
219
+ type Int16 = number & ClickHouseInt<"int16">;
220
+ type Int32 = number & ClickHouseInt<"int32">;
221
+ type Int64 = number & ClickHouseInt<"int64">;
222
+ type UInt8 = number & ClickHouseInt<"uint8">;
223
+ type UInt16 = number & ClickHouseInt<"uint16">;
224
+ type UInt32 = number & ClickHouseInt<"uint32">;
225
+ type UInt64 = number & ClickHouseInt<"uint64">;
226
+ type Decimal<P extends number, S extends number> = string & ClickHouseDecimal<P, S>;
227
+ /**
228
+ * Attach compression codec to a column type.
229
+ *
230
+ * Any valid ClickHouse codec expression is allowed. ClickHouse validates the codec at runtime.
231
+ *
232
+ * @template T The base data type
233
+ * @template CodecExpr The codec expression (single codec or chain)
234
+ *
235
+ * @example
236
+ * interface Metrics {
237
+ * // Single codec
238
+ * log_blob: string & ClickHouseCodec<"ZSTD(3)">;
239
+ *
240
+ * // Codec chain (processed left-to-right)
241
+ * timestamp: Date & ClickHouseCodec<"Delta, LZ4">;
242
+ * temperature: number & ClickHouseCodec<"Gorilla, ZSTD">;
243
+ *
244
+ * // Specialized codecs
245
+ * counter: number & ClickHouseCodec<"DoubleDelta">;
246
+ *
247
+ * // Can combine with other annotations
248
+ * count: UInt64 & ClickHouseCodec<"DoubleDelta, LZ4">;
249
+ * }
250
+ */
251
+ type ClickHouseCodec<CodecExpr extends string> = {
252
+ _clickhouse_codec?: CodecExpr;
253
+ };
254
+ type ClickHouseFloat<Value extends "float32" | "float64"> = tags.Type<Value extends "float32" ? "float" : "double">;
255
+ type ClickHouseInt<Value extends "int8" | "int16" | "int32" | "int64" | "uint8" | "uint16" | "uint32" | "uint64"> = Value extends "int32" | "int64" | "uint32" | "uint64" ? tags.Type<Value> : TagBase<{
256
+ target: "number";
257
+ kind: "type";
258
+ value: Value;
259
+ validate: Value extends "int8" ? "-128 <= $input && $input <= 127" : Value extends "int16" ? "-32768 <= $input && $input <= 32767" : Value extends "uint8" ? "0 <= $input && $input <= 255" : Value extends "uint16" ? "0 <= $input && $input <= 65535" : never;
260
+ exclusive: true;
261
+ schema: {
262
+ type: "integer";
263
+ };
264
+ }>;
265
+ /**
266
+ * By default, nested objects map to the `Nested` type in clickhouse.
267
+ * Write `nestedObject: AnotherInterfaceType & ClickHouseNamedTuple`
268
+ * to map AnotherInterfaceType to the named tuple type.
269
+ */
270
+ type ClickHouseNamedTuple = {
271
+ _clickhouse_mapped_type?: "namedTuple";
272
+ };
273
+ type ClickHouseJson<maxDynamicPaths extends number | undefined = undefined, maxDynamicTypes extends number | undefined = undefined, skipPaths extends string[] = [], skipRegexes extends string[] = []> = {
274
+ _clickhouse_mapped_type?: "JSON";
275
+ _clickhouse_json_settings?: {
276
+ maxDynamicPaths?: maxDynamicPaths;
277
+ maxDynamicTypes?: maxDynamicTypes;
278
+ skipPaths?: skipPaths;
279
+ skipRegexes?: skipRegexes;
280
+ };
281
+ };
282
+ type ClickHousePoint = [number, number] & {
283
+ _clickhouse_mapped_type?: "Point";
284
+ };
285
+ type ClickHouseRing = ClickHousePoint[] & {
286
+ _clickhouse_mapped_type?: "Ring";
287
+ };
288
+ type ClickHouseLineString = ClickHousePoint[] & {
289
+ _clickhouse_mapped_type?: "LineString";
290
+ };
291
+ type ClickHouseMultiLineString = ClickHouseLineString[] & {
292
+ _clickhouse_mapped_type?: "MultiLineString";
293
+ };
294
+ type ClickHousePolygon = ClickHouseRing[] & {
295
+ _clickhouse_mapped_type?: "Polygon";
296
+ };
297
+ type ClickHouseMultiPolygon = ClickHousePolygon[] & {
298
+ _clickhouse_mapped_type?: "MultiPolygon";
299
+ };
300
+ /**
301
+ * typia may have trouble handling this type.
302
+ * In which case, use {@link WithDefault} as a workaround
303
+ *
304
+ * @example
305
+ * { field: number & ClickHouseDefault<"0"> }
306
+ */
307
+ type ClickHouseDefault<SqlExpression extends string> = {
308
+ _clickhouse_default?: SqlExpression;
309
+ };
310
+ /**
311
+ * @example
312
+ * {
313
+ * ...
314
+ * timestamp: Date;
315
+ * debugMessage: string & ClickHouseTTL<"timestamp + INTERVAL 1 WEEK">;
316
+ * }
317
+ */
318
+ type ClickHouseTTL<SqlExpression extends string> = {
319
+ _clickhouse_ttl?: SqlExpression;
320
+ };
321
+ /**
322
+ * ClickHouse MATERIALIZED column annotation.
323
+ * The column value is computed at INSERT time and physically stored.
324
+ * Cannot be explicitly inserted by users.
325
+ *
326
+ * @example
327
+ * interface Events {
328
+ * eventTime: DateTime;
329
+ * // Extract date component - computed and stored at insert time
330
+ * eventDate: Date & ClickHouseMaterialized<"toDate(event_time)">;
331
+ *
332
+ * userId: string;
333
+ * // Precompute hash for fast lookups
334
+ * userHash: UInt64 & ClickHouseMaterialized<"cityHash64(userId)">;
335
+ * }
336
+ *
337
+ * @remarks
338
+ * - MATERIALIZED and DEFAULT are mutually exclusive
339
+ * - Can be combined with ClickHouseCodec for compression
340
+ * - Changing the expression modifies the column in-place (existing values preserved)
341
+ */
342
+ type ClickHouseMaterialized<SqlExpression extends string> = {
343
+ _clickhouse_materialized?: SqlExpression;
344
+ };
345
+ /**
346
+ * See also {@link ClickHouseDefault}
347
+ *
348
+ * @example{ updated_at: WithDefault<Date, "now()"> }
349
+ */
350
+ type WithDefault<T, _SqlExpression extends string> = T;
351
+ /**
352
+ * ClickHouse table engine types supported by Moose.
353
+ */
188
354
  declare enum ClickHouseEngines {
189
355
  MergeTree = "MergeTree",
190
356
  ReplacingMergeTree = "ReplacingMergeTree",
@@ -206,24 +372,6 @@ declare enum ClickHouseEngines {
206
372
  ReplicatedCollapsingMergeTree = "ReplicatedCollapsingMergeTree",
207
373
  ReplicatedVersionedCollapsingMergeTree = "ReplicatedVersionedCollapsingMergeTree"
208
374
  }
209
- /**
210
- * Drops an existing view if it exists.
211
- */
212
- declare function dropView(name: string): string;
213
- /**
214
- * Creates a materialized view.
215
- */
216
- declare function createMaterializedView(options: MaterializedViewCreateOptions): string;
217
- /**
218
- * @deprecated Population of tables is now handled automatically by the Rust infrastructure.
219
- * This function is kept for backwards compatibility but will be ignored.
220
- * The framework now intelligently determines when to populate based on:
221
- * - Whether the materialized view is new or being replaced
222
- * - Whether the source is an S3Queue table (which doesn't support SELECT)
223
- *
224
- * Populates a table with data.
225
- */
226
- declare function populateTable(options: PopulateTableOptions): string;
227
375
 
228
376
  /**
229
377
  * Defines how Moose manages the lifecycle of database resources when your code changes.
@@ -2208,4 +2356,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2208
2356
  _argType?: ArgType;
2209
2357
  };
2210
2358
 
2211
- export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getView as K, LifeCycle as L, MaterializedView as M, getViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2359
+ export { type ClickHouseInt as $, type Aggregated as A, getSqlResource as B, ClickHouseEngines as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflows as G, getWorkflow as H, IngestApi as I, getWebApps as J, getWebApp as K, LifeCycle as L, MaterializedView as M, getView as N, OlapTable as O, getViews as P, getMaterializedView as Q, getMaterializedViews as R, type SimpleAggregated as S, Task as T, type ClickHousePrecision as U, View as V, Workflow as W, type ClickHouseDecimal as X, type ClickHouseByteSize as Y, type ClickHouseFixedStringSize as Z, type ClickHouseFloat as _, type OlapConfig as a, type ClickHouseJson as a0, type LowCardinality as a1, type ClickHouseNamedTuple as a2, type ClickHouseDefault as a3, type ClickHouseTTL as a4, type ClickHouseMaterialized as a5, type WithDefault as a6, type ClickHouseCodec as a7, type DateTime as a8, type DateTime64 as a9, getValueFromParameter as aA, createClickhouseParameter as aB, mapToClickHouseType as aC, type MooseUtils as aD, MooseClient as aE, type ClickHousePoint as aF, type ClickHouseRing as aG, type ClickHouseLineString as aH, type ClickHouseMultiLineString as aI, type ClickHousePolygon as aJ, type ClickHouseMultiPolygon as aK, QueryClient as aL, WorkflowClient as aM, getTemporalClient as aN, ApiHelpers as aO, ConsumptionHelpers as aP, joinQueries as aQ, type ConsumerConfig as aR, type TransformConfig as aS, type TaskContext as aT, type TaskConfig as aU, type IngestPipelineConfig as aV, type MaterializedViewConfig as aW, type DateTimeString as aa, type DateTime64String as ab, type FixedString as ac, type Float32 as ad, type Float64 as ae, type Int8 as af, type Int16 as ag, type Int32 as ah, type Int64 as ai, type UInt8 as aj, type UInt16 as ak, type UInt32 as al, type UInt64 as am, type Decimal as an, type ApiUtil as ao, type ConsumptionUtil as ap, quoteIdentifier as aq, type IdentifierBrandedString as ar, type NonIdentifierBrandedString as as, type Value as at, type RawValue as au, sql as av, Sql as aw, toStaticQuery as ax, toQuery as ay, toQueryPreview as az, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, ConsumptionApi as j, IngestPipeline as k, SqlResource as l, ETLPipeline as m, type ETLPipelineConfig as n, WebApp as o, type WebAppConfig as p, type WebAppHandler as q, getTables as r, getTable as s, getStreams as t, getStream as u, getIngestApis as v, getIngestApi as w, getApis as x, getApi as y, getSqlResources as z };
package/dist/index.d.mts CHANGED
@@ -1,14 +1,14 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-BVw4gSAN.mjs';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-C4miZc-A.mjs';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, K as getView, N as getViews, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-C4miZc-A.mjs';
1
+ export { JWT, Key } from './browserCompatible.mjs';
4
2
  import * as _clickhouse_client from '@clickhouse/client';
5
3
  import { KafkaJS } from '@514labs/kafka-javascript';
4
+ import { aD as MooseUtils, ao as ApiUtil, aE as MooseClient } from './index-Aq9KzsRd.mjs';
5
+ export { A as Aggregated, h as Api, i as ApiConfig, aO as ApiHelpers, Y as ClickHouseByteSize, a7 as ClickHouseCodec, X as ClickHouseDecimal, a3 as ClickHouseDefault, C as ClickHouseEngines, Z as ClickHouseFixedStringSize, _ as ClickHouseFloat, $ as ClickHouseInt, a0 as ClickHouseJson, aH as ClickHouseLineString, a5 as ClickHouseMaterialized, aI as ClickHouseMultiLineString, aK as ClickHouseMultiPolygon, a2 as ClickHouseNamedTuple, aF as ClickHousePoint, aJ as ClickHousePolygon, U as ClickHousePrecision, aG as ClickHouseRing, a4 as ClickHouseTTL, j as ConsumptionApi, aP as ConsumptionHelpers, ap as ConsumptionUtil, a8 as DateTime, a9 as DateTime64, ab as DateTime64String, aa as DateTimeString, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, an as Decimal, m as ETLPipeline, n as ETLPipelineConfig, E as EgressConfig, ac as FixedString, ad as Float32, ae as Float64, F as FrameworkApp, ar as IdentifierBrandedString, I as IngestApi, g as IngestConfig, k as IngestPipeline, ag as Int16, ah as Int32, ai as Int64, af as Int8, L as LifeCycle, a1 as LowCardinality, M as MaterializedView, as as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, aL as QueryClient, au as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, aw as Sql, l as SqlResource, c as Stream, d as StreamConfig, T as Task, ak as UInt16, al as UInt32, am as UInt64, aj as UInt8, at as Value, V as View, o as WebApp, p as WebAppConfig, q as WebAppHandler, a6 as WithDefault, W as Workflow, aM as WorkflowClient, aB as createClickhouseParameter, y as getApi, x as getApis, w as getIngestApi, v as getIngestApis, Q as getMaterializedView, R as getMaterializedViews, B as getSqlResource, z as getSqlResources, u as getStream, t as getStreams, s as getTable, r as getTables, aN as getTemporalClient, aA as getValueFromParameter, N as getView, P as getViews, K as getWebApp, J as getWebApps, H as getWorkflow, G as getWorkflows, aQ as joinQueries, aC as mapToClickHouseType, aq as quoteIdentifier, av as sql, ay as toQuery, az as toQueryPreview, ax as toStaticQuery } from './index-Aq9KzsRd.mjs';
6
6
  import http from 'http';
7
7
  import { IsTuple } from 'typia/lib/typings/IsTuple';
8
8
  import { Readable } from 'node:stream';
9
- import 'typia/lib/tags';
10
9
  import 'typia';
11
10
  import 'typia/src/schemas/json/IJsonSchemaCollection';
11
+ import 'typia/lib/tags';
12
12
  import '@temporalio/client';
13
13
  import 'jose';
14
14
 
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-rK8ei0bt.js';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-C4miZc-A.js';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, K as getView, N as getViews, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-C4miZc-A.js';
1
+ export { JWT, Key } from './browserCompatible.js';
4
2
  import * as _clickhouse_client from '@clickhouse/client';
5
3
  import { KafkaJS } from '@514labs/kafka-javascript';
4
+ import { aD as MooseUtils, ao as ApiUtil, aE as MooseClient } from './index-Aq9KzsRd.js';
5
+ export { A as Aggregated, h as Api, i as ApiConfig, aO as ApiHelpers, Y as ClickHouseByteSize, a7 as ClickHouseCodec, X as ClickHouseDecimal, a3 as ClickHouseDefault, C as ClickHouseEngines, Z as ClickHouseFixedStringSize, _ as ClickHouseFloat, $ as ClickHouseInt, a0 as ClickHouseJson, aH as ClickHouseLineString, a5 as ClickHouseMaterialized, aI as ClickHouseMultiLineString, aK as ClickHouseMultiPolygon, a2 as ClickHouseNamedTuple, aF as ClickHousePoint, aJ as ClickHousePolygon, U as ClickHousePrecision, aG as ClickHouseRing, a4 as ClickHouseTTL, j as ConsumptionApi, aP as ConsumptionHelpers, ap as ConsumptionUtil, a8 as DateTime, a9 as DateTime64, ab as DateTime64String, aa as DateTimeString, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, an as Decimal, m as ETLPipeline, n as ETLPipelineConfig, E as EgressConfig, ac as FixedString, ad as Float32, ae as Float64, F as FrameworkApp, ar as IdentifierBrandedString, I as IngestApi, g as IngestConfig, k as IngestPipeline, ag as Int16, ah as Int32, ai as Int64, af as Int8, L as LifeCycle, a1 as LowCardinality, M as MaterializedView, as as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, aL as QueryClient, au as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, aw as Sql, l as SqlResource, c as Stream, d as StreamConfig, T as Task, ak as UInt16, al as UInt32, am as UInt64, aj as UInt8, at as Value, V as View, o as WebApp, p as WebAppConfig, q as WebAppHandler, a6 as WithDefault, W as Workflow, aM as WorkflowClient, aB as createClickhouseParameter, y as getApi, x as getApis, w as getIngestApi, v as getIngestApis, Q as getMaterializedView, R as getMaterializedViews, B as getSqlResource, z as getSqlResources, u as getStream, t as getStreams, s as getTable, r as getTables, aN as getTemporalClient, aA as getValueFromParameter, N as getView, P as getViews, K as getWebApp, J as getWebApps, H as getWorkflow, G as getWorkflows, aQ as joinQueries, aC as mapToClickHouseType, aq as quoteIdentifier, av as sql, ay as toQuery, az as toQueryPreview, ax as toStaticQuery } from './index-Aq9KzsRd.js';
6
6
  import http from 'http';
7
7
  import { IsTuple } from 'typia/lib/typings/IsTuple';
8
8
  import { Readable } from 'node:stream';
9
- import 'typia/lib/tags';
10
9
  import 'typia';
11
10
  import 'typia/src/schemas/json/IJsonSchemaCollection';
11
+ import 'typia/lib/tags';
12
12
  import '@temporalio/client';
13
13
  import 'jose';
14
14