@dbos-inc/dbos-sdk 0.7.21-preview → 0.7.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -1
  2. package/dist/src/cloud-cli/applications/deploy-app-code.js +1 -0
  3. package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -1
  4. package/dist/src/cloud-cli/cli.js +19 -7
  5. package/dist/src/cloud-cli/cli.js.map +1 -1
  6. package/dist/src/cloud-cli/userdb.d.ts +2 -0
  7. package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
  8. package/dist/src/cloud-cli/userdb.js +78 -5
  9. package/dist/src/cloud-cli/userdb.js.map +1 -1
  10. package/dist/src/communicator.d.ts +2 -1
  11. package/dist/src/communicator.d.ts.map +1 -1
  12. package/dist/src/communicator.js.map +1 -1
  13. package/dist/src/context.d.ts +3 -2
  14. package/dist/src/context.d.ts.map +1 -1
  15. package/dist/src/context.js +7 -7
  16. package/dist/src/context.js.map +1 -1
  17. package/dist/src/dbos-executor.d.ts +7 -1
  18. package/dist/src/dbos-executor.d.ts.map +1 -1
  19. package/dist/src/dbos-executor.js +110 -35
  20. package/dist/src/dbos-executor.js.map +1 -1
  21. package/dist/src/dbos-runtime/cli.d.ts +1 -0
  22. package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
  23. package/dist/src/dbos-runtime/cli.js +1 -0
  24. package/dist/src/dbos-runtime/cli.js.map +1 -1
  25. package/dist/src/dbos-runtime/config.d.ts +3 -0
  26. package/dist/src/dbos-runtime/config.d.ts.map +1 -1
  27. package/dist/src/dbos-runtime/config.js +1 -0
  28. package/dist/src/dbos-runtime/config.js.map +1 -1
  29. package/dist/src/dbos-runtime/runtime.d.ts +1 -1
  30. package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
  31. package/dist/src/dbos-runtime/runtime.js +9 -9
  32. package/dist/src/dbos-runtime/runtime.js.map +1 -1
  33. package/dist/src/debugger/debug_workflow.d.ts +38 -0
  34. package/dist/src/debugger/debug_workflow.d.ts.map +1 -0
  35. package/dist/src/debugger/debug_workflow.js +192 -0
  36. package/dist/src/debugger/debug_workflow.js.map +1 -0
  37. package/dist/src/error.d.ts +3 -0
  38. package/dist/src/error.d.ts.map +1 -1
  39. package/dist/src/error.js +8 -1
  40. package/dist/src/error.js.map +1 -1
  41. package/dist/src/httpServer/handler.d.ts +2 -1
  42. package/dist/src/httpServer/handler.d.ts.map +1 -1
  43. package/dist/src/httpServer/handler.js +27 -15
  44. package/dist/src/httpServer/handler.js.map +1 -1
  45. package/dist/src/httpServer/server.d.ts +3 -3
  46. package/dist/src/httpServer/server.d.ts.map +1 -1
  47. package/dist/src/httpServer/server.js +19 -17
  48. package/dist/src/httpServer/server.js.map +1 -1
  49. package/dist/src/system_database.d.ts +2 -0
  50. package/dist/src/system_database.d.ts.map +1 -1
  51. package/dist/src/system_database.js +9 -2
  52. package/dist/src/system_database.js.map +1 -1
  53. package/dist/src/telemetry/collector.d.ts +2 -2
  54. package/dist/src/telemetry/collector.d.ts.map +1 -1
  55. package/dist/src/telemetry/collector.js.map +1 -1
  56. package/dist/src/telemetry/exporters.d.ts +5 -6
  57. package/dist/src/telemetry/exporters.d.ts.map +1 -1
  58. package/dist/src/telemetry/exporters.js +2 -42
  59. package/dist/src/telemetry/exporters.js.map +1 -1
  60. package/dist/src/telemetry/signals.d.ts +0 -10
  61. package/dist/src/telemetry/signals.d.ts.map +1 -1
  62. package/dist/src/telemetry/signals.js.map +1 -1
  63. package/dist/src/testing/testing_runtime.d.ts.map +1 -1
  64. package/dist/src/testing/testing_runtime.js +7 -1
  65. package/dist/src/testing/testing_runtime.js.map +1 -1
  66. package/dist/src/transaction.d.ts +2 -1
  67. package/dist/src/transaction.d.ts.map +1 -1
  68. package/dist/src/transaction.js.map +1 -1
  69. package/dist/src/workflow.d.ts +15 -2
  70. package/dist/src/workflow.d.ts.map +1 -1
  71. package/dist/src/workflow.js +92 -56
  72. package/dist/src/workflow.js.map +1 -1
  73. package/examples/hello/README.md +1 -1
  74. package/examples/hello/dbos-config.yaml +3 -0
  75. package/package.json +2 -2
  76. package/dist/src/provenance/provenance_daemon.d.ts +0 -34
  77. package/dist/src/provenance/provenance_daemon.d.ts.map +0 -1
  78. package/dist/src/provenance/provenance_daemon.js +0 -86
  79. package/dist/src/provenance/provenance_daemon.js.map +0 -1
@@ -18,39 +18,48 @@ exports.StatusString = {
18
18
  };
19
19
  class WorkflowContextImpl extends context_1.DBOSContextImpl {
20
20
  workflowConfig;
21
+ presetUUID;
21
22
  functionID = 0;
22
- #wfe;
23
+ #dbosExec;
23
24
  resultBuffer = new Map();
24
25
  isTempWorkflow;
25
- constructor(wfe, parentCtx, workflowUUID, workflowConfig, workflowName) {
26
- const span = wfe.tracer.startSpan(workflowName, {
26
+ constructor(dbosExec, parentCtx, workflowUUID, workflowConfig, workflowName, presetUUID) {
27
+ const span = dbosExec.tracer.startSpan(workflowName, {
27
28
  workflowUUID: workflowUUID,
28
29
  operationName: workflowName,
29
30
  runAs: parentCtx?.authenticatedUser ?? "",
30
31
  }, parentCtx?.span);
31
- super(workflowName, span, wfe.logger, parentCtx);
32
+ super(workflowName, span, dbosExec.logger, parentCtx);
32
33
  this.workflowConfig = workflowConfig;
34
+ this.presetUUID = presetUUID;
33
35
  this.workflowUUID = workflowUUID;
34
- this.#wfe = wfe;
35
- this.isTempWorkflow = wfe.tempWorkflowName === workflowName;
36
- if (wfe.config.application) {
36
+ this.#dbosExec = dbosExec;
37
+ this.isTempWorkflow = dbosExec.tempWorkflowName === workflowName;
38
+ if (dbosExec.config.application) {
37
39
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
38
- this.applicationConfig = wfe.config.application;
40
+ this.applicationConfig = dbosExec.config.application;
39
41
  }
40
42
  }
41
43
  functionIDGetIncrement() {
42
44
  return this.functionID++;
43
45
  }
46
+ /**
47
+ * Retrieve the transaction snapshot information of the current transaction
48
+ */
49
+ async retrieveSnapshot(client) {
50
+ const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "SELECT pg_current_snapshot()::text as txn_snapshot;");
51
+ return rows[0].txn_snapshot;
52
+ }
44
53
  /**
45
54
  * Check if an operation has already executed in a workflow.
46
- * If it previously executed succesfully, return its output.
55
+ * If it previously executed successfully, return its output.
47
56
  * If it previously executed and threw an error, throw that error.
48
57
  * Otherwise, return DBOSNull.
49
58
  * Also return the transaction snapshot information of this current transaction.
50
59
  */
51
60
  async checkExecution(client, funcID) {
52
61
  // Note: we read the current snapshot, not the recorded one!
53
- const rows = await this.#wfe.userDatabase.queryWithClient(client, "(SELECT output, error, pg_current_snapshot()::text as txn_snapshot, true as recorded FROM dbos.transaction_outputs WHERE workflow_uuid=$1 AND function_id=$2 UNION ALL SELECT null as output, null as error, pg_current_snapshot()::text as txn_snapshot, false as recorded) ORDER BY recorded", this.workflowUUID, funcID);
62
+ const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "(SELECT output, error, txn_snapshot, true as recorded FROM dbos.transaction_outputs WHERE workflow_uuid=$1 AND function_id=$2 UNION ALL SELECT null as output, null as error, pg_current_snapshot()::text as txn_snapshot, false as recorded) ORDER BY recorded", this.workflowUUID, funcID);
54
63
  if (rows.length === 0 || rows.length > 2) {
55
64
  this.logger.error("Unexpected! This should never happen. Returned rows: " + rows.toString());
56
65
  throw new error_1.DBOSError("This should never happen. Returned rows: " + rows.toString());
@@ -61,7 +70,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
61
70
  };
62
71
  // recorded=false row will be first because we used ORDER BY.
63
72
  res.txn_snapshot = rows[0].txn_snapshot;
64
- if (rows.length == 2) {
73
+ if (rows.length === 2) {
65
74
  if (JSON.parse(rows[1].error) !== null) {
66
75
  throw (0, serialize_error_1.deserializeError)(JSON.parse(rows[1].error));
67
76
  }
@@ -99,10 +108,10 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
99
108
  }
100
109
  this.logger.debug(sqlStmt);
101
110
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
102
- await this.#wfe.userDatabase.queryWithClient(client, sqlStmt, ...values);
111
+ await this.#dbosExec.userDatabase.queryWithClient(client, sqlStmt, ...values);
103
112
  }
104
113
  catch (error) {
105
- if (this.#wfe.userDatabase.isKeyConflictError(error)) {
114
+ if (this.#dbosExec.userDatabase.isKeyConflictError(error)) {
106
115
  // Serialization and primary key conflict (Postgres).
107
116
  throw new error_1.DBOSWorkflowConflictUUIDError(this.workflowUUID);
108
117
  }
@@ -126,15 +135,31 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
126
135
  */
127
136
  async recordGuardedOutput(client, funcID, output) {
128
137
  const serialOutput = JSON.stringify(output);
129
- const rows = await this.#wfe.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET output=$1, txn_id=(select pg_current_xact_id_if_assigned()::text) WHERE workflow_uuid=$2 AND function_id=$3 RETURNING txn_id;", serialOutput, this.workflowUUID, funcID);
138
+ const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET output=$1, txn_id=(select pg_current_xact_id_if_assigned()::text) WHERE workflow_uuid=$2 AND function_id=$3 RETURNING txn_id;", serialOutput, this.workflowUUID, funcID);
130
139
  return rows[0].txn_id; // Must have a transaction ID because we inserted the guard before.
131
140
  }
141
+ /**
142
+ * Write an unguarded operation's output to the database.
143
+ */
144
+ async recordUnguardedOutput(client, funcID, output) {
145
+ const serialOutput = JSON.stringify(output);
146
+ const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "INSERT INTO dbos.transaction_outputs (workflow_uuid, function_id, output, txn_id, txn_snapshot) VALUES ($1, $2, $3, (select pg_current_xact_id_if_assigned()::text), (select pg_current_snapshot()::text)) RETURNING txn_id;", this.workflowUUID, funcID, serialOutput);
147
+ return rows[0].txn_id;
148
+ }
132
149
  /**
133
150
  * Record an error in a guarded operation to the database.
134
151
  */
135
152
  async recordGuardedError(client, funcID, err) {
136
153
  const serialErr = JSON.stringify((0, serialize_error_1.serializeError)(err));
137
- await this.#wfe.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET error=$1 WHERE workflow_uuid=$2 AND function_id=$3;", serialErr, this.workflowUUID, funcID);
154
+ await this.#dbosExec.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET error=$1 WHERE workflow_uuid=$2 AND function_id=$3;", serialErr, this.workflowUUID, funcID);
155
+ }
156
+ /**
157
+ * Record an error in an unguarded operation to the database.
158
+ */
159
+ async recordUnguardedError(client, funcID, err) {
160
+ const serialErr = JSON.stringify((0, serialize_error_1.serializeError)(err));
161
+ const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "INSERT INTO dbos.transaction_outputs (workflow_uuid, function_id, error, txn_id, txn_snapshot) VALUES ($1, $2, $3, (select pg_current_xact_id_if_assigned()::text), (select pg_current_snapshot()::text)) RETURNING txn_id;", this.workflowUUID, funcID, serialErr);
162
+ return rows[0].txn_id;
138
163
  }
139
164
  /**
140
165
  * Invoke another workflow as its child workflow and return a workflow handle.
@@ -146,7 +171,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
146
171
  // Note: cannot use invoke for childWorkflow because of potential recursive types on the workflow itself.
147
172
  const funcId = this.functionIDGetIncrement();
148
173
  const childUUID = this.workflowUUID + "-" + funcId;
149
- return this.#wfe.internalWorkflow(wf, { parentCtx: this, workflowUUID: childUUID }, this.workflowUUID, funcId, ...args);
174
+ return this.#dbosExec.internalWorkflow(wf, { parentCtx: this, workflowUUID: childUUID }, this.workflowUUID, funcId, ...args);
150
175
  }
151
176
  /**
152
177
  * Execute a transactional function.
@@ -155,7 +180,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
155
180
  * If it encounters any other error, throw it.
156
181
  */
157
182
  async transaction(txn, ...args) {
158
- const config = this.#wfe.transactionConfigMap.get(txn.name);
183
+ const config = this.#dbosExec.transactionConfigMap.get(txn.name);
159
184
  if (config === undefined) {
160
185
  throw new error_1.DBOSNotRegisteredError(txn.name);
161
186
  }
@@ -163,7 +188,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
163
188
  let retryWaitMillis = 1;
164
189
  const backoffFactor = 2;
165
190
  const funcId = this.functionIDGetIncrement();
166
- const span = this.#wfe.tracer.startSpan(txn.name, {
191
+ const span = this.#dbosExec.tracer.startSpan(txn.name, {
167
192
  workflowUUID: this.workflowUUID,
168
193
  operationName: txn.name,
169
194
  runAs: this.authenticatedUser,
@@ -173,18 +198,29 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
173
198
  // eslint-disable-next-line no-constant-condition
174
199
  while (true) {
175
200
  const wrappedTransaction = async (client) => {
176
- // Check if this execution previously happened, returning its original result if it did.
177
- const tCtxt = new transaction_1.TransactionContextImpl(this.#wfe.userDatabase.getName(), client, this, span, this.#wfe.logger, funcId, txn.name);
178
- const check = await this.checkExecution(client, funcId);
179
- if (check.output !== dbos_executor_1.dbosNull) {
180
- tCtxt.span.setAttribute("cached", true);
181
- tCtxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
182
- this.#wfe.tracer.endSpan(tCtxt.span);
183
- return check.output;
201
+ const tCtxt = new transaction_1.TransactionContextImpl(this.#dbosExec.userDatabase.getName(), client, this, span, this.#dbosExec.logger, funcId, txn.name);
202
+ // If the UUID is preset, it is possible this execution previously happened. Check, and return its original result if it did.
203
+ // Note: It is possible to retrieve a generated ID from a workflow handle, run a concurrent execution, and cause trouble for yourself. We recommend against this.
204
+ let txn_snapshot;
205
+ if (this.presetUUID) {
206
+ const check = await this.checkExecution(client, funcId);
207
+ txn_snapshot = check.txn_snapshot;
208
+ if (check.output !== dbos_executor_1.dbosNull) {
209
+ tCtxt.span.setAttribute("cached", true);
210
+ tCtxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
211
+ this.#dbosExec.tracer.endSpan(tCtxt.span);
212
+ return check.output;
213
+ }
214
+ }
215
+ else if (readOnly) {
216
+ // Collect snapshot information for read-only transactions, if not already collected above
217
+ txn_snapshot = await this.retrieveSnapshot(client);
218
+ }
219
+ // If the UUID is preset, set a guard to block concurrent executions with the same UUID.
220
+ if (this.presetUUID) {
221
+ this.guardOperation(funcId, txn_snapshot);
184
222
  }
185
- // TODO: record snapshot information in result buffer.
186
- // Flush the result buffer, setting a guard to block concurrent executions with the same UUID.
187
- this.guardOperation(funcId, check.txn_snapshot);
223
+ // For non-read-only transactions, flush the result buffer, including the guard if present.
188
224
  if (!readOnly) {
189
225
  await this.flushResultBuffer(client);
190
226
  }
@@ -195,25 +231,25 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
195
231
  // Buffer the output of read-only transactions instead of synchronously writing it.
196
232
  const guardOutput = {
197
233
  output: result,
198
- txn_snapshot: check.txn_snapshot,
234
+ txn_snapshot: txn_snapshot,
199
235
  };
200
236
  this.resultBuffer.set(funcId, guardOutput);
201
237
  }
202
238
  else {
203
239
  // Synchronously record the output of write transactions and obtain the transaction ID.
204
- const pg_txn_id = await this.recordGuardedOutput(client, funcId, result);
240
+ const pg_txn_id = this.presetUUID ? await this.recordGuardedOutput(client, funcId, result) : await this.recordUnguardedOutput(client, funcId, result);
205
241
  tCtxt.span.setAttribute("transaction_id", pg_txn_id);
206
242
  this.resultBuffer.clear();
207
243
  }
208
244
  return result;
209
245
  };
210
246
  try {
211
- const result = await this.#wfe.userDatabase.transaction(wrappedTransaction, config);
247
+ const result = await this.#dbosExec.userDatabase.transaction(wrappedTransaction, config);
212
248
  span.setStatus({ code: api_1.SpanStatusCode.OK });
213
249
  return result;
214
250
  }
215
251
  catch (err) {
216
- if (this.#wfe.userDatabase.isRetriableTransactionError(err)) {
252
+ if (this.#dbosExec.userDatabase.isRetriableTransactionError(err)) {
217
253
  // serialization_failure in PostgreSQL
218
254
  span.addEvent("TXN SERIALIZATION FAILURE", { retryWaitMillis });
219
255
  // Retry serialization failures.
@@ -223,16 +259,16 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
223
259
  }
224
260
  // Record and throw other errors.
225
261
  const e = err;
226
- await this.#wfe.userDatabase.transaction(async (client) => {
262
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
227
263
  await this.flushResultBuffer(client);
228
- await this.recordGuardedError(client, funcId, e);
264
+ this.presetUUID ? await this.recordGuardedError(client, funcId, e) : await this.recordUnguardedError(client, funcId, e);
229
265
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
230
266
  this.resultBuffer.clear();
231
267
  span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: e.message });
232
268
  throw err;
233
269
  }
234
270
  finally {
235
- this.#wfe.tracer.endSpan(span);
271
+ this.#dbosExec.tracer.endSpan(span);
236
272
  }
237
273
  }
238
274
  }
@@ -242,12 +278,12 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
242
278
  * The communicator may execute many times, but once it is complete, it will not re-execute.
243
279
  */
244
280
  async external(commFn, ...args) {
245
- const commConfig = this.#wfe.communicatorConfigMap.get(commFn.name);
281
+ const commConfig = this.#dbosExec.communicatorConfigMap.get(commFn.name);
246
282
  if (commConfig === undefined) {
247
283
  throw new error_1.DBOSNotRegisteredError(commFn.name);
248
284
  }
249
285
  const funcID = this.functionIDGetIncrement();
250
- const span = this.#wfe.tracer.startSpan(commFn.name, {
286
+ const span = this.#dbosExec.tracer.startSpan(commFn.name, {
251
287
  workflowUUID: this.workflowUUID,
252
288
  operationName: commFn.name,
253
289
  runAs: this.authenticatedUser,
@@ -256,17 +292,17 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
256
292
  maxAttempts: commConfig.maxAttempts,
257
293
  backoffRate: commConfig.backoffRate,
258
294
  }, this.span);
259
- const ctxt = new communicator_1.CommunicatorContextImpl(this, funcID, span, this.#wfe.logger, commConfig, commFn.name);
260
- await this.#wfe.userDatabase.transaction(async (client) => {
295
+ const ctxt = new communicator_1.CommunicatorContextImpl(this, funcID, span, this.#dbosExec.logger, commConfig, commFn.name);
296
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
261
297
  await this.flushResultBuffer(client);
262
298
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
263
299
  this.resultBuffer.clear();
264
300
  // Check if this execution previously happened, returning its original result if it did.
265
- const check = await this.#wfe.systemDatabase.checkOperationOutput(this.workflowUUID, ctxt.functionID);
301
+ const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, ctxt.functionID);
266
302
  if (check !== dbos_executor_1.dbosNull) {
267
303
  ctxt.span.setAttribute("cached", true);
268
304
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
269
- this.#wfe.tracer.endSpan(ctxt.span);
305
+ this.#dbosExec.tracer.endSpan(ctxt.span);
270
306
  return check;
271
307
  }
272
308
  // Execute the communicator function. If it throws an exception, retry with exponential backoff.
@@ -287,7 +323,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
287
323
  intervalSeconds *= ctxt.backoffRate;
288
324
  }
289
325
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
290
- this.#wfe.tracer.endSpan(ctxt.span);
326
+ this.#dbosExec.tracer.endSpan(ctxt.span);
291
327
  }
292
328
  }
293
329
  }
@@ -298,23 +334,23 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
298
334
  catch (error) {
299
335
  err = error;
300
336
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
301
- this.#wfe.tracer.endSpan(ctxt.span);
337
+ this.#dbosExec.tracer.endSpan(ctxt.span);
302
338
  }
303
339
  }
304
340
  // `result` can only be dbosNull when the communicator timed out
305
341
  if (result === dbos_executor_1.dbosNull) {
306
342
  // Record the error, then throw it.
307
343
  err = err === dbos_executor_1.dbosNull ? new error_1.DBOSError("Communicator reached maximum retries.", 1) : err;
308
- await this.#wfe.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
344
+ await this.#dbosExec.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
309
345
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: err.message });
310
- this.#wfe.tracer.endSpan(ctxt.span);
346
+ this.#dbosExec.tracer.endSpan(ctxt.span);
311
347
  throw err;
312
348
  }
313
349
  else {
314
350
  // Record the execution and return.
315
- await this.#wfe.systemDatabase.recordOperationOutput(this.workflowUUID, ctxt.functionID, result);
351
+ await this.#dbosExec.systemDatabase.recordOperationOutput(this.workflowUUID, ctxt.functionID, result);
316
352
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
317
- this.#wfe.tracer.endSpan(ctxt.span);
353
+ this.#dbosExec.tracer.endSpan(ctxt.span);
318
354
  return result;
319
355
  }
320
356
  }
@@ -324,11 +360,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
324
360
  */
325
361
  async send(destinationUUID, message, topic) {
326
362
  const functionID = this.functionIDGetIncrement();
327
- await this.#wfe.userDatabase.transaction(async (client) => {
363
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
328
364
  await this.flushResultBuffer(client);
329
365
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
330
366
  this.resultBuffer.clear();
331
- await this.#wfe.systemDatabase.send(this.workflowUUID, functionID, destinationUUID, message, topic);
367
+ await this.#dbosExec.systemDatabase.send(this.workflowUUID, functionID, destinationUUID, message, topic);
332
368
  }
333
369
  /**
334
370
  * Consume and return the oldest unconsumed message sent to your UUID.
@@ -337,11 +373,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
337
373
  */
338
374
  async recv(topic, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
339
375
  const functionID = this.functionIDGetIncrement();
340
- await this.#wfe.userDatabase.transaction(async (client) => {
376
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
341
377
  await this.flushResultBuffer(client);
342
378
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
343
379
  this.resultBuffer.clear();
344
- return this.#wfe.systemDatabase.recv(this.workflowUUID, functionID, topic, timeoutSeconds);
380
+ return this.#dbosExec.systemDatabase.recv(this.workflowUUID, functionID, topic, timeoutSeconds);
345
381
  }
346
382
  /**
347
383
  * Emit a workflow event, represented as a key-value pair.
@@ -349,11 +385,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
349
385
  */
350
386
  async setEvent(key, value) {
351
387
  const functionID = this.functionIDGetIncrement();
352
- await this.#wfe.userDatabase.transaction(async (client) => {
388
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
353
389
  await this.flushResultBuffer(client);
354
390
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
355
391
  this.resultBuffer.clear();
356
- await this.#wfe.systemDatabase.setEvent(this.workflowUUID, functionID, key, value);
392
+ await this.#dbosExec.systemDatabase.setEvent(this.workflowUUID, functionID, key, value);
357
393
  }
358
394
  /**
359
395
  * Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
@@ -379,14 +415,14 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
379
415
  */
380
416
  getEvent(targetUUID, key, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
381
417
  const functionID = this.functionIDGetIncrement();
382
- return this.#wfe.systemDatabase.getEvent(targetUUID, key, timeoutSeconds, this.workflowUUID, functionID);
418
+ return this.#dbosExec.systemDatabase.getEvent(targetUUID, key, timeoutSeconds, this.workflowUUID, functionID);
383
419
  }
384
420
  /**
385
421
  * Retrieve a handle for a workflow UUID.
386
422
  */
387
423
  retrieveWorkflow(targetUUID) {
388
424
  const functionID = this.functionIDGetIncrement();
389
- return new RetrievedHandle(this.#wfe.systemDatabase, targetUUID, this.workflowUUID, functionID);
425
+ return new RetrievedHandle(this.#dbosExec.systemDatabase, targetUUID, this.workflowUUID, functionID);
390
426
  }
391
427
  }
392
428
  exports.WorkflowContextImpl = WorkflowContextImpl;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/workflow.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,mDAAmE;AAEnE,+CAAwG;AACxG,iDAA4F;AAC5F,mCAA2F;AA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IAED,KAAK,CAAC,SAAS;QACb,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChH,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;CACF;AAdD,0CAcC"}
@@ -24,7 +24,7 @@ Next, build and run the app:
24
24
 
25
25
  ```bash
26
26
  npm run build
27
- npx dbos start
27
+ npx dbos-sdk start
28
28
  ```
29
29
 
30
30
  Finally, curl the server to see that it's working!
@@ -12,4 +12,7 @@ database:
12
12
  system_database: 'hello_systemdb'
13
13
  connectionTimeoutMillis: 3000
14
14
  user_dbclient: 'knex'
15
+ create_db: true
16
+ migrate: ['migrate:latest']
17
+ rollback: ['migrate:rollback']
15
18
  version: "1.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbos-inc/dbos-sdk",
3
- "version": "0.7.21-preview",
3
+ "version": "0.7.35",
4
4
  "description": "A Typescript framework built on the database",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "lint": "eslint --fix --ext .ts --ignore-pattern foundationdb/ .",
17
17
  "lint-fdb": "eslint --fix --ext .ts .",
18
18
  "setversion": "grunt setversion",
19
- "test": "npx prisma generate --schema tests/prisma/schema.prisma && npm run build && jest --coverage --collectCoverageFrom='src/**/*' --collectCoverageFrom='!src/foundationdb/**/*' --detectOpenHandles --testPathIgnorePatterns=examples/* --testPathIgnorePatterns=tests/foundationdb/* --testPathIgnorePatterns=tests/provenance/*",
19
+ "test": "npx prisma generate --schema tests/prisma/schema.prisma && npm run build && jest --coverage --collectCoverageFrom='src/**/*' --collectCoverageFrom='!src/foundationdb/**/*' --detectOpenHandles --testPathIgnorePatterns=examples/* --testPathIgnorePatterns=tests/foundationdb/*",
20
20
  "test-fdb": "npx prisma generate --schema tests/prisma/schema.prisma && npm run build-fdb && jest --runInBand --coverage"
21
21
  },
22
22
  "bin": {
@@ -1,34 +0,0 @@
1
- /// <reference types="node" />
2
- import { Client } from "pg";
3
- import { TelemetryCollector } from "../telemetry/collector";
4
- import { DBOSConfig } from "../dbos-executor";
5
- /**
6
- * A class implementing a daemon which collects and exports provenance information,
7
- * specifically a record of all INSERTs, UPDATEs, and DELETEs in the target database.
8
- * Only one daemon is needed per database. The daemon need not run in the same process as workflow runtime.
9
- * The daemon has three requirements and will fail to launch if any is not met:
10
- *
11
- * 1. The database must be configured with wal_level=logical.
12
- * 2. An open replication slot must be available.
13
- * 3. The wal2json Postgres plugin must be installed. It is installed by default on most cloud databases, including RDS.
14
- *
15
- * Because the daemon depends on Postgres logical replication, it can only export information on updates and deletes in tables
16
- * whose rows are uniquely identifiable, either because the table has a primary key or a replica identity.
17
- */
18
- export declare class ProvenanceDaemon {
19
- readonly slotName: string;
20
- readonly client: Client;
21
- readonly daemonID: NodeJS.Timeout;
22
- readonly recordProvenanceIntervalMs = 1000;
23
- readonly telemetryCollector: TelemetryCollector;
24
- initialized: boolean;
25
- /**
26
- * @param dbosConfig An DBOS config defining exporters and database connection information.
27
- * @param slotName The name of a logical replication slot. This slot is persistent and must be deleted if the daemon is no longer to be used.
28
- */
29
- constructor(dbosConfig: DBOSConfig, slotName: string);
30
- start(): Promise<void>;
31
- recordProvenance(): Promise<void>;
32
- stop(): Promise<void>;
33
- }
34
- //# sourceMappingURL=provenance_daemon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provenance_daemon.d.ts","sourceRoot":"","sources":["../../../src/provenance/provenance_daemon.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,IAAI,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAqB9C;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IAWS,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAV7D,QAAQ,CAAC,MAAM,SAAC;IAChB,QAAQ,CAAC,QAAQ,iBAAC;IAClB,QAAQ,CAAC,0BAA0B,QAAQ;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,WAAW,UAAS;IAEpB;;;OAGG;gBACS,UAAU,EAAE,UAAU,EAAW,QAAQ,EAAE,MAAM;IASvD,KAAK;IAkBL,gBAAgB;IAqBhB,IAAI;CAKX"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProvenanceDaemon = void 0;
4
- const pg_1 = require("pg");
5
- const exporters_1 = require("../telemetry/exporters");
6
- const collector_1 = require("../telemetry/collector");
7
- /**
8
- * A class implementing a daemon which collects and exports provenance information,
9
- * specifically a record of all INSERTs, UPDATEs, and DELETEs in the target database.
10
- * Only one daemon is needed per database. The daemon need not run in the same process as workflow runtime.
11
- * The daemon has three requirements and will fail to launch if any is not met:
12
- *
13
- * 1. The database must be configured with wal_level=logical.
14
- * 2. An open replication slot must be available.
15
- * 3. The wal2json Postgres plugin must be installed. It is installed by default on most cloud databases, including RDS.
16
- *
17
- * Because the daemon depends on Postgres logical replication, it can only export information on updates and deletes in tables
18
- * whose rows are uniquely identifiable, either because the table has a primary key or a replica identity.
19
- */
20
- class ProvenanceDaemon {
21
- slotName;
22
- client;
23
- daemonID;
24
- recordProvenanceIntervalMs = 1000;
25
- telemetryCollector;
26
- initialized = false;
27
- /**
28
- * @param dbosConfig An DBOS config defining exporters and database connection information.
29
- * @param slotName The name of a logical replication slot. This slot is persistent and must be deleted if the daemon is no longer to be used.
30
- */
31
- constructor(dbosConfig, slotName) {
32
- this.slotName = slotName;
33
- this.client = new pg_1.Client(dbosConfig.poolConfig);
34
- this.daemonID = setInterval(() => {
35
- void this.recordProvenance();
36
- }, this.recordProvenanceIntervalMs);
37
- const telemetryExporters = [new exporters_1.PostgresExporter(dbosConfig.poolConfig, dbosConfig?.observability_database)];
38
- this.telemetryCollector = new collector_1.TelemetryCollector(telemetryExporters);
39
- }
40
- async start() {
41
- await this.client.connect();
42
- // Create a logical replication slot with the given name.
43
- try { // TODO: Make this robust to daemon crashes, so records are not consumed until they've been exported.
44
- await this.client.query("SELECT pg_create_logical_replication_slot($1, 'wal2json');", [this.slotName]);
45
- }
46
- catch (error) {
47
- const err = error;
48
- if (err.code === "42710") {
49
- // The slot has already been created.
50
- }
51
- else {
52
- console.error(err);
53
- throw err;
54
- }
55
- }
56
- await this.telemetryCollector.init();
57
- this.initialized = true;
58
- }
59
- async recordProvenance() {
60
- if (this.initialized) {
61
- const { rows } = await this.client.query("SELECT CAST(xid AS TEXT), data FROM pg_logical_slot_get_changes($1, NULL, NULL, 'filter-tables', 'dbos.*')", [this.slotName]);
62
- for (const row of rows) {
63
- const data = JSON.parse(row.data).change;
64
- for (const change of data) {
65
- const signal = {
66
- provTransactionID: row.xid,
67
- kind: change.kind,
68
- schema: change.schema,
69
- table: change.table,
70
- columnnames: change.columnnames,
71
- columntypes: change.columntypes,
72
- columnvalues: change.columnvalues
73
- };
74
- this.telemetryCollector.push(signal);
75
- }
76
- }
77
- }
78
- }
79
- async stop() {
80
- clearInterval(this.daemonID);
81
- await this.client.end();
82
- await this.telemetryCollector.destroy();
83
- }
84
- }
85
- exports.ProvenanceDaemon = ProvenanceDaemon;
86
- //# sourceMappingURL=provenance_daemon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provenance_daemon.js","sourceRoot":"","sources":["../../../src/provenance/provenance_daemon.ts"],"names":[],"mappings":";;;AAAA,2BAA2C;AAC3C,sDAA0D;AAC1D,sDAA4D;AAsB5D;;;;;;;;;;;;GAYG;AACH,MAAa,gBAAgB;IAWkB;IAVpC,MAAM,CAAC;IACP,QAAQ,CAAC;IACT,0BAA0B,GAAG,IAAI,CAAC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