File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/packages/emmett-sqlite/src/eventStore Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,9 @@ export const getSQLiteEventStore = (
162
162
db = createConnection ( ) ;
163
163
}
164
164
165
- await ensureSchemaExists ( ) ;
166
165
let stream ;
167
166
try {
167
+ await ensureSchemaExists ( ) ;
168
168
stream = await readStream < EventType > ( db , streamName , options ) ;
169
169
} catch ( err : Error ) {
170
170
closeConnection ( ) ;
@@ -185,15 +185,17 @@ export const getSQLiteEventStore = (
185
185
db = createConnection ( ) ;
186
186
}
187
187
188
- await ensureSchemaExists ( ) ;
189
188
// TODO: This has to be smarter when we introduce urn-based resolution
190
189
const [ firstPart , ...rest ] = streamName . split ( '-' ) ;
191
190
192
191
const streamType =
193
192
firstPart && rest . length > 0 ? firstPart : 'emt:unknown' ;
194
193
195
194
let appendResult ;
195
+
196
196
try {
197
+ await ensureSchemaExists ( ) ;
198
+
197
199
appendResult = await appendToStream (
198
200
db ,
199
201
streamName ,
You can’t perform that action at this time.
0 commit comments