Comment by latchkey

2 days ago

Why typeorm over something like https://mikro-orm.io/?

In addition to TypeORM, DBOS supports several popular ORMs:

- Drizzle (we're also a sponsor to Drizzle): https://docs.dbos.dev/typescript/tutorials/orms/using-drizzl...

- Knex: https://docs.dbos.dev/typescript/tutorials/orms/using-knex

- Prisma: https://docs.dbos.dev/typescript/tutorials/orms/using-prisma

More ORM support is on the way.

  • Why not always default to using transactions?

    • DBOS always uses transactions to perform database operations. If you're writing a function that performs database operations, you can use the @DBOS.transaction() decorator to wrap the function so that DBOS's bookkeeping records commit in the same transaction as your operation.

      However, if you're interfacing with a third-party API, then that wouldn't be part of a database transaction (you'll use @DBOS.step instead). The reason is that you don't want to hold database locks when you're not performing database operations.