weave-typescript 0.17.0 → 0.18.0
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.
|
@@ -166,4 +166,12 @@ export interface CountEventsByTypeRow {
|
|
|
166
166
|
total: string;
|
|
167
167
|
}
|
|
168
168
|
export declare function countEventsByType(client: Client, args: CountEventsByTypeArgs): Promise<CountEventsByTypeRow | null>;
|
|
169
|
+
export declare const listRunIDsQuery = "-- name: ListRunIDs :many\nSELECT DISTINCT run_id\nFROM atc.events\nWHERE tenant_id = $1\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY run_id";
|
|
170
|
+
export interface ListRunIDsArgs {
|
|
171
|
+
tenantId: string;
|
|
172
|
+
}
|
|
173
|
+
export interface ListRunIDsRow {
|
|
174
|
+
runId: string;
|
|
175
|
+
}
|
|
176
|
+
export declare function listRunIDs(client: Client, args: ListRunIDsArgs): Promise<ListRunIDsRow[]>;
|
|
169
177
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countEventsByTypeQuery = exports.queryEventsByRunAndTypesQuery = exports.queryEventsByTimeRangeQuery = exports.queryEventsByTypeQuery = exports.lockRunQuery = exports.listEventsByTypeQuery = exports.loadAllEventsQuery = exports.loadEventsQuery = exports.getCurrentVersionQuery = exports.insertEventQuery = void 0;
|
|
3
|
+
exports.listRunIDsQuery = exports.countEventsByTypeQuery = exports.queryEventsByRunAndTypesQuery = exports.queryEventsByTimeRangeQuery = exports.queryEventsByTypeQuery = exports.lockRunQuery = exports.listEventsByTypeQuery = exports.loadAllEventsQuery = exports.loadEventsQuery = exports.getCurrentVersionQuery = exports.insertEventQuery = void 0;
|
|
4
4
|
exports.insertEvent = insertEvent;
|
|
5
5
|
exports.getCurrentVersion = getCurrentVersion;
|
|
6
6
|
exports.loadEvents = loadEvents;
|
|
@@ -11,6 +11,7 @@ exports.queryEventsByType = queryEventsByType;
|
|
|
11
11
|
exports.queryEventsByTimeRange = queryEventsByTimeRange;
|
|
12
12
|
exports.queryEventsByRunAndTypes = queryEventsByRunAndTypes;
|
|
13
13
|
exports.countEventsByType = countEventsByType;
|
|
14
|
+
exports.listRunIDs = listRunIDs;
|
|
14
15
|
exports.insertEventQuery = `-- name: InsertEvent :one
|
|
15
16
|
INSERT INTO atc.events (
|
|
16
17
|
id,
|
|
@@ -331,3 +332,21 @@ async function countEventsByType(client, args) {
|
|
|
331
332
|
total: row[0]
|
|
332
333
|
};
|
|
333
334
|
}
|
|
335
|
+
exports.listRunIDsQuery = `-- name: ListRunIDs :many
|
|
336
|
+
SELECT DISTINCT run_id
|
|
337
|
+
FROM atc.events
|
|
338
|
+
WHERE tenant_id = $1
|
|
339
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
340
|
+
ORDER BY run_id`;
|
|
341
|
+
async function listRunIDs(client, args) {
|
|
342
|
+
const result = await client.query({
|
|
343
|
+
text: exports.listRunIDsQuery,
|
|
344
|
+
values: [args.tenantId],
|
|
345
|
+
rowMode: "array"
|
|
346
|
+
});
|
|
347
|
+
return result.rows.map(row => {
|
|
348
|
+
return {
|
|
349
|
+
runId: row[0]
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
}
|