File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
packages/common/src/client Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @powersync/common ' : minor
3+ ---
4+
5+ Exposed the connection and connection option used by ` connect() `
Original file line number Diff line number Diff line change @@ -193,6 +193,24 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
193193 return this . connectionManager . syncStreamImplementation ;
194194 }
195195
196+ /**
197+ * The connector used to connect to the PowerSync service.
198+ *
199+ * @returns The connector used to connect to the PowerSync service or null if `connect()` has not been called.
200+ */
201+ get connector ( ) {
202+ return this . connectionManager . connector ;
203+ }
204+
205+ /**
206+ * The resolved connection options used to connect to the PowerSync service.
207+ *
208+ * @returns The resolved connection options used to connect to the PowerSync service or null if `connect()` has not been called.
209+ */
210+ get connectionOptions ( ) {
211+ return this . connectionManager . connectionOptions ;
212+ }
213+
196214 protected _schema : Schema ;
197215
198216 private _database : DBAdapter ;
Original file line number Diff line number Diff line change @@ -118,6 +118,14 @@ export class ConnectionManager extends BaseObserver<ConnectionManagerListener> {
118118 this . syncDisposer = null ;
119119 }
120120
121+ get connector ( ) {
122+ return this . pendingConnectionOptions ?. connector ?? null ;
123+ }
124+
125+ get connectionOptions ( ) {
126+ return this . pendingConnectionOptions ?. options ?? null ;
127+ }
128+
121129 get logger ( ) {
122130 return this . options . logger ;
123131 }
You can’t perform that action at this time.
0 commit comments