@evolu/common 7.4.0 → 8.0.0-next.0

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.
Files changed (251) hide show
  1. package/README.md +4 -61
  2. package/dist/src/Array.d.ts +343 -102
  3. package/dist/src/Array.d.ts.map +1 -1
  4. package/dist/src/Array.js +181 -85
  5. package/dist/src/Assert.d.ts +57 -11
  6. package/dist/src/Assert.d.ts.map +1 -1
  7. package/dist/src/Assert.js +47 -11
  8. package/dist/src/BigInt.d.ts +6 -1
  9. package/dist/src/BigInt.d.ts.map +1 -1
  10. package/dist/src/BigInt.js +5 -0
  11. package/dist/src/Brand.d.ts +40 -12
  12. package/dist/src/Brand.d.ts.map +1 -1
  13. package/dist/src/Brand.js +5 -0
  14. package/dist/src/Buffer.d.ts +6 -1
  15. package/dist/src/Buffer.d.ts.map +1 -1
  16. package/dist/src/Buffer.js +7 -2
  17. package/dist/src/Cache.d.ts +10 -2
  18. package/dist/src/Cache.d.ts.map +1 -1
  19. package/dist/src/Cache.js +6 -0
  20. package/dist/src/Callbacks.d.ts +10 -7
  21. package/dist/src/Callbacks.d.ts.map +1 -1
  22. package/dist/src/Callbacks.js +23 -13
  23. package/dist/src/Console.d.ts +361 -69
  24. package/dist/src/Console.d.ts.map +1 -1
  25. package/dist/src/Console.js +217 -117
  26. package/dist/src/Crypto.d.ts +70 -21
  27. package/dist/src/Crypto.d.ts.map +1 -1
  28. package/dist/src/Crypto.js +72 -27
  29. package/dist/src/Eq.d.ts +22 -2
  30. package/dist/src/Eq.d.ts.map +1 -1
  31. package/dist/src/Eq.js +21 -1
  32. package/dist/src/Error.d.ts +23 -12
  33. package/dist/src/Error.d.ts.map +1 -1
  34. package/dist/src/Error.js +27 -11
  35. package/dist/src/Function.d.ts +128 -56
  36. package/dist/src/Function.d.ts.map +1 -1
  37. package/dist/src/Function.js +118 -14
  38. package/dist/src/Identicon.d.ts +5 -0
  39. package/dist/src/Identicon.d.ts.map +1 -1
  40. package/dist/src/Identicon.js +6 -1
  41. package/dist/src/Lookup.d.ts +160 -0
  42. package/dist/src/Lookup.d.ts.map +1 -0
  43. package/dist/src/Lookup.js +192 -0
  44. package/dist/src/Microtask.d.ts +21 -0
  45. package/dist/src/Microtask.d.ts.map +1 -0
  46. package/dist/src/Microtask.js +37 -0
  47. package/dist/src/Number.d.ts +18 -4
  48. package/dist/src/Number.d.ts.map +1 -1
  49. package/dist/src/Number.js +23 -1
  50. package/dist/src/Object.d.ts +110 -5
  51. package/dist/src/Object.d.ts.map +1 -1
  52. package/dist/src/Object.js +108 -5
  53. package/dist/src/Option.d.ts +58 -0
  54. package/dist/src/Option.d.ts.map +1 -0
  55. package/dist/src/Option.js +43 -0
  56. package/dist/src/Order.d.ts +5 -0
  57. package/dist/src/Order.d.ts.map +1 -1
  58. package/dist/src/Order.js +8 -3
  59. package/dist/src/Platform.d.ts +36 -2
  60. package/dist/src/Platform.d.ts.map +1 -1
  61. package/dist/src/Platform.js +10 -6
  62. package/dist/src/Polyfills.d.ts +27 -0
  63. package/dist/src/Polyfills.d.ts.map +1 -0
  64. package/dist/src/Polyfills.js +299 -0
  65. package/dist/src/Random.d.ts +18 -7
  66. package/dist/src/Random.d.ts.map +1 -1
  67. package/dist/src/Random.js +9 -7
  68. package/dist/src/Redacted.d.ts +7 -4
  69. package/dist/src/Redacted.d.ts.map +1 -1
  70. package/dist/src/Redacted.js +5 -0
  71. package/dist/src/Ref.d.ts +31 -16
  72. package/dist/src/Ref.d.ts.map +1 -1
  73. package/dist/src/Ref.js +35 -7
  74. package/dist/src/RefCount.d.ts +62 -0
  75. package/dist/src/RefCount.d.ts.map +1 -0
  76. package/dist/src/RefCount.js +83 -0
  77. package/dist/src/Relation.d.ts +84 -29
  78. package/dist/src/Relation.d.ts.map +1 -1
  79. package/dist/src/Relation.js +83 -105
  80. package/dist/src/Resource.d.ts +263 -0
  81. package/dist/src/Resource.d.ts.map +1 -0
  82. package/dist/src/Resource.js +389 -0
  83. package/dist/src/Result.d.ts +390 -374
  84. package/dist/src/Result.d.ts.map +1 -1
  85. package/dist/src/Result.js +142 -70
  86. package/dist/src/Schedule.d.ts +953 -0
  87. package/dist/src/Schedule.d.ts.map +1 -0
  88. package/dist/src/Schedule.js +1199 -0
  89. package/dist/src/Set.d.ts +181 -0
  90. package/dist/src/Set.d.ts.map +1 -0
  91. package/dist/src/Set.js +137 -0
  92. package/dist/src/Skiplist.d.ts +6 -1
  93. package/dist/src/Skiplist.d.ts.map +1 -1
  94. package/dist/src/Skiplist.js +5 -0
  95. package/dist/src/Sqlite.d.ts +160 -60
  96. package/dist/src/Sqlite.d.ts.map +1 -1
  97. package/dist/src/Sqlite.js +290 -190
  98. package/dist/src/Store.d.ts +36 -28
  99. package/dist/src/Store.d.ts.map +1 -1
  100. package/dist/src/Store.js +55 -15
  101. package/dist/src/String.d.ts +5 -0
  102. package/dist/src/String.d.ts.map +1 -1
  103. package/dist/src/String.js +5 -0
  104. package/dist/src/Task.d.ts +2263 -423
  105. package/dist/src/Task.d.ts.map +1 -1
  106. package/dist/src/Task.js +1488 -348
  107. package/dist/src/Test.d.ts +122 -0
  108. package/dist/src/Test.d.ts.map +1 -0
  109. package/dist/src/Test.js +66 -0
  110. package/dist/src/Time.d.ts +201 -48
  111. package/dist/src/Time.d.ts.map +1 -1
  112. package/dist/src/Time.js +190 -86
  113. package/dist/src/Tracer.d.ts +48 -0
  114. package/dist/src/Tracer.d.ts.map +1 -0
  115. package/dist/src/Tracer.js +6 -0
  116. package/dist/src/Type.d.ts +582 -209
  117. package/dist/src/Type.d.ts.map +1 -1
  118. package/dist/src/Type.js +362 -240
  119. package/dist/src/Types.d.ts +160 -6
  120. package/dist/src/Types.d.ts.map +1 -1
  121. package/dist/src/Types.js +22 -2
  122. package/dist/src/WebSocket.d.ts +113 -58
  123. package/dist/src/WebSocket.d.ts.map +1 -1
  124. package/dist/src/WebSocket.js +210 -118
  125. package/dist/src/Worker.d.ts +245 -60
  126. package/dist/src/Worker.d.ts.map +1 -1
  127. package/dist/src/Worker.js +220 -64
  128. package/dist/src/index.d.ts +25 -3
  129. package/dist/src/index.d.ts.map +1 -1
  130. package/dist/src/index.js +19 -3
  131. package/dist/src/local-first/Db.d.ts +24 -213
  132. package/dist/src/local-first/Db.d.ts.map +1 -1
  133. package/dist/src/local-first/Db.js +622 -293
  134. package/dist/src/local-first/Error.d.ts +12 -0
  135. package/dist/src/local-first/Error.d.ts.map +1 -0
  136. package/dist/src/local-first/Error.js +6 -0
  137. package/dist/src/local-first/Evolu.d.ts +330 -285
  138. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  139. package/dist/src/local-first/Evolu.js +472 -402
  140. package/dist/src/local-first/LocalAuth.d.ts +10 -10
  141. package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
  142. package/dist/src/local-first/LocalAuth.js +6 -1
  143. package/dist/src/local-first/Owner.d.ts +70 -27
  144. package/dist/src/local-first/Owner.d.ts.map +1 -1
  145. package/dist/src/local-first/Owner.js +27 -14
  146. package/dist/src/local-first/Protocol.d.ts +58 -50
  147. package/dist/src/local-first/Protocol.d.ts.map +1 -1
  148. package/dist/src/local-first/Protocol.js +253 -155
  149. package/dist/src/local-first/Query.d.ts +133 -43
  150. package/dist/src/local-first/Query.d.ts.map +1 -1
  151. package/dist/src/local-first/Query.js +139 -90
  152. package/dist/src/local-first/Relay.d.ts +18 -38
  153. package/dist/src/local-first/Relay.d.ts.map +1 -1
  154. package/dist/src/local-first/Relay.js +59 -171
  155. package/dist/src/local-first/Schema.d.ts +139 -144
  156. package/dist/src/local-first/Schema.d.ts.map +1 -1
  157. package/dist/src/local-first/Schema.js +78 -163
  158. package/dist/src/local-first/Shared.d.ts +125 -0
  159. package/dist/src/local-first/Shared.d.ts.map +1 -0
  160. package/dist/src/local-first/Shared.js +569 -0
  161. package/dist/src/local-first/Storage.d.ts +50 -53
  162. package/dist/src/local-first/Storage.d.ts.map +1 -1
  163. package/dist/src/local-first/Storage.js +121 -173
  164. package/dist/src/local-first/Timestamp.d.ts +28 -35
  165. package/dist/src/local-first/Timestamp.d.ts.map +1 -1
  166. package/dist/src/local-first/Timestamp.js +24 -25
  167. package/dist/src/local-first/index.d.ts +2 -15
  168. package/dist/src/local-first/index.d.ts.map +1 -1
  169. package/dist/src/local-first/index.js +2 -15
  170. package/package.json +36 -26
  171. package/src/Array.ts +467 -106
  172. package/src/Assert.ts +87 -12
  173. package/src/BigInt.ts +7 -1
  174. package/src/Brand.ts +41 -12
  175. package/src/Buffer.ts +10 -4
  176. package/src/Cache.ts +11 -2
  177. package/src/Callbacks.ts +33 -23
  178. package/src/Console.ts +567 -178
  179. package/src/Crypto.ts +111 -62
  180. package/src/Eq.ts +30 -3
  181. package/src/Error.ts +50 -34
  182. package/src/Function.ts +140 -68
  183. package/src/Identicon.ts +7 -1
  184. package/src/Lookup.ts +415 -0
  185. package/src/Microtask.ts +58 -0
  186. package/src/Number.ts +40 -7
  187. package/src/Object.ts +155 -16
  188. package/src/Option.ts +74 -0
  189. package/src/Order.ts +11 -3
  190. package/src/Platform.ts +43 -7
  191. package/src/Polyfills.ts +465 -0
  192. package/src/Random.ts +25 -11
  193. package/src/Redacted.ts +8 -4
  194. package/src/Ref.ts +72 -21
  195. package/src/RefCount.ts +170 -0
  196. package/src/Relation.ts +188 -136
  197. package/src/Resource.ts +864 -0
  198. package/src/Result.ts +548 -381
  199. package/src/Schedule.ts +1471 -0
  200. package/src/Set.ts +247 -0
  201. package/src/Skiplist.ts +7 -1
  202. package/src/Sqlite.ts +409 -304
  203. package/src/Store.ts +94 -48
  204. package/src/String.ts +6 -0
  205. package/src/Task.ts +3685 -740
  206. package/src/Test.ts +162 -0
  207. package/src/Time.ts +348 -145
  208. package/src/Tracer.ts +54 -0
  209. package/src/Type.ts +1064 -630
  210. package/src/Types.ts +202 -7
  211. package/src/WebSocket.ts +311 -178
  212. package/src/Worker.ts +527 -147
  213. package/src/index.ts +74 -3
  214. package/src/local-first/Db.ts +871 -597
  215. package/src/local-first/Error.ts +17 -0
  216. package/src/local-first/Evolu.ts +884 -823
  217. package/src/local-first/LocalAuth.ts +10 -10
  218. package/src/local-first/Owner.ts +94 -42
  219. package/src/local-first/Protocol.ts +440 -303
  220. package/src/local-first/Query.ts +243 -194
  221. package/src/local-first/Relay.ts +91 -252
  222. package/src/local-first/Schema.ts +284 -394
  223. package/src/local-first/Shared.ts +932 -0
  224. package/src/local-first/Storage.ts +209 -282
  225. package/src/local-first/Timestamp.ts +38 -45
  226. package/src/local-first/index.ts +2 -16
  227. package/LICENSE +0 -21
  228. package/dist/src/Instances.d.ts +0 -34
  229. package/dist/src/Instances.d.ts.map +0 -1
  230. package/dist/src/Instances.js +0 -44
  231. package/dist/src/Resources.d.ts +0 -118
  232. package/dist/src/Resources.d.ts.map +0 -1
  233. package/dist/src/Resources.js +0 -197
  234. package/dist/src/local-first/Platform.d.ts +0 -25
  235. package/dist/src/local-first/Platform.d.ts.map +0 -1
  236. package/dist/src/local-first/Platform.js +0 -1
  237. package/dist/src/local-first/Public.d.ts +0 -22
  238. package/dist/src/local-first/Public.d.ts.map +0 -1
  239. package/dist/src/local-first/Public.js +0 -15
  240. package/dist/src/local-first/PublicKysely.d.ts +0 -148
  241. package/dist/src/local-first/PublicKysely.d.ts.map +0 -1
  242. package/dist/src/local-first/PublicKysely.js +0 -184
  243. package/dist/src/local-first/Sync.d.ts +0 -112
  244. package/dist/src/local-first/Sync.d.ts.map +0 -1
  245. package/dist/src/local-first/Sync.js +0 -529
  246. package/src/Instances.ts +0 -90
  247. package/src/Resources.ts +0 -367
  248. package/src/local-first/Platform.ts +0 -27
  249. package/src/local-first/Public.ts +0 -42
  250. package/src/local-first/PublicKysely.ts +0 -239
  251. package/src/local-first/Sync.ts +0 -960
@@ -1,48 +1,60 @@
1
+ /**
2
+ * Database schema definition and validation.
3
+ *
4
+ * @module
5
+ */
1
6
  import * as Kysely from "kysely";
2
- import { ReadonlyRecord } from "../Object.js";
3
- import { Result } from "../Result.js";
4
- import { SqliteBoolean, SqliteDep, SqliteError, SqliteQueryOptions, SqliteValue } from "../Sqlite.js";
5
- import { AnyType, IdBytes, InferErrors, InferInput, InferType, MergeObjectTypeErrors, NullableToOptionalProps, ObjectType, OptionalType, TableId, Type, ValidMutationSize, ValidMutationSizeError } from "../Type.js";
6
- import { Simplify } from "../Types.js";
7
+ import { type ReadonlyRecord } from "../Object.js";
8
+ import { SqliteBoolean, type SqliteDep, type SqliteQueryOptions, type SqliteSchema, SqliteValue } from "../Sqlite.js";
9
+ import type { InferType } from "../Type.js";
10
+ import { type Id, IdBytes, type StandardSchemaV1 } from "../Type.js";
11
+ import type { Simplify } from "../Types.js";
7
12
  import { OwnerId } from "./Owner.js";
8
- import { Query, Row } from "./Query.js";
13
+ import type { Query, Row } from "./Query.js";
9
14
  import type { DbChange } from "./Storage.js";
10
15
  import { TimestampBytes } from "./Timestamp.js";
16
+ /** Any {@link StandardSchemaV1}. */
17
+ export type AnyStandardSchemaV1 = StandardSchemaV1<any, any>;
11
18
  /**
12
19
  * Defines the schema of an Evolu database.
13
20
  *
14
- * Table schema defines columns that are required for table rows. For not
15
- * required columns, use {@link nullOr}.
21
+ * Column types are Standard Schema v1 compatible use Evolu Type, Zod,
22
+ * Valibot, ArkType, or any library that implements Standard Schema.
23
+ *
24
+ * Table schema defines columns that are required for table rows. For optional
25
+ * columns, use a schema whose output type includes `null`.
16
26
  *
17
27
  * ### Example
18
28
  *
19
29
  * ```ts
30
+ * // With Evolu Type
20
31
  * const TodoId = id("Todo");
21
32
  * type TodoId = typeof TodoId.Type;
22
33
  *
23
- * const TodoCategoryId = id("TodoCategory");
24
- * type TodoCategoryId = typeof TodoCategoryId.Type;
25
- *
26
- * const NonEmptyString50 = maxLength(50)(NonEmptyString);
27
- * type NonEmptyString50 = typeof NonEmptyString50.Type;
28
- *
29
- * // Database schema.
30
34
  * const Schema = {
31
35
  * todo: {
32
36
  * id: TodoId,
33
- * title: NonEmptyString1000,
34
- * isCompleted: nullable(SqliteBoolean),
35
- * categoryId: nullable(TodoCategoryId),
37
+ * title: NonEmptyString100,
38
+ * isCompleted: nullOr(SqliteBoolean),
36
39
  * },
37
- * todoCategory: {
38
- * id: TodoCategoryId,
39
- * name: NonEmptyString50,
40
- * json: nullable(SomeJson),
40
+ * };
41
+ *
42
+ * // With Zod (or any Standard Schema library)
43
+ * const Schema = {
44
+ * todo: {
45
+ * id: TodoId, // Evolu id() for branded IDs
46
+ * title: z.string().min(1).max(100),
47
+ * isCompleted: z.union([z.literal(0), z.literal(1)]).nullable(),
41
48
  * },
42
49
  * };
43
50
  * ```
44
51
  */
45
- export type EvoluSchema = ReadonlyRecord<string, ReadonlyRecord<string, Type<any, any, any, any, any, any>>>;
52
+ export type EvoluSchema = ReadonlyRecord<string, TableSchema>;
53
+ /** A table schema: column names mapped to Standard Schema validators. */
54
+ export type TableSchema = ReadonlyRecord<string, AnyStandardSchemaV1>;
55
+ export interface SqliteSchemaDep {
56
+ readonly sqliteSchema: SqliteSchema;
57
+ }
46
58
  /**
47
59
  * Validates an {@link EvoluSchema} at compile time, returning the first error
48
60
  * found as a readable string literal type. This approach provides much clearer
@@ -52,22 +64,15 @@ export type EvoluSchema = ReadonlyRecord<string, ReadonlyRecord<string, Type<any
52
64
  * Validates the following schema requirements:
53
65
  *
54
66
  * 1. All tables must have an 'id' column
55
- * 2. The 'id' column must be a branded ID type (created with id() function)
67
+ * 2. The 'id' column output type must extend {@link Id}
56
68
  * 3. Tables cannot use system column names (createdAt, updatedAt, isDeleted)
57
- * 4. All column types must be compatible with SQLite (extend SqliteValue)
69
+ * 4. All column output types must be compatible with SQLite (extend SqliteValue)
58
70
  */
59
71
  export type ValidateSchema<S extends EvoluSchema> = ValidateSchemaHasId<S> extends never ? ValidateIdColumnType<S> extends never ? ValidateNoSystemColumns<S> extends never ? ValidateColumnTypes<S> extends never ? S : ValidateColumnTypes<S> : ValidateNoSystemColumns<S> : ValidateIdColumnType<S> : ValidateSchemaHasId<S>;
60
- export type ValidateSchemaHasId<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? "id" extends keyof S[TableName] ? never : SchemaValidationError<`Table "${TableName & string}" is missing required id column.`> : never : never;
61
- export type ValidateIdColumnType<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? "id" extends keyof S[TableName] ? S[TableName]["id"] extends TableId<any> ? never : SchemaValidationError<`Table "${TableName & string}" id column must be a branded ID type (created with id("${TableName & string}")).`> : never : never : never;
62
- export type ValidateNoSystemColumns<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? keyof S[TableName] extends infer ColumnName ? ColumnName extends keyof S[TableName] ? ColumnName extends "createdAt" | "updatedAt" | "isDeleted" | "ownerId" ? SchemaValidationError<`Table "${TableName & string}" uses system column name "${ColumnName & string}". System columns (createdAt, updatedAt, isDeleted, ownerId) are added automatically.`> : never : never : never : never : never;
63
- export type ValidateColumnTypes<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? keyof S[TableName] extends infer ColumnName ? ColumnName extends keyof S[TableName] ? InferType<S[TableName][ColumnName]> extends SqliteValue ? never : SchemaValidationError<`Table "${TableName & string}" column "${ColumnName & string}" type is not compatible with SQLite. Column types must extend SqliteValue (string, number, Uint8Array, or null).`> : never : never : never : never;
64
- /** Schema validation error that shows clear, readable messages */
65
- export type SchemaValidationError<Message extends string> = `❌ Schema Error: ${Message}`;
66
72
  export type IndexesConfig = (create: (indexName: string) => Kysely.CreateIndexBuilder) => ReadonlyArray<Kysely.CreateIndexBuilder<any>>;
67
- export declare const evoluSchemaToDbSchema: (schema: EvoluSchema, indexesConfig?: IndexesConfig) => DbSchema;
68
73
  export type CreateQuery<S extends EvoluSchema> = <R extends Row>(queryCallback: (db: Pick<Kysely.Kysely<{
69
74
  [Table in keyof S]: {
70
- readonly [Column in keyof S[Table]]: Column extends "id" ? InferType<S[Table][Column]> : InferType<S[Table][Column]> | null;
75
+ readonly [Column in keyof S[Table]]: Column extends "id" ? StandardSchemaV1.InferOutput<S[Table][Column]> : StandardSchemaV1.InferOutput<S[Table][Column]> | null;
71
76
  } & SystemColumns;
72
77
  } & {
73
78
  readonly evolu_history: {
@@ -84,30 +89,48 @@ export type CreateQuery<S extends EvoluSchema> = <R extends Row>(queryCallback:
84
89
  readonly column: string;
85
90
  readonly value: SqliteValue;
86
91
  };
87
- }>, "selectFrom" | "fn" | "with" | "withRecursive">) => Kysely.SelectQueryBuilder<any, any, R>, options?: SqliteQueryOptions) => Query<Simplify<R>>;
92
+ }>, "selectFrom" | "fn" | "with" | "withRecursive">) => Kysely.SelectQueryBuilder<any, any, R>, options?: SqliteQueryOptions) => Query<S, Simplify<R>>;
88
93
  /**
89
94
  * System columns that are implicitly defined by Evolu.
90
95
  *
91
- * - `createdAt`: Set by Evolu on row creation, derived from {@link Timestamp}.
92
- * - `updatedAt`: Set by Evolu on every row change, derived from {@link Timestamp}.
96
+ * - `createdAt`: Set by Evolu on row creation, derived from Timestamp.
97
+ * - `updatedAt`: Set by Evolu on every row change, derived from Timestamp.
93
98
  * - `isDeleted`: Soft delete flag created by Evolu and used by the developer to
94
99
  * mark rows as deleted.
95
100
  * - `ownerId`: Represents ownership and logically partitions the database.
96
101
  */
97
- export declare const SystemColumns: ObjectType<{
98
- createdAt: import("../Type.js").BrandType<Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "DateIso", import("../Type.js").DateIsoError, import("../Type.js").StringError>;
99
- updatedAt: import("../Type.js").BrandType<Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "DateIso", import("../Type.js").DateIsoError, import("../Type.js").StringError>;
100
- isDeleted: import("../Type.js").UnionType<[Type<"Null", null, null, import("../Type.js").NullError, null, import("../Type.js").NullError>, import("../Type.js").UnionType<[import("../Type.js").LiteralType<0>, import("../Type.js").LiteralType<1>]>]>;
101
- ownerId: import("../Type.js").BrandType<import("../Type.js").BrandType<Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "Id", import("../Type.js").IdError, import("../Type.js").StringError>, "OwnerId", import("../Type.js").BrandWithoutRefineError<"OwnerId", import("../Type.js").StringError | import("../Type.js").IdError>, never>;
102
+ export declare const SystemColumns: import("../Type.js").ObjectType<{
103
+ createdAt: import("../Type.js").BrandType<import("../Type.js").Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "DateIso", import("../Type.js").DateIsoError, import("../Type.js").StringError>;
104
+ updatedAt: import("../Type.js").BrandType<import("../Type.js").Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "DateIso", import("../Type.js").DateIsoError, import("../Type.js").StringError>;
105
+ isDeleted: import("../Type.js").UnionType<[import("../Type.js").Type<"Null", null, null, import("../Type.js").NullError, null, import("../Type.js").NullError>, import("../Type.js").UnionType<[import("../Type.js").LiteralType<0>, import("../Type.js").LiteralType<1>]>]>;
106
+ ownerId: import("../Type.js").BrandType<import("../Type.js").BrandType<import("../Type.js").Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>, "Id", import("../Type.js").IdError, import("../Type.js").StringError>, "OwnerId", import("../Type.js").BrandWithoutRefineError<"OwnerId", import("../Type.js").StringError | import("../Type.js").IdError>, never>;
102
107
  }>;
103
- export type SystemColumns = typeof SystemColumns.Type;
104
- export declare const systemColumns: ReadonlySet<string>;
105
- export declare const systemColumnsWithId: readonly string[];
108
+ export interface SystemColumns extends InferType<typeof SystemColumns> {
109
+ }
106
110
  export type MutationKind = "insert" | "update" | "upsert";
107
- export type Mutation<S extends EvoluSchema, Kind extends MutationKind> = <TableName extends keyof S>(table: TableName, props: InferInput<ObjectType<MutationMapping<S[TableName], Kind>>>, options?: MutationOptions) => Result<{
108
- readonly id: S[TableName]["id"]["Type"];
109
- }, ValidMutationSizeError | MergeObjectTypeErrors<ObjectType<MutationMapping<S[TableName], Kind>>>>;
110
- export type MutationMapping<P extends Record<string, AnyType>, M extends MutationKind> = M extends "insert" ? InsertableProps<P> : M extends "update" ? UpdateableProps<P> : UpsertableProps<P>;
111
+ /**
112
+ * Mutation function type. Accepts already-validated values — validation is the
113
+ * caller's responsibility using any Standard Schema library (Evolu Type, Zod,
114
+ * Valibot, ArkType, etc.).
115
+ *
116
+ * Evolu does not use SQL for mutations to ensure data can be deterministically
117
+ * merged without conflicts. Explicit mutations also allow Evolu to
118
+ * automatically update {@link SystemColumns} and encourage developers to
119
+ * consider the number of changes produced, unlike SQL where a single query can
120
+ * inadvertently generate a large volume of CRDT messages. Each mutation
121
+ * produces exactly one {@link CrdtMessage} containing all provided columns.
122
+ *
123
+ * Mutations never fail — values are already validated by the caller, and
124
+ * changes are stored locally in SQLite.
125
+ *
126
+ * - **insert**: all non-nullable columns required, nullable columns optional,
127
+ * `id` omitted (auto-generated)
128
+ * - **update**: only `id` required, everything else optional
129
+ * - **upsert**: like insert but `id` required too
130
+ */
131
+ export type Mutation<S extends EvoluSchema, Kind extends MutationKind> = <TableName extends keyof S>(table: TableName, values: MutationValues<S[TableName], Kind>, options?: MutationOptions) => {
132
+ readonly id: StandardSchemaV1.InferOutput<S[TableName]["id"]>;
133
+ };
111
134
  export interface MutationOptions {
112
135
  /**
113
136
  * Called after the mutation is completed and the local state is updated.
@@ -145,120 +168,92 @@ export interface MutationOptions {
145
168
  * { ownerId: sharedOwner.id },
146
169
  * );
147
170
  * ```
148
- *
149
- * @experimental
150
171
  */
151
172
  readonly ownerId?: OwnerId;
152
- /**
153
- * Only validate, don't mutate.
154
- *
155
- * For example, `onChange` handler can call `insert`/`update`/`upsert` with
156
- * `onlyValidate: true`.
157
- */
158
- readonly onlyValidate?: boolean;
159
173
  }
160
174
  export interface MutationChange extends DbChange {
161
- /** Owner of the change. If undefined, the change belongs to the AppOwner. */
162
- readonly ownerId?: OwnerId | undefined;
175
+ readonly ownerId: OwnerId;
163
176
  }
164
177
  /**
165
- * Type Factory to create insertable {@link Type}. It makes nullable Types
166
- * optional (so they are not required), omits Id, and ensures the
167
- * {@link maxMutationSize}.
168
- *
169
- * ### Example
170
- *
171
- * ```ts
172
- * const InsertableTodo = insertable(Schema.todo);
173
- * type InsertableTodo = typeof InsertableTodo.Type;
174
- * const todo = InsertableTodo.from({ title });
175
- * if (!todo.ok) return; // handle errors
176
- * ```
178
+ * Derives the expected values type for a mutation from a table's column schemas
179
+ * and a {@link MutationKind}.
177
180
  */
178
- export declare const insertable: <Props extends Record<string, AnyType>>(props: Props) => ValidMutationSize<InsertableProps<Props>>;
179
- export type InsertableProps<Props extends Record<string, AnyType>> = Omit<NullableToOptionalProps<Props>, "id">;
180
- export type Insertable<Props extends Record<string, AnyType>> = InferInput<ObjectType<InsertableProps<Props>>>;
181
+ export type MutationValues<T extends TableSchema, M extends MutationKind> = Simplify<M extends "insert" ? InsertValues<T> : M extends "update" ? UpdateValues<T> : UpsertValues<T>>;
181
182
  /**
182
- * Type Factory to create updateable {@link Type}. It makes everything except for
183
- * the `id` column optional (so they are not required) and ensures the
184
- * {@link maxMutationSize}.
185
- *
186
- * ### Example
187
- *
188
- * ```ts
189
- * const UpdateableTodo = updateable(Schema.todo);
190
- * type UpdateableTodo = typeof UpdateableTodo.Type;
191
- *
192
- * // `id` is required; all other fields are optional.
193
- * const todoResult = UpdateableTodo.from({
194
- * id: "123",
195
- * title: "New Title",
196
- * });
197
- * if (!todo.ok) return; // handle errors
198
- * ```
183
+ * Insert values: `id` omitted (auto-generated), nullable columns optional,
184
+ * non-nullable columns required.
185
+ */
186
+ export type InsertValues<T extends TableSchema> = Omit<NullableColumnsToOptional<T>, "id">;
187
+ /**
188
+ * Update values: `id` required, all other columns optional. Includes
189
+ * `isDeleted` for soft deletes.
199
190
  */
200
- export declare const updateable: <Props extends Record<string, AnyType>>(props: Props) => ValidMutationSize<UpdateableProps<Props>>;
201
- export type UpdateableProps<Props extends Record<string, AnyType>> = {
202
- [K in keyof Props]: K extends "id" ? Props[K] : OptionalType<Props[K]>;
191
+ export type UpdateValues<T extends TableSchema> = {
192
+ readonly id: StandardSchemaV1.InferOutput<T["id"]>;
193
+ } & {
194
+ readonly [K in Exclude<keyof T, "id">]?: StandardSchemaV1.InferOutput<T[K]>;
203
195
  } & {
204
- isDeleted: OptionalType<typeof SqliteBoolean>;
196
+ readonly isDeleted?: SqliteBoolean;
205
197
  };
206
- export type Updateable<Props extends Record<string, AnyType>> = InferInput<ObjectType<UpdateableProps<Props>>>;
207
198
  /**
208
- * Type Factory to create an upsertable Type. It makes nullable Types optional
209
- * (so they are not required) and ensures the {@link maxMutationSize}.
210
- *
211
- * Upsert is like insert, except it requires an ID. It's useful for inserting
212
- * rows with external ID via {@link createIdFromString}.
199
+ * Upsert values: `id` required, nullable columns optional, non-nullable columns
200
+ * required. Includes `isDeleted` for soft deletes.
201
+ */
202
+ export type UpsertValues<T extends TableSchema> = NullableColumnsToOptional<T> & {
203
+ readonly isDeleted?: SqliteBoolean;
204
+ };
205
+ export type ValidateSchemaHasId<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? "id" extends keyof S[TableName] ? never : SchemaValidationError<`Table "${TableName & string}" is missing required id column.`> : never : never;
206
+ export type ValidateIdColumnType<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? "id" extends keyof S[TableName] ? StandardSchemaV1.InferOutput<S[TableName]["id"]> extends Id ? never : SchemaValidationError<`Table "${TableName & string}" id column output type must extend Id. Use id("${TableName & string}") from Evolu Type.`> : never : never : never;
207
+ export type ValidateNoSystemColumns<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? keyof S[TableName] extends infer ColumnName ? ColumnName extends keyof S[TableName] ? ColumnName extends "createdAt" | "updatedAt" | "isDeleted" | "ownerId" ? SchemaValidationError<`Table "${TableName & string}" uses system column name "${ColumnName & string}". System columns (createdAt, updatedAt, isDeleted, ownerId) are added automatically.`> : never : never : never : never : never;
208
+ export type ValidateColumnTypes<S extends EvoluSchema> = keyof S extends infer TableName ? TableName extends keyof S ? keyof S[TableName] extends infer ColumnName ? ColumnName extends keyof S[TableName] ? StandardSchemaV1.InferOutput<S[TableName][ColumnName]> extends SqliteValue ? never : SchemaValidationError<`Table "${TableName & string}" column "${ColumnName & string}" type is not compatible with SQLite. Column types must extend SqliteValue (string, number, Uint8Array, or null).`> : never : never : never : never;
209
+ /** Schema validation error that shows clear, readable messages */
210
+ export type SchemaValidationError<Message extends string> = `❌ Schema Error: ${Message}`;
211
+ /** Makes columns whose output type includes `null` optional. */
212
+ export type NullableColumnsToOptional<T extends TableSchema> = {
213
+ readonly [K in RequiredColumnKeys<T>]: StandardSchemaV1.InferOutput<T[K]>;
214
+ } & {
215
+ readonly [K in OptionalColumnKeys<T>]?: StandardSchemaV1.InferOutput<T[K]>;
216
+ };
217
+ export type RequiredColumnKeys<T extends TableSchema> = {
218
+ [K in keyof T]: null extends StandardSchemaV1.InferOutput<T[K]> ? never : K;
219
+ }[keyof T];
220
+ export type OptionalColumnKeys<T extends TableSchema> = {
221
+ [K in keyof T]: null extends StandardSchemaV1.InferOutput<T[K]> ? K : never;
222
+ }[keyof T];
223
+ export declare const systemColumns: ReadonlySet<string>;
224
+ export declare const systemColumnsWithId: ReadonlyArray<string>;
225
+ export declare const evoluSchemaToSqliteSchema: <S extends EvoluSchema>(schema: ValidateSchema<S> extends never ? S : ValidateSchema<S>, indexesConfig?: IndexesConfig) => SqliteSchema;
226
+ /**
227
+ * Creates a query builder from a {@link EvoluSchema}.
213
228
  *
214
- * Note that it's not possible to upsert a row with `createdAt` nor `updatedAt`,
215
- * because they are derived from {@link CrdtMessage} timestamp. For external
216
- * createdAt, use a different column.
229
+ * Supports Kysely relation-style query composition (nested objects/arrays via
230
+ * JSON subqueries), such as {@link evoluJsonObjectFrom} and
231
+ * {@link evoluJsonArrayFrom}. These helpers are Evolu's safer SQLite variants of
232
+ * the
233
+ * {@link https://kysely.dev/docs/recipes/relations | Kysely relations recipe}.
217
234
  *
218
235
  * ### Example
219
236
  *
220
237
  * ```ts
221
- * const UpsertableTodo = upsertable(Schema.todo);
222
- * type UpsertableTodo = typeof UpsertableTodo.Type;
223
- * const todo = UpsertableTodo.from({
224
- * id,
225
- * title,
226
- * });
227
- * if (!todo.ok) return; // handle errors
238
+ * const Schema = {
239
+ * todo: {
240
+ * id: id("Todo"),
241
+ * title: NonEmptyString100,
242
+ * isCompleted: nullOr(SqliteBoolean),
243
+ * },
244
+ * };
245
+ *
246
+ * // Create a typed query builder (once per schema)
247
+ * const createQuery = createQueryBuilder(Schema);
248
+ *
249
+ * // Use it for all queries
250
+ * const todosQuery = createQuery((db) =>
251
+ * db.selectFrom("todo").select(["id", "title", "isCompleted"]),
252
+ * );
228
253
  * ```
229
254
  */
230
- export declare const upsertable: <Props extends Record<string, AnyType>>(props: Props) => ValidMutationSize<UpsertableProps<Props>>;
231
- export type UpsertableProps<Props extends Record<string, AnyType>> = NullableToOptionalProps<Props & {
232
- isDeleted: OptionalType<typeof SqliteBoolean>;
233
- }>;
234
- export type Upsertable<Props extends Record<string, AnyType>> = InferInput<ObjectType<UpsertableProps<Props>>>;
235
- export type InferEvoluSchemaError<S extends EvoluSchema> = {
236
- [Table in keyof S]: InferMutationTypeErrors<S[Table]>;
237
- }[keyof S];
238
- export type InferMutationTypeErrors<T extends Record<string, AnyType>> = InferColumnErrors<T, "insert"> | InferColumnErrors<T, "update"> | InferColumnErrors<T, "upsert">;
239
- export type InferColumnErrors<T extends Record<string, AnyType>, M extends MutationKind> = {
240
- [Column in keyof MutationMapping<T, M>]: InferErrors<MutationMapping<T, M>[Column]>;
241
- }[keyof MutationMapping<T, M>];
242
- export declare const DbIndex: ObjectType<{
243
- name: Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>;
244
- sql: Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>;
245
- }>;
246
- export type DbIndex = typeof DbIndex.Type;
247
- export declare const DbSchema: ObjectType<{
248
- tables: import("../Type.js").RecordType<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError, import("../Type.js").SetType<Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>>>;
249
- indexes: import("../Type.js").ArrayType<ObjectType<{
250
- name: Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>;
251
- sql: Type<"String", string, string, import("../Type.js").StringError, string, import("../Type.js").StringError>;
252
- }>>;
253
- }>;
254
- export type DbSchema = typeof DbSchema.Type;
255
- export interface DbSchemaDep {
256
- readonly dbSchema: DbSchema;
257
- }
258
- /** Get the current database schema by reading SQLite metadata. */
259
- export declare const getDbSchema: (deps: SqliteDep) => ({ allIndexes }?: {
260
- allIndexes?: boolean;
261
- }) => Result<DbSchema, SqliteError>;
262
- export declare const ensureDbSchema: (deps: SqliteDep) => (newSchema: DbSchema, currentSchema?: DbSchema) => Result<void, SqliteError>;
255
+ export declare const createQueryBuilder: <S extends EvoluSchema>(_schema: S) => CreateQuery<S>;
256
+ export declare const ensureSqliteSchema: (deps: SqliteDep) => (newSchema: SqliteSchema, currentSchema?: SqliteSchema) => void;
257
+ export declare const getEvoluSqliteSchema: (deps: SqliteDep) => () => SqliteSchema;
263
258
  export declare const kysely: Kysely.Kysely<unknown>;
264
259
  //# sourceMappingURL=Schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/local-first/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAIL,cAAc,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAM,MAAM,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAGL,aAAa,EACb,SAAS,EACT,WAAW,EAEX,kBAAkB,EAClB,WAAW,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,OAAO,EAIP,OAAO,EACP,WAAW,EACX,UAAU,EACV,SAAS,EAET,qBAAqB,EAErB,uBAAuB,EAGvB,UAAU,EAGV,YAAY,EAIZ,OAAO,EACP,IAAI,EACJ,iBAAiB,EAEjB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA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