@sixb/pg 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/pg",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "PostgreSQL storage provider for Sixb",
5
5
  "keywords": [
6
6
  "sixb",
@@ -40,10 +40,10 @@
40
40
  "postgres": "^3.4.5"
41
41
  },
42
42
  "peerDependencies": {
43
- "@sixb/core": "0.1.10"
43
+ "@sixb/core": "0.1.11"
44
44
  },
45
45
  "devDependencies": {
46
- "@sixb/core": "0.1.10",
46
+ "@sixb/core": "0.1.11",
47
47
  "@types/bun": "latest",
48
48
  "typescript": "^5.7.0"
49
49
  },
@@ -180,6 +180,16 @@ class PgConnectorConnectionPersistence implements ConnectorConnectionPersistence
180
180
  }
181
181
  }
182
182
 
183
+ async listPendingConnectionRuns(): Promise<readonly ConnectorConnectionRunRecord[]> {
184
+ if (!this.scope.connectorId) return []
185
+ const rows = await this.sql<PgConnectionRunRow[]>`
186
+ SELECT * FROM connector_connection_runs
187
+ WHERE project_id = ${this.scope.projectId} AND connector_id = ${this.scope.connectorId}
188
+ AND (status = 'running' OR (status = 'waiting' AND waiting_for = 'account_selection'))
189
+ `
190
+ return rows.map(connectionRunFromRow)
191
+ }
192
+
183
193
  async getConnectionRun(id: string): Promise<ConnectorConnectionRunRecord | null> {
184
194
  const rows = await this.runById(id)
185
195
  return rows[0] ? connectionRunFromRow(rows[0]) : null