@@ -417,6 +417,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
417417 // Use the options passed in during connect, or fallback to the options set during database creation or fallback to the default options
418418 resolvedConnectionOptions ( options ?: PowerSyncConnectionOptions ) : RequiredAdditionalConnectionOptions {
419419 return {
420+ ...options ,
420421 retryDelayMs :
421422 options ?. retryDelayMs ?? this . options . retryDelayMs ?? this . options . retryDelay ?? DEFAULT_RETRY_DELAY_MS ,
422423 crudUploadThrottleMs :
@@ -436,12 +437,9 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
436437 throw new Error ( 'Cannot connect using a closed client' ) ;
437438 }
438439
439- const { retryDelayMs , crudUploadThrottleMs } = this . resolvedConnectionOptions ( options ) ;
440+ const resolvedConnectOptions = this . resolvedConnectionOptions ( options ) ;
440441
441- this . syncStreamImplementation = this . generateSyncStreamImplementation ( connector , {
442- retryDelayMs,
443- crudUploadThrottleMs
444- } ) ;
442+ this . syncStreamImplementation = this . generateSyncStreamImplementation ( connector , resolvedConnectOptions ) ;
445443 this . syncStatusListenerDisposer = this . syncStreamImplementation . registerListener ( {
446444 statusChanged : ( status ) => {
447445 this . currentStatus = new SyncStatus ( {
@@ -555,7 +553,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
555553 * This method does include transaction ids in the result, but does not group
556554 * data by transaction. One batch may contain data from multiple transactions,
557555 * and a single transaction may be split over multiple batches.
558- *
556+ *
559557 * @param limit Maximum number of CRUD entries to include in the batch
560558 * @returns A batch of CRUD operations to upload, or null if there are none
561559 */
@@ -594,7 +592,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
594592 *
595593 * Unlike {@link getCrudBatch}, this only returns data from a single transaction at a time.
596594 * All data for the transaction is loaded into memory.
597- *
595+ *
598596 * @returns A transaction of CRUD operations to upload, or null if there are none
599597 */
600598 async getNextCrudTransaction ( ) : Promise < CrudTransaction | null > {
@@ -633,7 +631,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
633631 * Get an unique client id for this database.
634632 *
635633 * The id is not reset when the database is cleared, only when the database is deleted.
636- *
634+ *
637635 * @returns A unique identifier for the database instance
638636 */
639637 async getClientId ( ) : Promise < string > {
@@ -661,7 +659,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
661659 /**
662660 * Execute a SQL write (INSERT/UPDATE/DELETE) query
663661 * and optionally return results.
664- *
662+ *
665663 * @param sql The SQL query to execute
666664 * @param parameters Optional array of parameters to bind to the query
667665 * @returns The query result as an object with structured key-value pairs
@@ -674,7 +672,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
674672 /**
675673 * Execute a SQL write (INSERT/UPDATE/DELETE) query directly on the database without any PowerSync processing.
676674 * This bypasses certain PowerSync abstractions and is useful for accessing the raw database results.
677- *
675+ *
678676 * @param sql The SQL query to execute
679677 * @param parameters Optional array of parameters to bind to the query
680678 * @returns The raw query result from the underlying database as a nested array of raw values, where each row is
@@ -689,7 +687,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
689687 * Execute a write query (INSERT/UPDATE/DELETE) multiple times with each parameter set
690688 * and optionally return results.
691689 * This is faster than executing separately with each parameter set.
692- *
690+ *
693691 * @param sql The SQL query to execute
694692 * @param parameters Optional 2D array of parameter sets, where each inner array is a set of parameters for one execution
695693 * @returns The query result
@@ -701,7 +699,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
701699
702700 /**
703701 * Execute a read-only query and return results.
704- *
702+ *
705703 * @param sql The SQL query to execute
706704 * @param parameters Optional array of parameters to bind to the query
707705 * @returns An array of results
@@ -713,7 +711,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
713711
714712 /**
715713 * Execute a read-only query and return the first result, or null if the ResultSet is empty.
716- *
714+ *
717715 * @param sql The SQL query to execute
718716 * @param parameters Optional array of parameters to bind to the query
719717 * @returns The first result if found, or null if no results are returned
@@ -725,7 +723,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
725723
726724 /**
727725 * Execute a read-only query and return the first result, error if the ResultSet is empty.
728- *
726+ *
729727 * @param sql The SQL query to execute
730728 * @param parameters Optional array of parameters to bind to the query
731729 * @returns The first result matching the query
@@ -761,7 +759,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
761759 * Open a read-only transaction.
762760 * Read transactions can run concurrently to a write transaction.
763761 * Changes from any write transaction are not visible to read transactions started before it.
764- *
762+ *
765763 * @param callback Function to execute within the transaction
766764 * @param lockTimeout Time in milliseconds to wait for a lock before throwing an error
767765 * @returns The result of the callback
@@ -786,7 +784,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
786784 * Open a read-write transaction.
787785 * This takes a global lock - only one write transaction can execute against the database at a time.
788786 * Statements within the transaction must be done on the provided {@link Transaction} interface.
789- *
787+ *
790788 * @param callback Function to execute within the transaction
791789 * @param lockTimeout Time in milliseconds to wait for a lock before throwing an error
792790 * @returns The result of the callback
@@ -865,7 +863,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
865863 * Source tables are automatically detected using `EXPLAIN QUERY PLAN`.
866864 *
867865 * Note that the `onChange` callback member of the handler is required.
868- *
866+ *
869867 * @param sql The SQL query to execute
870868 * @param parameters Optional array of parameters to bind to the query
871869 * @param handler Callbacks for handling results and errors
@@ -915,7 +913,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
915913 * Execute a read query every time the source tables are modified.
916914 * Use {@link SQLWatchOptions.throttleMs} to specify the minimum interval between queries.
917915 * Source tables are automatically detected using `EXPLAIN QUERY PLAN`.
918- *
916+ *
919917 * @param sql The SQL query to execute
920918 * @param parameters Optional array of parameters to bind to the query
921919 * @param options Options for configuring watch behavior
@@ -944,7 +942,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
944942 * Resolves the list of tables that are used in a SQL query.
945943 * If tables are specified in the options, those are used directly.
946944 * Otherwise, analyzes the query using EXPLAIN to determine which tables are accessed.
947- *
945+ *
948946 * @param sql The SQL query to analyze
949947 * @param parameters Optional parameters for the SQL query
950948 * @param options Optional watch options that may contain explicit table list
@@ -1077,7 +1075,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
10771075 *
10781076 * This is preferred over {@link watchWithAsyncGenerator} when multiple queries need to be performed
10791077 * together when data is changed.
1080- *
1078+ *
10811079 * Note: do not declare this as `async *onChange` as it will not work in React Native.
10821080 *
10831081 * @param options Options for configuring watch behavior
0 commit comments