@livestore/livestore 0.0.56-dev.0 → 0.0.56-dev.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livestore/livestore",
3
- "version": "0.0.56-dev.0",
3
+ "version": "0.0.56-dev.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@graphql-typed-document-node/core": "^3.2.0",
32
32
  "@opentelemetry/api": "^1.9.0",
33
- "@livestore/utils": "0.0.56-dev.0",
34
- "effect-db-schema": "0.0.56-dev.0",
35
- "@livestore/common": "0.0.56-dev.0"
33
+ "@livestore/common": "0.0.56-dev.1",
34
+ "effect-db-schema": "0.0.56-dev.1",
35
+ "@livestore/utils": "0.0.56-dev.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@opentelemetry/sdk-trace-base": "1.25.1",
@@ -46,7 +46,7 @@
46
46
  "typescript": "5.5.4",
47
47
  "vite": "5.3.5",
48
48
  "vitest": "^2.0.4",
49
- "@livestore/web": "0.0.56-dev.0"
49
+ "@livestore/web": "0.0.56-dev.1"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "graphql": "16.x",
@@ -2,10 +2,10 @@
2
2
 
3
3
  import type {
4
4
  DebugInfo,
5
- InMemoryDatabase,
6
5
  MutableDebugInfo,
7
6
  PreparedBindValues,
8
7
  PreparedStatement,
8
+ SynchronousDatabase,
9
9
  } from '@livestore/common'
10
10
  import { BoundArray, BoundMap, sql } from '@livestore/common'
11
11
  import { shouldNeverHappen } from '@livestore/utils'
@@ -21,12 +21,12 @@ export const emptyDebugInfo = (): DebugInfo => ({
21
21
  events: new BoundArray(1000),
22
22
  })
23
23
 
24
- export class MainDatabaseWrapper {
24
+ export class SynchronousDatabaseWrapper {
25
25
  // TODO: how many unique active statements are expected?
26
26
  private cachedStmts = new BoundMap<string, PreparedStatement>(200)
27
27
  private tablesUsedCache = new BoundMap<string, Set<string>>(200)
28
28
  private resultCache = new QueryCache()
29
- private db: InMemoryDatabase
29
+ private db: SynchronousDatabase
30
30
  private otelTracer: otel.Tracer
31
31
  private otelRootSpanContext: otel.Context
32
32
  private tablesUsedStmt
@@ -36,7 +36,7 @@ export class MainDatabaseWrapper {
36
36
  db,
37
37
  otel,
38
38
  }: {
39
- db: InMemoryDatabase
39
+ db: SynchronousDatabase
40
40
  otel: {
41
41
  tracer: otel.Tracer
42
42
  rootSpanContext: otel.Context
@@ -244,7 +244,7 @@ export class MainDatabaseWrapper {
244
244
  }
245
245
 
246
246
  /** Set up SQLite performance; hasn't been super carefully optimized yet. */
247
- const configureSQLite = (db: MainDatabaseWrapper) => {
247
+ const configureSQLite = (db: SynchronousDatabaseWrapper) => {
248
248
  db.execute(
249
249
  // TODO: revisit these tuning parameters for max performance
250
250
  sql`
@@ -5,10 +5,10 @@ import { Context, Deferred, Duration, Effect, FiberSet, Layer, OtelTracer, pipe
5
5
  import * as otel from '@opentelemetry/api'
6
6
  import type { GraphQLSchema } from 'graphql'
7
7
 
8
- import type { MainDatabaseWrapper } from '../MainDatabaseWrapper.js'
9
8
  import type { LiveQuery } from '../reactiveQueries/base-class.js'
10
9
  import type { BaseGraphQLContext, GraphQLOptions, OtelOptions, Store } from '../store.js'
11
10
  import { createStore } from '../store.js'
11
+ import type { SynchronousDatabaseWrapper } from '../SynchronousDatabaseWrapper.js'
12
12
 
13
13
  // TODO get rid of `LiveStoreContext` wrapper and only expose the `Store` directly
14
14
  export type LiveStoreContext =
@@ -54,7 +54,7 @@ export type LiveStoreContextProps<GraphQLContext extends BaseGraphQLContext> = {
54
54
  schema: LiveStoreSchema
55
55
  graphQLOptions?: {
56
56
  schema: Effect.Effect<GraphQLSchema, never, otel.Tracer>
57
- makeContext: (db: MainDatabaseWrapper) => GraphQLContext
57
+ makeContext: (db: SynchronousDatabaseWrapper) => GraphQLContext
58
58
  }
59
59
  boot?: (db: BootDb) => Effect.Effect<void, unknown, otel.Tracer>
60
60
  adapter: StoreAdapterFactory
package/src/index.ts CHANGED
@@ -7,7 +7,7 @@ export type {
7
7
  LiveStoreContextRunning as LiveStoreContext,
8
8
  } from './effect/LiveStore.js'
9
9
 
10
- export { MainDatabaseWrapper, emptyDebugInfo } from './MainDatabaseWrapper.js'
10
+ export { SynchronousDatabaseWrapper, emptyDebugInfo } from './SynchronousDatabaseWrapper.js'
11
11
 
12
12
  export type {
13
13
  GetAtom,
@@ -40,7 +40,7 @@ export {
40
40
  sql,
41
41
  type BootDb,
42
42
  type BootStatus,
43
- type InMemoryDatabase,
43
+ type SynchronousDatabase,
44
44
  type DebugInfo,
45
45
  type MutableDebugInfo,
46
46
  prepareBindValues,
@@ -153,7 +153,7 @@ export class LiveStoreSQLQuery<
153
153
  : get(queryString$OrQueryString, otelContext)
154
154
 
155
155
  if (queriedTablesRef.current === undefined) {
156
- queriedTablesRef.current = store.mainDbWrapper.getTablesUsed(sqlString)
156
+ queriedTablesRef.current = store.syncDbWrapper.getTablesUsed(sqlString)
157
157
  }
158
158
 
159
159
  // Establish a reactive dependency on the tables used in the query
@@ -165,7 +165,7 @@ export class LiveStoreSQLQuery<
165
165
  span.setAttribute('sql.query', sqlString)
166
166
  span.updateName(`sql:${sqlString.slice(0, 50)}`)
167
167
 
168
- const rawResults = store.mainDbWrapper.select<any>(sqlString, {
168
+ const rawResults = store.syncDbWrapper.select<any>(sqlString, {
169
169
  queriedTables,
170
170
  bindValues: bindValues ? prepareBindValues(bindValues, sqlString) : undefined,
171
171
  otelContext,
package/src/row-query.ts CHANGED
@@ -163,7 +163,7 @@ const insertRowWithDefaultValuesOrIgnore = ({
163
163
  otelContext: otel.Context
164
164
  explicitDefaultValues: Partial<RowResult<DbSchema.TableDef>> | undefined
165
165
  }) => {
166
- const rowExists = store.mainDbWrapper.select(`select 1 from ${table.sqliteDef.name} where id = '${id}'`).length === 1
166
+ const rowExists = store.syncDbWrapper.select(`select 1 from ${table.sqliteDef.name} where id = '${id}'`).length === 1
167
167
  if (rowExists) return
168
168
 
169
169
  // const mutationDef = deriveCreateMutationDef(table)
@@ -1,19 +1,19 @@
1
1
  import type { DebugInfo, StoreAdapter } from '@livestore/common'
2
2
  import { Devtools, liveStoreVersion, UnexpectedError } from '@livestore/common'
3
3
  import { throttle } from '@livestore/utils'
4
- import type { BrowserChannel } from '@livestore/utils/effect'
4
+ import type { WebChannel } from '@livestore/utils/effect'
5
5
  import { Effect, Stream } from '@livestore/utils/effect'
6
6
 
7
- import type { MainDatabaseWrapper } from './MainDatabaseWrapper.js'
8
- import { emptyDebugInfo as makeEmptyDebugInfo } from './MainDatabaseWrapper.js'
9
7
  import { NOT_REFRESHED_YET } from './reactive.js'
10
8
  import type { LiveQuery, ReactivityGraph } from './reactiveQueries/base-class.js'
9
+ import type { SynchronousDatabaseWrapper } from './SynchronousDatabaseWrapper.js'
10
+ import { emptyDebugInfo as makeEmptyDebugInfo } from './SynchronousDatabaseWrapper.js'
11
11
  import type { ReferenceCountedSet } from './utils/data-structures.js'
12
12
 
13
13
  type IStore = {
14
14
  adapter: StoreAdapter
15
15
  reactivityGraph: ReactivityGraph
16
- mainDbWrapper: MainDatabaseWrapper
16
+ syncDbWrapper: SynchronousDatabaseWrapper
17
17
  activeQueries: ReferenceCountedSet<LiveQuery<any>>
18
18
  }
19
19
 
@@ -25,7 +25,7 @@ export const connectDevtoolsToStore = ({
25
25
  storeDevtoolsChannel,
26
26
  store,
27
27
  }: {
28
- storeDevtoolsChannel: BrowserChannel.BrowserChannel<Devtools.MessageToAppHostStore, Devtools.MessageFromAppHostStore>
28
+ storeDevtoolsChannel: WebChannel.WebChannel<Devtools.MessageToAppHostStore, Devtools.MessageFromAppHostStore>
29
29
  store: IStore
30
30
  }) =>
31
31
  Effect.gen(function* () {
@@ -84,7 +84,7 @@ export const connectDevtoolsToStore = ({
84
84
  case 'LSD.DebugInfoReq': {
85
85
  sendToDevtools(
86
86
  Devtools.DebugInfoRes.make({
87
- debugInfo: store.mainDbWrapper.debugInfo,
87
+ debugInfo: store.syncDbWrapper.debugInfo,
88
88
  requestId,
89
89
  channelId,
90
90
  liveStoreVersion,
@@ -98,13 +98,13 @@ export const connectDevtoolsToStore = ({
98
98
  let rafHandle: number | undefined
99
99
 
100
100
  const tick = () => {
101
- buffer.push(store.mainDbWrapper.debugInfo)
101
+ buffer.push(store.syncDbWrapper.debugInfo)
102
102
 
103
103
  // NOTE this resets the debug info, so all other "readers" e.g. in other `requestAnimationFrame` loops,
104
104
  // will get the empty debug info
105
105
  // TODO We need to come up with a more graceful way to do store. Probably via a single global
106
106
  // `requestAnimationFrame` loop that is passed in somehow.
107
- store.mainDbWrapper.debugInfo = makeEmptyDebugInfo()
107
+ store.syncDbWrapper.debugInfo = makeEmptyDebugInfo()
108
108
 
109
109
  if (buffer.length > 10) {
110
110
  sendToDevtools(
@@ -142,13 +142,13 @@ export const connectDevtoolsToStore = ({
142
142
  break
143
143
  }
144
144
  case 'LSD.DebugInfoResetReq': {
145
- store.mainDbWrapper.debugInfo.slowQueries.clear()
145
+ store.syncDbWrapper.debugInfo.slowQueries.clear()
146
146
  sendToDevtools(Devtools.DebugInfoResetRes.make({ requestId, channelId, liveStoreVersion }))
147
147
  break
148
148
  }
149
149
  case 'LSD.DebugInfoRerunQueryReq': {
150
150
  const { queryStr, bindValues, queriedTables } = decodedMessage
151
- store.mainDbWrapper.select(queryStr, { bindValues, queriedTables, skipCache: true })
151
+ store.syncDbWrapper.select(queryStr, { bindValues, queriedTables, skipCache: true })
152
152
  sendToDevtools(Devtools.DebugInfoRerunQueryRes.make({ requestId, channelId, liveStoreVersion }))
153
153
  break
154
154
  }
package/src/store.ts CHANGED
@@ -34,11 +34,11 @@ import * as otel from '@opentelemetry/api'
34
34
  import type { GraphQLSchema } from 'graphql'
35
35
 
36
36
  import { globalReactivityGraph } from './global-state.js'
37
- import { MainDatabaseWrapper } from './MainDatabaseWrapper.js'
38
37
  import type { StackInfo } from './react/utils/stack-info.js'
39
38
  import type { DebugRefreshReasonBase, Ref } from './reactive.js'
40
39
  import type { LiveQuery, QueryContext, ReactivityGraph } from './reactiveQueries/base-class.js'
41
40
  import { connectDevtoolsToStore } from './store-devtools.js'
41
+ import { SynchronousDatabaseWrapper } from './SynchronousDatabaseWrapper.js'
42
42
  import { ReferenceCountedSet } from './utils/data-structures.js'
43
43
  import { downloadBlob } from './utils/dev.js'
44
44
  import { getDurationMsFromSpan } from './utils/otel.js'
@@ -51,7 +51,7 @@ export type BaseGraphQLContext = {
51
51
 
52
52
  export type GraphQLOptions<TContext> = {
53
53
  schema: GraphQLSchema
54
- makeContext: (db: MainDatabaseWrapper, tracer: otel.Tracer) => TContext
54
+ makeContext: (db: SynchronousDatabaseWrapper, tracer: otel.Tracer) => TContext
55
55
  }
56
56
 
57
57
  export type OtelOptions = {
@@ -132,7 +132,7 @@ export class Store<
132
132
  id = uniqueStoreId()
133
133
  private fiberSet: FiberSet.FiberSet
134
134
  reactivityGraph: ReactivityGraph
135
- mainDbWrapper: MainDatabaseWrapper
135
+ syncDbWrapper: SynchronousDatabaseWrapper
136
136
  adapter: StoreAdapter
137
137
  schema: LiveStoreSchema
138
138
  graphQLSchema?: GraphQLSchema
@@ -166,7 +166,7 @@ export class Store<
166
166
  }: StoreOptions<TGraphQLContext, TSchema>) {
167
167
  super()
168
168
 
169
- this.mainDbWrapper = new MainDatabaseWrapper({ otel: otelOptions, db: adapter.mainDb })
169
+ this.syncDbWrapper = new SynchronousDatabaseWrapper({ otel: otelOptions, db: adapter.syncDb })
170
170
  this.adapter = adapter
171
171
  this.schema = schema
172
172
 
@@ -226,7 +226,7 @@ export class Store<
226
226
 
227
227
  if (graphQLOptions) {
228
228
  this.graphQLSchema = graphQLOptions.schema
229
- this.graphQLContext = graphQLOptions.makeContext(this.mainDbWrapper, this.otel.tracer)
229
+ this.graphQLContext = graphQLOptions.makeContext(this.syncDbWrapper, this.otel.tracer)
230
230
  }
231
231
 
232
232
  Effect.gen(this, function* () {
@@ -422,7 +422,7 @@ export class Store<
422
422
 
423
423
  if (mutationsEvents.length > 1) {
424
424
  // TODO: what to do about coordinator transaction here?
425
- this.mainDbWrapper.txn(applyMutations)
425
+ this.syncDbWrapper.txn(applyMutations)
426
426
  } else {
427
427
  applyMutations()
428
428
  }
@@ -532,11 +532,11 @@ export class Store<
532
532
  for (const {
533
533
  statementSql,
534
534
  bindValues,
535
- writeTables = this.mainDbWrapper.getTablesUsed(statementSql),
535
+ writeTables = this.syncDbWrapper.getTablesUsed(statementSql),
536
536
  } of execArgsArr) {
537
537
  // TODO when the store doesn't have the lock, we need wait for the coordinator to confirm the mutation
538
538
  // before executing the mutation on the main db
539
- const { durationMs } = this.mainDbWrapper.execute(statementSql, bindValues, writeTables, { otelContext })
539
+ const { durationMs } = this.syncDbWrapper.execute(statementSql, bindValues, writeTables, { otelContext })
540
540
 
541
541
  durationMsTotal += durationMs
542
542
  writeTables.forEach((table) => allWriteTables.add(table))
@@ -573,13 +573,13 @@ export class Store<
573
573
  writeTables?: ReadonlySet<string>,
574
574
  otelContext?: otel.Context,
575
575
  ) => {
576
- this.mainDbWrapper.execute(query, prepareBindValues(params, query), writeTables, { otelContext })
576
+ this.syncDbWrapper.execute(query, prepareBindValues(params, query), writeTables, { otelContext })
577
577
 
578
578
  this.adapter.coordinator.execute(query, prepareBindValues(params, query)).pipe(runEffectFork)
579
579
  }
580
580
 
581
581
  select = (query: string, params: ParamsObject = {}) => {
582
- return this.mainDbWrapper.select(query, { bindValues: prepareBindValues(params, query) })
582
+ return this.syncDbWrapper.select(query, { bindValues: prepareBindValues(params, query) })
583
583
  }
584
584
 
585
585
  makeTableRef = (tableName: string) =>
@@ -590,7 +590,7 @@ export class Store<
590
590
  })
591
591
 
592
592
  __devDownloadDb = () => {
593
- const data = this.mainDbWrapper.export()
593
+ const data = this.syncDbWrapper.export()
594
594
  downloadBlob(data, `livestore-${Date.now()}.db`)
595
595
  }
596
596
 
@@ -737,7 +737,7 @@ export const createStore = <
737
737
  const bootDbImpl: BootDb = {
738
738
  _tag: 'BootDb',
739
739
  execute: (queryStr, bindValues) => {
740
- const stmt = adapter.mainDb.prepare(queryStr)
740
+ const stmt = adapter.syncDb.prepare(queryStr)
741
741
  stmt.execute(bindValues)
742
742
 
743
743
  if (isInTxn === true) {
@@ -758,7 +758,7 @@ export const createStore = <
758
758
  // const { bindValues, statementSql } = getExecArgsFromMutation({ mutationDef, mutationEventDecoded })
759
759
 
760
760
  for (const { statementSql, bindValues } of execArgsArr) {
761
- adapter.mainDb.execute(statementSql, bindValues)
761
+ adapter.syncDb.execute(statementSql, bindValues)
762
762
  }
763
763
 
764
764
  const mutationEventEncoded = Schema.encodeUnknownSync(mutationEventSchema)(mutationEventDecoded)
@@ -769,17 +769,17 @@ export const createStore = <
769
769
  }
770
770
  },
771
771
  select: (queryStr, bindValues) => {
772
- const stmt = adapter.mainDb.prepare(queryStr)
772
+ const stmt = adapter.syncDb.prepare(queryStr)
773
773
  return stmt.select(bindValues)
774
774
  },
775
775
  txn: (callback) => {
776
776
  try {
777
777
  isInTxn = true
778
- adapter.mainDb.execute('BEGIN', undefined)
778
+ adapter.syncDb.execute('BEGIN', undefined)
779
779
 
780
780
  callback()
781
781
 
782
- adapter.mainDb.execute('COMMIT', undefined)
782
+ adapter.syncDb.execute('COMMIT', undefined)
783
783
 
784
784
  // adapter.coordinator.execute('BEGIN', undefined, undefined)
785
785
  for (const [queryStr, bindValues] of txnExecuteStmnts) {
@@ -787,7 +787,7 @@ export const createStore = <
787
787
  }
788
788
  // adapter.coordinator.execute('COMMIT', undefined, undefined)
789
789
  } catch (e: any) {
790
- adapter.mainDb.execute('ROLLBACK', undefined)
790
+ adapter.syncDb.execute('ROLLBACK', undefined)
791
791
  throw e
792
792
  } finally {
793
793
  isInTxn = false
@@ -1 +0,0 @@
1
- {"version":3,"file":"MainDatabaseWrapper.d.ts","sourceRoot":"","sources":["../src/MainDatabaseWrapper.ts"],"names":[],"mappings":"AAEA,O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