lucia-auth / lucia

Authentication, simple and clean
https://lucia-auth.com
MIT License
9.46k stars 485 forks source link

[Feature Request]: PG Client Adapter #1311

Closed Hebilicious closed 10 months ago

Hebilicious commented 10 months ago

Description

Hello there!

To connect to postgres with cloudflare workers/pages, one must use the pg adapter. Under the hood, it does some cloudflare specific stuff, like connection pooling. Hence why I'm asking if you're happy to accept a PR for a Client driver, that would go alongside the Pool one. Or maybe this could be implemented as a configuration flag, like pool: boolean on the existing pg one.

I'm not entirely sure if the Pool are conflicting, but if it's not and this driver is un-necessary, feel free to disregard this request and close this issue. Or perhaps add something to the docs here ? https://lucia-auth.com/database-adapters/pg/

Reference for using pg with cloudflare workers: https://developers.cloudflare.com/hyperdrive/learning/connect-to-postgres/#driver-examples

pilcrowonpaper commented 10 months ago

The latest beta version of the Postgres Adapter for v3 now accepts both Pool and Client