@housekit/orm 0.1.32 → 0.1.34

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.
@@ -54,16 +54,15 @@ export declare class ClickHouseInsertBuilder<TTable extends TableRuntime<any, an
54
54
  noReturning(): ClickHouseInsertBuilder<TTable, void>;
55
55
  /**
56
56
  * Force synchronous insert (disables async_insert).
57
- * Use when you need immediate durability guarantee.
58
- *
59
- * Note: By default, HouseKit uses async_insert for better performance.
60
- * The data is still durable, but ClickHouse batches writes internally.
57
+ * This is already the default in HouseKit for best performance.
61
58
  */
62
59
  syncInsert(): this;
63
60
  /**
64
- * Enables asynchronous inserts on the server.
61
+ * Enable asynchronous inserts on the server (not the default).
65
62
  * ClickHouse will batch multiple small inserts into a single disk operation.
66
- * Ideal for high-frequency logs or events.
63
+ *
64
+ * Note: Sync insert is faster for most use cases. Use async only when
65
+ * you need server-side batching for very high-frequency writes.
67
66
  */
68
67
  asyncInsert(waitForCompletion?: boolean): this;
69
68
  /**
@@ -94,33 +93,29 @@ export declare class ClickHouseInsertBuilder<TTable extends TableRuntime<any, an
94
93
  */
95
94
  append(row: CleanInsert<TTable>): Promise<void>;
96
95
  /**
97
- * Force JSON format (useful for debugging or compatibility).
98
- *
99
- * Note: HouseKit uses RowBinary by default for maximum performance.
100
- * Only use this when you need human-readable output or debugging.
96
+ * Use JSON format explicitly (this is already the default).
101
97
  *
102
98
  * @example
103
99
  * ```typescript
104
100
  * await db.insert(events)
105
101
  * .values(rows)
106
- * .useJsonFormat() // For debugging
102
+ * .useJsonFormat()
107
103
  * .execute();
108
104
  * ```
109
105
  */
110
106
  useJsonFormat(): this;
111
107
  /**
112
- * Force JSONCompactEachRow format (smaller than JSON, but slower than binary).
108
+ * Use JSONCompactEachRow format (smaller payload than JSON).
113
109
  */
114
110
  useCompactFormat(): this;
115
111
  /**
116
- * Force RowBinary format (this is already the default via 'auto').
117
- * Explicit call for documentation purposes.
112
+ * Force RowBinary format.
113
+ * Uses direct HTTP request (bypasses official client).
118
114
  */
119
115
  useBinaryFormat(): this;
120
116
  /**
121
- * Activates "Turbo Mode" (RowBinary).
122
- * Sends data in native binary format, skipping JSON parsing on the server.
123
- * Up to 5x faster than normal insertion.
117
+ * Alias for useBinaryFormat().
118
+ * @deprecated Binary format is not faster than JSON with the official client.
124
119
  */
125
120
  turbo(): this;
126
121
  execute(): Promise<TReturn>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type TableDefinition, type TableColumns } from './core';
2
- import { createClientFromConfigObject, type ClientConfigWithSchema, type HousekitClient as HousekitClientType, type HousekitClientConfig } from './client';
2
+ import { type ClientConfigWithSchema, type HousekitClient as HousekitClientType, type HousekitClientConfig, type HousekitClient } from './client';
3
3
  import { generateSelectSchema, generateInsertSchema } from './codegen/zod';
4
4
  export { ClickHouseColumn } from './column';
5
5
  export { type TableDefinition, type TableColumns, type TableOptions, type IndexDefinition, type ProjectionDefinition, type InsertModel, type TableModel, type TableInsertArray, type TableRuntime, type TableInsert, index, projection, deriveTable, renderSchema } from './table';
@@ -73,10 +73,10 @@ export declare function createSchema<TCols extends TableColumns>(table: TableDef
73
73
  select: import("zod").ZodObject<any, import("zod/v4/core").$strip>;
74
74
  insert: import("zod").ZodObject<any, import("zod/v4/core").$strip>;
75
75
  };
76
- export type HousekitClient = ReturnType<typeof createClientFromConfigObject>;
77
- export declare function createClient(): Promise<HousekitClient>;
78
- export declare function createClient(config: ClientConfigWithSchema): HousekitClient;
79
- export declare function createClient(databaseName: string): Promise<HousekitClient>;
76
+ export type { HousekitClient };
77
+ export declare function createClient(): Promise<HousekitClientType>;
78
+ export declare function createClient(config: ClientConfigWithSchema): HousekitClientType;
79
+ export declare function createClient(databaseName: string): Promise<HousekitClientType>;
80
80
  export declare function tableExists(client: HousekitClient, tableName: string): Promise<boolean>;
81
81
  export declare function ensureTable<TCols extends TableColumns>(client: HousekitClient, table: TableDefinition<TCols>): Promise<void>;
82
82
  export declare function dropTable(client: HousekitClient, tableName: string, options?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@housekit/orm",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Type-safe ClickHouse ORM with modern DX and ClickHouse-specific optimizations. Features Turbo Mode (RowBinary), full engine support, and advanced query capabilities.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",