Skip to content

Confused and not clear docs about serialize #1710

Open
@vitonsky

Description

@vitonsky

Issue Summary

I need to execute few SQL queries and wrap it in transaction, to ensure data consistency.
I see DB have method serialize and i've read the docs https://github.com/tryghost/node-sqlite3/wiki/Control-Flow

It is absolutely not clear how this method works technically. Some questions i have after read:

  • How works this wrapper? Why SQL queries inside callback will executes one by one?
  • Can i wrap callbacks to promises? Is it will still executes one by one?
  • How to wrap to promises to make my code with complex request inside transaction are flatten?

Steps to Reproduce

Version

5.1.6

Node.js Version

v18.16.0

How did you install the library?

npm i sqlite3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions