TryGhost / node-sqlite3

SQLite3 bindings for Node.js
BSD 3-Clause "New" or "Revised" License
6.2k stars 813 forks source link

move to promises (and async/await) #834

Open ORESoftware opened 7 years ago

ORESoftware commented 7 years ago

Hey! :)

I like the API you use as is - it reminds me of what Selenium-Webdriver did for Node.js as well. (Read below).

But I am wondering if this library has plans to move to async/await instead of the homegrown flow control currently used. I like the methodology you used (is there a name for it?) but it's hard to mix other async flow control with your library.

For the record - selenium-webdriver did something similar to this library whereby every (async) call was put on a queue - they moved to promises (which will work with async await of course).

You can read about that here: https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs

and here: https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/promise.html

Might be a good excuse to update the lib, or maybe you'd recommend forking it and applying the changes if Mapbox doesn't see a need?

agauniyal commented 7 years ago

@ORESoftware this module is rarely updated, even useful PRs are pending for a long time so I don't see if you can get that change easily. Anyways you can use newer module - https://github.com/kriasoft/node-sqlite, which uses this one only underneath the hood.

daniellockyer commented 2 years ago

I'd love to see a PR for this - Promises FTW!