Closed JorritPosthuma closed 1 year ago
Ah, I see - so deno has started consuming Postgres.js directly since their npm support launch? (curious why the won't allow it since Node.js does).
Even so, no reason we shouldn't make the change since node seems to prefer new
as well.
Thank you
Great work!
I've replaced
/// <reference types="https://deno.land/x/postgresjs@v3.3.5/types/index.d.ts" />
import postgres from "https://deno.land/x/postgresjs@v3.3.5/mod.js";
with
import postgres from "npm:postgres@3.4.0";
and it works like a charm with full typing support.
Interestingly, my tests now run faster; could be because it now uses Deno's Node polyfills and they maybe implemented some part of it in Rust.
That was a great way to get the setup without my custom polyfills tested 😊
Did you not find speedups anyway since you crossed it? I'd be curious to remove my hacks in place of Denos, but only if no slowdowns are incurred.
Running the following code on deno 1.36.3 using postgres 3.3.5:
Gave the following error:
Simple fix is as proposed. Also tested if it still works in node v20.5.1, which it does :)