How Node.js SQLite works on Deno?
Hello, I'm curious how node:sqlite is supported in Deno? Basically you reflect the APIs exposed by Node.js? Or you get/fetch the code from Node.js and compile it to Deno? Because there are open issues in Node.js for SQLite and thought if those will be reflected in Deno once Node.js deploys them.
4 Replies
We don't fetch any code from Node. We basically polyfill the APIs and mirror the calls to the one Node specifies. The internals on how things work behind the scenes are different though. So if Nodejs has a bug in their sqlite module, that doesn't mean that Deno has it. Same is true for our code: We could theoretically have a bug that the nodejs version doesn't.
Thanks a lot @marvinh. 🙏🏼
if those will be reflected in Deno once Node.js deploys themIf you see a bug in Node.js, it might be interesting to test Deno's implementation to see if it's also present there. And I imagine the Deno team would appreciate a bug report if that's the case. I think one of the open issues/requests is for Node.js is to add async APIs, and I definitely hope Deno will implement that too once Node.js specifies the API. (Alternatively, I wouldn't mind Deno-specific async sqlite APIs, but I can see why it's simpler to just let Node design it so there aren't 2 to support.)
Thanks @CodyC yeah I found a bug some days ago present in both Node.js and Deno and they’ve been solved fortunately.