jackc / pgx

PostgreSQL driver and toolkit for Go
MIT License
10.36k stars 818 forks source link

how to use libpgx as standard sql/db driver as using pgx drivername is giving import error on runtime ( forgot to import driver ?) #804

Closed acnologia000 closed 4 years ago

acnologia000 commented 4 years ago

am using pgx through sql/db package as drop in replacement but i am not able find how to do so i am avoiding using it as pgx connection mode for obvious reasons ( coming here from libpq)

connection, err := sql.Open("pgx", "database=dexchange username=postgres password=postgres") //pgx.Connect(context.Background(), "postgresql://localhost/dexchange?user=postgres&password=postgres")

jackc commented 4 years ago

Have you seen the getting started guide on the wiki?

https://github.com/jackc/pgx/wiki/Getting-started-with-pgx-through-database-sql

acnologia000 commented 4 years ago

Have you seen the getting started guide on the wiki?

https://github.com/jackc/pgx/wiki/Getting-started-with-pgx-through-database-sql

please add wiki link to readme.md as github wiki link is hard to notice ( obviously i missed it , kind of sorry for that too ) and google search is not too helpful and my code editor is reporting when using it in pgx connection mode image

also , is pgx through sql.db is thread safe right ( goroutine safe)?

@jackc