quickfixgo / quickfix

The Go FIX Protocol Library :rocket:
https://www.quickfixgo.org/
Other
746 stars 290 forks source link

postgres pgx driver not supported with placeholder function #487

Closed bvrygud closed 11 months ago

bvrygud commented 2 years ago

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
    }
Yu-Xie commented 1 year ago

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
    }