Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more PostgreSQL features #521

Closed
melkstam opened this issue Nov 16, 2022 · 2 comments
Closed

Support more PostgreSQL features #521

melkstam opened this issue Nov 16, 2022 · 2 comments

Comments

@melkstam
Copy link
Contributor

The underlaying driver used by encore to manage the is jackc/pgx which supports features such as copy from and batch queries. However, encore does not add support or forward the APIs for these features, something that would be nice to have.

@brentd
Copy link
Contributor

brentd commented Nov 27, 2022

I ran into this while working on a proof of concept with sqlc when it's configured with sql_package: pgx/v4. The code generated by sqlc expected me to provide a db struct matching an interface which has CopyFrom (and possibly other pgx-specific methods depending on what features of sqlc I use).

We have this in encore currently, which will return a *sql.DB compatible struct:

var db = sqldb.Named("inventory").Stdlib()

What might be nice to have is this to get a *pgx.Conn:

var db = sqldb.Named("inventory").Pgx()

The downside being that I understand using these would mean missing out on Encore's built-in tracing.

@eandre
Copy link
Member

eandre commented May 8, 2023

This is supported now with sqldb.Driver

@eandre eandre closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants