@livestore/common 0.0.0-snapshot-8115ad48d5a57244358c943ecc92bb0a30274b87 → 0.0.0-snapshot-fe350f42b94ebf67d6bfd18480008befb405cf64
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/.tsbuildinfo +1 -1
- package/dist/adapter-types.d.ts +2 -8
- package/dist/adapter-types.d.ts.map +1 -1
- package/dist/adapter-types.js.map +1 -1
- package/dist/devtools/devtools-messages-client-session.d.ts +21 -21
- package/dist/devtools/devtools-messages-common.d.ts +6 -6
- package/dist/devtools/devtools-messages-leader.d.ts +24 -24
- package/dist/leader-thread/apply-event.d.ts.map +1 -1
- package/dist/leader-thread/apply-event.js +2 -21
- package/dist/leader-thread/apply-event.js.map +1 -1
- package/dist/leader-thread/recreate-db.d.ts.map +1 -1
- package/dist/leader-thread/recreate-db.js +0 -1
- package/dist/leader-thread/recreate-db.js.map +1 -1
- package/dist/query-builder/api.d.ts +3 -3
- package/dist/query-builder/api.d.ts.map +1 -1
- package/dist/query-builder/impl.d.ts.map +1 -1
- package/dist/query-builder/impl.js +11 -5
- package/dist/query-builder/impl.js.map +1 -1
- package/dist/query-builder/impl.test.d.ts.map +1 -1
- package/dist/query-builder/impl.test.js +166 -120
- package/dist/query-builder/impl.test.js.map +1 -1
- package/dist/rehydrate-from-eventlog.d.ts +2 -3
- package/dist/rehydrate-from-eventlog.d.ts.map +1 -1
- package/dist/rehydrate-from-eventlog.js +1 -3
- package/dist/rehydrate-from-eventlog.js.map +1 -1
- package/dist/schema/schema.d.ts +1 -1
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/table-def.d.ts.map +1 -1
- package/dist/schema/table-def.js +4 -2
- package/dist/schema/table-def.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/adapter-types.ts +3 -9
- package/src/leader-thread/apply-event.ts +3 -27
- package/src/leader-thread/recreate-db.ts +0 -1
- package/src/query-builder/api.ts +3 -3
- package/src/query-builder/impl.test.ts +178 -131
- package/src/query-builder/impl.ts +11 -6
- package/src/rehydrate-from-eventlog.ts +1 -5
- package/src/schema/schema.ts +1 -1
- package/src/schema/table-def.ts +4 -2
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memoizeByRef } from '@livestore/utils'
|
|
2
2
|
import { Chunk, Effect, Option, Schema, Stream } from '@livestore/utils/effect'
|
|
3
3
|
|
|
4
|
-
import { type
|
|
4
|
+
import { type SqliteDb, UnexpectedError } from './adapter-types.js'
|
|
5
5
|
import type { ApplyEvent } from './leader-thread/mod.js'
|
|
6
6
|
import type { EventDef, EventlogMetaRow, LiveStoreSchema } from './schema/mod.js'
|
|
7
7
|
import { EventId, EVENTLOG_META_TABLE, getEventDef, LiveStoreEvent } from './schema/mod.js'
|
|
@@ -13,14 +13,12 @@ export const rehydrateFromEventlog = ({
|
|
|
13
13
|
// TODO re-use this db when bringing back the boot in-memory db implementation
|
|
14
14
|
// db,
|
|
15
15
|
schema,
|
|
16
|
-
migrationOptions,
|
|
17
16
|
onProgress,
|
|
18
17
|
applyEvent,
|
|
19
18
|
}: {
|
|
20
19
|
dbEventlog: SqliteDb
|
|
21
20
|
// db: SqliteDb
|
|
22
21
|
schema: LiveStoreSchema
|
|
23
|
-
migrationOptions: MigrationOptionsFromEventlog
|
|
24
22
|
onProgress: (_: { done: number; total: number }) => Effect.Effect<void>
|
|
25
23
|
applyEvent: ApplyEvent
|
|
26
24
|
}) =>
|
|
@@ -34,8 +32,6 @@ export const rehydrateFromEventlog = ({
|
|
|
34
32
|
Effect.gen(function* () {
|
|
35
33
|
const eventDef = getEventDef(schema, row.name)
|
|
36
34
|
|
|
37
|
-
if (migrationOptions.excludeEvents?.has(row.name) === true) return
|
|
38
|
-
|
|
39
35
|
if (hashEvent(eventDef.eventDef) !== row.schemaHash) {
|
|
40
36
|
yield* Effect.logWarning(`Schema hash mismatch for mutation ${row.name}. Trying to apply mutation anyway.`)
|
|
41
37
|
}
|
package/src/schema/schema.ts
CHANGED
|
@@ -49,7 +49,7 @@ export const makeSchema = <TInputSchema extends InputSchema>(
|
|
|
49
49
|
/** Note when using the object-notation for tables/events, the object keys are ignored and not used as table/mutation names */
|
|
50
50
|
inputSchema: TInputSchema & {
|
|
51
51
|
/** "hard-reset" is currently the default strategy */
|
|
52
|
-
migrations?: MigrationOptions
|
|
52
|
+
migrations?: MigrationOptions
|
|
53
53
|
},
|
|
54
54
|
): FromInputSchema.DeriveSchema<TInputSchema> => {
|
|
55
55
|
// const inputTables: ReadonlyArray<TableDef> = Array.isArray(inputSchema.tables)
|
package/src/schema/table-def.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Nullable } from '@livestore/utils'
|
|
|
2
2
|
import type { Schema, Types } from '@livestore/utils/effect'
|
|
3
3
|
|
|
4
4
|
import type { QueryBuilder } from '../query-builder/mod.js'
|
|
5
|
-
import { makeQueryBuilder, QueryBuilderAstSymbol } from '../query-builder/mod.js'
|
|
5
|
+
import { makeQueryBuilder, QueryBuilderAstSymbol, QueryBuilderTypeId } from '../query-builder/mod.js'
|
|
6
6
|
import { SqliteDsl } from './db-schema/mod.js'
|
|
7
7
|
|
|
8
8
|
export const { blob, boolean, column, datetime, integer, isColumnDefinition, json, real, text } = SqliteDsl
|
|
@@ -108,8 +108,10 @@ export const table = <
|
|
|
108
108
|
tableDef[key] = query[key]
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
// @ts-expect-error TODO properly
|
|
111
|
+
// @ts-expect-error TODO properly type this
|
|
112
112
|
tableDef[QueryBuilderAstSymbol] = query[QueryBuilderAstSymbol]
|
|
113
|
+
// @ts-expect-error TODO properly type this
|
|
114
|
+
tableDef[QueryBuilderTypeId] = query[QueryBuilderTypeId]
|
|
113
115
|
|
|
114
116
|
return tableDef as any
|
|
115
117
|
}
|
package/src/version.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// import packageJson from '../package.json' with { type: 'json' }
|
|
3
3
|
// export const liveStoreVersion = packageJson.version
|
|
4
4
|
|
|
5
|
-
export const liveStoreVersion = '0.3.0-dev.
|
|
5
|
+
export const liveStoreVersion = '0.3.0-dev.31' as const
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* This version number is incremented whenever the internal storage format changes in a breaking way.
|