postgres icon indicating copy to clipboard operation
postgres copied to clipboard

move to jsr for dependencies and modernize some things

Open williamhorning opened this issue 1 year ago • 1 comments

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.

williamhorning avatar Aug 23 '24 23:08 williamhorning

merge main to your branch again

bombillazo avatar Sep 23 '24 16:09 bombillazo

@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

williamhorning avatar Dec 21 '24 21:12 williamhorning

@bombillazo is there any chance you can run the workflows for the latest commit here?

williamhorning avatar Feb 15 '25 00:02 williamhorning

Hey, its still failing some minor checks

bombillazo avatar Mar 02 '25 17:03 bombillazo

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

williamhorning avatar Mar 02 '25 20:03 williamhorning

hey! all the tests should pass now, if you can run them again

williamhorning avatar Mar 02 '25 21:03 williamhorning

Still some errors :/ @williamhorning see if adding --allow-env to the test docs command helps

bombillazo avatar Mar 03 '25 20:03 bombillazo

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

williamhorning avatar Mar 04 '25 01:03 williamhorning

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?

williamhorning avatar Apr 19 '25 17:04 williamhorning

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?

williamhorning avatar Apr 19 '25 18:04 williamhorning

I could be done in this same PR

bombillazo avatar Apr 20 '25 19:04 bombillazo

@williamhorning Thank you for your dedication and contribution.

bombillazo avatar Apr 21 '25 01:04 bombillazo

Publish failed: https://github.com/denodrivers/postgres/actions/runs/14565320675/job/40853723464

bombillazo avatar Apr 21 '25 01:04 bombillazo

see #499

williamhorning avatar Apr 21 '25 01:04 williamhorning