File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 5
5
ProductTypeElement ,
6
6
SumType ,
7
7
SumTypeVariant ,
8
+ type ComparablePrimitive ,
8
9
} from './algebraic_type.ts' ;
9
10
import {
10
11
AlgebraicValue ,
@@ -320,7 +321,7 @@ export class DbConnectionImpl<
320
321
while ( reader . offset < buffer . length + buffer . byteOffset ) {
321
322
const initialOffset = reader . offset ;
322
323
const row = rowType . deserialize ( reader ) ;
323
- let rowId : any | undefined = undefined ;
324
+ let rowId : ComparablePrimitive | undefined = undefined ;
324
325
if ( primaryKeyInfo !== undefined ) {
325
326
rowId = primaryKeyInfo . colType . intoMapKey (
326
327
row [ primaryKeyInfo . colName ]
@@ -546,10 +547,13 @@ export class DbConnectionImpl<
546
547
const tableName = tableUpdate . tableName ;
547
548
const tableTypeInfo = this . #remoteModule. tables [ tableName ] ! ;
548
549
const table = this . clientCache . getOrCreateTable ( tableTypeInfo ) ;
549
-
550
- pendingCallbacks = pendingCallbacks . concat (
551
- table . applyOperations ( tableUpdate . operations , eventContext )
550
+ const newCallbacks = table . applyOperations (
551
+ tableUpdate . operations ,
552
+ eventContext
552
553
) ;
554
+ for ( const callback of newCallbacks ) {
555
+ pendingCallbacks . push ( callback ) ;
556
+ }
553
557
}
554
558
return pendingCallbacks ;
555
559
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { DbConnectionImpl } from './db_connection_impl';
4
4
export interface TableRuntimeTypeInfo {
5
5
tableName : string ;
6
6
rowType : AlgebraicType ;
7
- primaryKeyInfo ?: PrimaryKeyInfo | undefined ;
7
+ primaryKeyInfo ?: PrimaryKeyInfo ;
8
8
}
9
9
10
10
export interface PrimaryKeyInfo {
You can’t perform that action at this time.
0 commit comments