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

postgres pgx driver not supported with placeholder function #487

Closed
bvrygud opened this issue Apr 26, 2022 · 1 comment
Closed

postgres pgx driver not supported with placeholder function #487

bvrygud opened this issue Apr 26, 2022 · 1 comment

Comments

@bvrygud
Copy link

bvrygud commented Apr 26, 2022

Extract of fix config which I am working at

PersistMessages=Y
SQLStoreDriver=pgx
SQLStoreDataSourceName=postgres://pgxuser:pgxpass@localhost:5432/testdb

Using the above session settings is not able to initiate the session, having the postgres module as https://github.com/jackc/pgx which registers the driver as pgx
https://github.com/lib/pq - This module registers the driver as postgres. pq repo is not active and they recommend using pgx driver.

postgresPlaceholder can be used only if the driver is postgres and does not support pgx.
Code

	if store.sqlDriver == "postgres" {
		store.placeholder = postgresPlaceholder
	}
@bvrygud bvrygud changed the title postgres pgx driver not support with placeholder function postgres pgx driver not supported with placeholder function Apr 26, 2022
@Yu-Xie
Copy link

Yu-Xie commented Feb 24, 2023

I've encountered the same issue. Looks like it needs to be changed to something like this:

if store.sqlDriver == "postgres" || store.sqlDriver == "pgx" {
		store.placeholder = postgresPlaceholder
	}

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