File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
packages/common/src/client Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
181181 * Current connection status.
182182 */
183183 currentStatus : SyncStatus ;
184+ connectionOptions : PowerSyncConnectionOptions ;
184185
185186 sdkVersion : string ;
186187
@@ -514,6 +515,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
514515 */
515516 async connect ( connector : PowerSyncBackendConnector , options ?: PowerSyncConnectionOptions ) {
516517 const resolvedOptions : InternalConnectionOptions = options ?? { } ;
518+ this . connectionOptions = resolvedOptions ;
517519 resolvedOptions . serializedSchema = this . schema . toJSON ( ) ;
518520
519521 return this . connectionManager . connect ( connector , resolvedOptions ) ;
@@ -592,6 +594,15 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
592594 await this . iterateAsyncListeners ( async ( cb ) => cb . closed ?.( ) ) ;
593595 }
594596
597+ /**
598+ * Get the connection options used to connect to the PowerSync backend instance.
599+ *
600+ * @returns The connection options used to connect to the PowerSync backend instance.
601+ */
602+ getConnectionOptions ( ) : PowerSyncConnectionOptions | null {
603+ return this . connectionOptions ?? null ;
604+ }
605+
595606 /**
596607 * Get upload queue size estimate and count.
597608 */
You can’t perform that action at this time.
0 commit comments