postgres
postgres copied to clipboard
move to jsr for dependencies and modernize some things
This pr renames the jsr package so that it uses the @db scope (used by the mongo and sqlite drivers), moves the dependency on the standard library over to the jsr ones, updates those dependencies, and replaces code that relies on deprecated functions. The following three tests are still failing but I'm not too sure quite how to fix them:
- Aborts TLS connection when certificate is untrusted
- Defaults to unencrypted when certificate is invalid and TLS is not enforced
- Attempts reconnection on socket disconnection
I'd like to definitely fix the second test as that one isn't expecting an error and is getting an error, while the other two are failing due to errors not matching the ones expected.
merge main to your branch again
@bombillazo can you take a look at this again? I merged the branches again and added a few changes to deal with Deno 2 as well. Additionally, the tests which failed here passed locally, so it seems as though something is off with Github Actions
@bombillazo is there any chance you can run the workflows for the latest commit here?
Hey, its still failing some minor checks
the majority of checks should work now, though i'm not sure why this last one isn't working. i'll keep taking a look though
hey! all the tests should pass now, if you can run them again
Still some errors :/ @williamhorning see if adding --allow-env to the test docs command helps
hi @bombillazo! after running those tests locally with that flag, a lot of the tests fail due to being really simplified and/or incomplete code samples, such as the following:
import { Client } from "https://deno.land/x/postgres/mod.ts";
const client = new Client({ user: "user", database: "test" });
const id = 12;
// Array<[number, string]>
const { rows } = await transaction.queryArray<[number, string]>`SELECT ID, NAME FROM CLIENTS WHERE ID = ${id}`;
to fix all of these short snippets and the ci would require some effort, which would be worth it, but i feel as though that (along with possibly redoing the docs site) would be better fit for another pr. either way, i'd be happy to work on doing that if that's desired
hey @bombillazo, i took another look at this and i think i've solved all of the problems with the docs test, could you approve the workflow run please?
looks like the tests were doing something weird locally, but that should be fixed now. also, would you like me to update the info and links in the README and docs to point to JSR, or would you rather that be done in a separate PR?
I could be done in this same PR
@williamhorning Thank you for your dedication and contribution.
Publish failed: https://github.com/denodrivers/postgres/actions/runs/14565320675/job/40853723464
see #499