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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/dist/src/cloud-cli/cli.js +19 -7
  2. package/dist/src/cloud-cli/cli.js.map +1 -1
  3. package/dist/src/cloud-cli/userdb.d.ts +2 -0
  4. package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
  5. package/dist/src/cloud-cli/userdb.js +78 -5
  6. package/dist/src/cloud-cli/userdb.js.map +1 -1
  7. package/dist/src/communicator.d.ts +2 -1
  8. package/dist/src/communicator.d.ts.map +1 -1
  9. package/dist/src/communicator.js.map +1 -1
  10. package/dist/src/context.d.ts +2 -2
  11. package/dist/src/context.d.ts.map +1 -1
  12. package/dist/src/context.js +7 -7
  13. package/dist/src/context.js.map +1 -1
  14. package/dist/src/dbos-executor.d.ts +1 -0
  15. package/dist/src/dbos-executor.d.ts.map +1 -1
  16. package/dist/src/dbos-executor.js +40 -24
  17. package/dist/src/dbos-executor.js.map +1 -1
  18. package/dist/src/dbos-runtime/config.d.ts +3 -0
  19. package/dist/src/dbos-runtime/config.d.ts.map +1 -1
  20. package/dist/src/dbos-runtime/config.js.map +1 -1
  21. package/dist/src/dbos-runtime/runtime.d.ts +1 -1
  22. package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
  23. package/dist/src/dbos-runtime/runtime.js +9 -9
  24. package/dist/src/dbos-runtime/runtime.js.map +1 -1
  25. package/dist/src/debugger/debug_workflow.d.ts +8 -8
  26. package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
  27. package/dist/src/debugger/debug_workflow.js +106 -35
  28. package/dist/src/debugger/debug_workflow.js.map +1 -1
  29. package/dist/src/httpServer/handler.d.ts +1 -1
  30. package/dist/src/httpServer/handler.d.ts.map +1 -1
  31. package/dist/src/httpServer/handler.js +14 -14
  32. package/dist/src/httpServer/handler.js.map +1 -1
  33. package/dist/src/httpServer/server.d.ts +3 -3
  34. package/dist/src/httpServer/server.d.ts.map +1 -1
  35. package/dist/src/httpServer/server.js +17 -17
  36. package/dist/src/httpServer/server.js.map +1 -1
  37. package/dist/src/system_database.d.ts +2 -0
  38. package/dist/src/system_database.d.ts.map +1 -1
  39. package/dist/src/system_database.js +9 -2
  40. package/dist/src/system_database.js.map +1 -1
  41. package/dist/src/testing/testing_runtime.d.ts.map +1 -1
  42. package/dist/src/testing/testing_runtime.js +7 -1
  43. package/dist/src/testing/testing_runtime.js.map +1 -1
  44. package/dist/src/workflow.d.ts +14 -1
  45. package/dist/src/workflow.d.ts.map +1 -1
  46. package/dist/src/workflow.js +90 -53
  47. package/dist/src/workflow.js.map +1 -1
  48. package/examples/hello/README.md +1 -1
  49. package/examples/hello/dbos-config.yaml +3 -0
  50. package/package.json +1 -1
@@ -18,29 +18,38 @@ 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
55
  * If it previously executed successfully, return its output.
@@ -50,7 +59,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
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());
@@ -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,17 +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
- // Flush the result buffer, setting a guard to block concurrent executions with the same UUID.
186
- this.guardOperation(funcId, check.txn_snapshot);
223
+ // For non-read-only transactions, flush the result buffer, including the guard if present.
187
224
  if (!readOnly) {
188
225
  await this.flushResultBuffer(client);
189
226
  }
@@ -194,25 +231,25 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
194
231
  // Buffer the output of read-only transactions instead of synchronously writing it.
195
232
  const guardOutput = {
196
233
  output: result,
197
- txn_snapshot: check.txn_snapshot,
234
+ txn_snapshot: txn_snapshot,
198
235
  };
199
236
  this.resultBuffer.set(funcId, guardOutput);
200
237
  }
201
238
  else {
202
239
  // Synchronously record the output of write transactions and obtain the transaction ID.
203
- 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);
204
241
  tCtxt.span.setAttribute("transaction_id", pg_txn_id);
205
242
  this.resultBuffer.clear();
206
243
  }
207
244
  return result;
208
245
  };
209
246
  try {
210
- const result = await this.#wfe.userDatabase.transaction(wrappedTransaction, config);
247
+ const result = await this.#dbosExec.userDatabase.transaction(wrappedTransaction, config);
211
248
  span.setStatus({ code: api_1.SpanStatusCode.OK });
212
249
  return result;
213
250
  }
214
251
  catch (err) {
215
- if (this.#wfe.userDatabase.isRetriableTransactionError(err)) {
252
+ if (this.#dbosExec.userDatabase.isRetriableTransactionError(err)) {
216
253
  // serialization_failure in PostgreSQL
217
254
  span.addEvent("TXN SERIALIZATION FAILURE", { retryWaitMillis });
218
255
  // Retry serialization failures.
@@ -222,16 +259,16 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
222
259
  }
223
260
  // Record and throw other errors.
224
261
  const e = err;
225
- await this.#wfe.userDatabase.transaction(async (client) => {
262
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
226
263
  await this.flushResultBuffer(client);
227
- await this.recordGuardedError(client, funcId, e);
264
+ this.presetUUID ? await this.recordGuardedError(client, funcId, e) : await this.recordUnguardedError(client, funcId, e);
228
265
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
229
266
  this.resultBuffer.clear();
230
267
  span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: e.message });
231
268
  throw err;
232
269
  }
233
270
  finally {
234
- this.#wfe.tracer.endSpan(span);
271
+ this.#dbosExec.tracer.endSpan(span);
235
272
  }
236
273
  }
237
274
  }
@@ -241,12 +278,12 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
241
278
  * The communicator may execute many times, but once it is complete, it will not re-execute.
242
279
  */
243
280
  async external(commFn, ...args) {
244
- const commConfig = this.#wfe.communicatorConfigMap.get(commFn.name);
281
+ const commConfig = this.#dbosExec.communicatorConfigMap.get(commFn.name);
245
282
  if (commConfig === undefined) {
246
283
  throw new error_1.DBOSNotRegisteredError(commFn.name);
247
284
  }
248
285
  const funcID = this.functionIDGetIncrement();
249
- const span = this.#wfe.tracer.startSpan(commFn.name, {
286
+ const span = this.#dbosExec.tracer.startSpan(commFn.name, {
250
287
  workflowUUID: this.workflowUUID,
251
288
  operationName: commFn.name,
252
289
  runAs: this.authenticatedUser,
@@ -255,17 +292,17 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
255
292
  maxAttempts: commConfig.maxAttempts,
256
293
  backoffRate: commConfig.backoffRate,
257
294
  }, this.span);
258
- const ctxt = new communicator_1.CommunicatorContextImpl(this, funcID, span, this.#wfe.logger, commConfig, commFn.name);
259
- 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) => {
260
297
  await this.flushResultBuffer(client);
261
298
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
262
299
  this.resultBuffer.clear();
263
300
  // Check if this execution previously happened, returning its original result if it did.
264
- const check = await this.#wfe.systemDatabase.checkOperationOutput(this.workflowUUID, ctxt.functionID);
301
+ const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, ctxt.functionID);
265
302
  if (check !== dbos_executor_1.dbosNull) {
266
303
  ctxt.span.setAttribute("cached", true);
267
304
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
268
- this.#wfe.tracer.endSpan(ctxt.span);
305
+ this.#dbosExec.tracer.endSpan(ctxt.span);
269
306
  return check;
270
307
  }
271
308
  // Execute the communicator function. If it throws an exception, retry with exponential backoff.
@@ -286,7 +323,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
286
323
  intervalSeconds *= ctxt.backoffRate;
287
324
  }
288
325
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
289
- this.#wfe.tracer.endSpan(ctxt.span);
326
+ this.#dbosExec.tracer.endSpan(ctxt.span);
290
327
  }
291
328
  }
292
329
  }
@@ -297,23 +334,23 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
297
334
  catch (error) {
298
335
  err = error;
299
336
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
300
- this.#wfe.tracer.endSpan(ctxt.span);
337
+ this.#dbosExec.tracer.endSpan(ctxt.span);
301
338
  }
302
339
  }
303
340
  // `result` can only be dbosNull when the communicator timed out
304
341
  if (result === dbos_executor_1.dbosNull) {
305
342
  // Record the error, then throw it.
306
343
  err = err === dbos_executor_1.dbosNull ? new error_1.DBOSError("Communicator reached maximum retries.", 1) : err;
307
- await this.#wfe.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
344
+ await this.#dbosExec.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
308
345
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: err.message });
309
- this.#wfe.tracer.endSpan(ctxt.span);
346
+ this.#dbosExec.tracer.endSpan(ctxt.span);
310
347
  throw err;
311
348
  }
312
349
  else {
313
350
  // Record the execution and return.
314
- await this.#wfe.systemDatabase.recordOperationOutput(this.workflowUUID, ctxt.functionID, result);
351
+ await this.#dbosExec.systemDatabase.recordOperationOutput(this.workflowUUID, ctxt.functionID, result);
315
352
  ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
316
- this.#wfe.tracer.endSpan(ctxt.span);
353
+ this.#dbosExec.tracer.endSpan(ctxt.span);
317
354
  return result;
318
355
  }
319
356
  }
@@ -323,11 +360,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
323
360
  */
324
361
  async send(destinationUUID, message, topic) {
325
362
  const functionID = this.functionIDGetIncrement();
326
- await this.#wfe.userDatabase.transaction(async (client) => {
363
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
327
364
  await this.flushResultBuffer(client);
328
365
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
329
366
  this.resultBuffer.clear();
330
- await this.#wfe.systemDatabase.send(this.workflowUUID, functionID, destinationUUID, message, topic);
367
+ await this.#dbosExec.systemDatabase.send(this.workflowUUID, functionID, destinationUUID, message, topic);
331
368
  }
332
369
  /**
333
370
  * Consume and return the oldest unconsumed message sent to your UUID.
@@ -336,11 +373,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
336
373
  */
337
374
  async recv(topic, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
338
375
  const functionID = this.functionIDGetIncrement();
339
- await this.#wfe.userDatabase.transaction(async (client) => {
376
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
340
377
  await this.flushResultBuffer(client);
341
378
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
342
379
  this.resultBuffer.clear();
343
- return this.#wfe.systemDatabase.recv(this.workflowUUID, functionID, topic, timeoutSeconds);
380
+ return this.#dbosExec.systemDatabase.recv(this.workflowUUID, functionID, topic, timeoutSeconds);
344
381
  }
345
382
  /**
346
383
  * Emit a workflow event, represented as a key-value pair.
@@ -348,11 +385,11 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
348
385
  */
349
386
  async setEvent(key, value) {
350
387
  const functionID = this.functionIDGetIncrement();
351
- await this.#wfe.userDatabase.transaction(async (client) => {
388
+ await this.#dbosExec.userDatabase.transaction(async (client) => {
352
389
  await this.flushResultBuffer(client);
353
390
  }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
354
391
  this.resultBuffer.clear();
355
- await this.#wfe.systemDatabase.setEvent(this.workflowUUID, functionID, key, value);
392
+ await this.#dbosExec.systemDatabase.setEvent(this.workflowUUID, functionID, key, value);
356
393
  }
357
394
  /**
358
395
  * Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
@@ -378,14 +415,14 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
378
415
  */
379
416
  getEvent(targetUUID, key, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
380
417
  const functionID = this.functionIDGetIncrement();
381
- return this.#wfe.systemDatabase.getEvent(targetUUID, key, timeoutSeconds, this.workflowUUID, functionID);
418
+ return this.#dbosExec.systemDatabase.getEvent(targetUUID, key, timeoutSeconds, this.workflowUUID, functionID);
382
419
  }
383
420
  /**
384
421
  * Retrieve a handle for a workflow UUID.
385
422
  */
386
423
  retrieveWorkflow(targetUUID) {
387
424
  const functionID = this.functionIDGetIncrement();
388
- return new RetrievedHandle(this.#wfe.systemDatabase, targetUUID, this.workflowUUID, functionID);
425
+ return new RetrievedHandle(this.#dbosExec.systemDatabase, targetUUID, this.workflowUUID, functionID);
389
426
  }
390
427
  }
391
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;AAC3F,qDAAmE;AACnE,mCAAgC;AAGhC,4CAAoD;AAEpD,uCAAsE;AACtE,6CAAuD;AA2C1C,QAAA,YAAY,GAAG;I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U,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.25-preview",
3
+ "version": "0.7.35",
4
4
  "description": "A Typescript framework built on the database",
5
5
  "license": "MIT",
6
6
  "repository": {