Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual transaction without callback #643

Closed
ibnumusyaffa opened this issue Aug 10, 2023 · 1 comment
Closed

manual transaction without callback #643

ibnumusyaffa opened this issue Aug 10, 2023 · 1 comment
Labels
api Related to library's API duplicate This issue or pull request already exists enhancement New feature or request

Comments

@ibnumusyaffa
Copy link

ibnumusyaffa commented Aug 10, 2023

Hi. As always, thanks for making such a great library.
I am wondering there is any plan for adding stuff like this ?

const trx = await db.transaction().begin()
try {
   const jennifer = await trx.insertInto('person')
    .values({
      first_name: 'Jennifer',
      last_name: 'Aniston',
      age: 40,
    })
    .returning('id')
    .executeTakeFirstOrThrow()
    
  await trx.commit();

} catch (error) {
  await trx.rollback();
}
@koskimas
Copy link
Member

Yep, we've considered it. You can follow the progress here #257

@koskimas koskimas added the duplicate This issue or pull request already exists label Aug 11, 2023
@igalklebanov igalklebanov added enhancement New feature or request api Related to library's API labels Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants