@housekit/orm 0.1.25 → 0.1.27

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.
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export type Infer<T> = T extends {
16
16
  export type InferInsert<T> = T extends {
17
17
  $inferInsert: infer U;
18
18
  } ? U : never;
19
- export { Engine, type EngineConfiguration } from './engines';
19
+ export { Engine, renderEngineSQL, type EngineConfiguration } from './engines';
20
20
  export * from './external';
21
21
  export * from './expressions';
22
22
  export * from './builders/select';
@@ -33,8 +33,36 @@ export * from './client';
33
33
  export { t, defineTable, table, view, defineView, materializedView, defineMaterializedView, dictionary, defineDictionary, defineProjection, detectMaterializedViewDrift, extractMVQuery, createMigrationBridge, generateBlueGreenMigration, relations, type ColumnBuilder, type EnhancedTableOptions } from './schema-builder';
34
34
  export { sql } from './expressions';
35
35
  export { generateSelectSchema, generateInsertSchema } from './codegen/zod';
36
- export { BinaryWriter, createBinaryEncoder, serializeRowBinary, serializeRowsBinary, buildBinaryConfig, type BinaryEncoder, type BinarySerializationConfig, } from './utils/binary-serializer';
36
+ export { BinaryWriter, createBinaryEncoder, serializeRowBinary, serializeRowsBinary, buildBinaryConfig, acquireWriter, releaseWriter, createAccessor, buildOptimizedBinaryConfig, serializeRowsOptimized, isNumericHeavySchema, serializeNumericBatch, type BinaryEncoder, type BinarySerializationConfig, type OptimizedBinaryConfig, type RowAccessor, } from './utils/binary-serializer';
37
37
  export { SyncBinarySerializer, BinaryWorkerPool, type BinaryWorkerPoolOptions, } from './utils/binary-worker-pool';
38
+ export interface DatabaseConnection {
39
+ host?: string;
40
+ port?: number;
41
+ database: string;
42
+ username?: string;
43
+ password?: string;
44
+ url?: string;
45
+ }
46
+ export interface HouseKitConfig {
47
+ /**
48
+ * Path to the directory containing your schema files (.ts or .js).
49
+ * Can be a single path or a mapping for multiple databases.
50
+ */
51
+ schema: string | Record<string, string>;
52
+ /**
53
+ * Directory where SQL migrations and snapshots will be generated.
54
+ */
55
+ out: string;
56
+ /**
57
+ * Preferred file format for generated schema files
58
+ */
59
+ language?: 'ts' | 'js';
60
+ /**
61
+ * ClickHouse connection configuration.
62
+ * Each key represents the database name you will use.
63
+ */
64
+ databases: Record<string, DatabaseConnection>;
65
+ }
38
66
  /**
39
67
  * Load housekit.config.js/ts and create a client by name.
40
68
  */
@@ -143,12 +171,23 @@ declare const _default: {
143
171
  multiPolygon: (name: string) => import("./column").ClickHouseColumn<[number, number][][][], true, false>;
144
172
  enum: (name: string, values: readonly string[]) => import("./column").ClickHouseColumn<string, false, false>;
145
173
  timestamps: () => {
146
- created_at: import("./column").ClickHouseColumn<string | Date, true, false>;
147
- updated_at: import("./column").ClickHouseColumn<string | Date, true, false>;
174
+ created_at: import("./column").ClickHouseColumn<string | Date, true, true>;
175
+ updated_at: import("./column").ClickHouseColumn<string | Date, true, true>;
176
+ };
177
+ primaryUuid: {
178
+ (): {
179
+ id: import("./column").ClickHouseColumn<string, true, true>;
180
+ };
181
+ <TName extends string>(name: TName): { [K in TName]: import("./column").ClickHouseColumn<string, true, true>; };
182
+ };
183
+ primaryUuidV7: {
184
+ (): {
185
+ id: import("./column").ClickHouseColumn<string, true, true>;
186
+ };
187
+ <TName extends string>(name: TName): { [K in TName]: import("./column").ClickHouseColumn<string, true, true>; };
148
188
  };
149
- primaryUuid: <TName extends string = "id">(name?: TName) => { [K in TName]: import("./column").ClickHouseColumn<string>; };
150
189
  softDeletes: () => {
151
- is_deleted: import("./column").ClickHouseColumn<boolean, true, false>;
190
+ is_deleted: import("./column").ClickHouseColumn<boolean, true, true>;
152
191
  deleted_at: import("./column").ClickHouseColumn<string | Date, false, false>;
153
192
  };
154
193
  };