In most cases clients will use the database/sql package instead of using this package directly. Similarly to libpq, when establishing a connection using pq you are expected to supply a connection string containing zero or more parameters. A subset of the connection parameters supported by libpq are also supported by pq. Additionally, pq also lets you specify run-time parameters (such as search_path or work_mem) directly in the connection string. This is different from libpq, which does not allow run-time parameters in the connection string, instead requiring you to supply them in the options parameter. database/sql does not dictate any specific format for parameter markers in query strings, and pq uses the Postgres-native ordinal markers. For additional instructions on querying see the documentation for the database/sql package.

Features

  • You can connect to a database using a URL
  • Use single quotes for values that contain whitespace
  • Handles bad connections for database/sql
  • Scan binary blobs correctly (i.e. bytea)
  • pq.ParseURL for converting urls to connection strings for sql.Open
  • Many libpq compatible environment variables

Project Samples

Project Activity

See All Activity >

Follow pq

pq Web Site

You Might Also Like
Employee monitoring software with screenshots Icon
Employee monitoring software with screenshots

Clear visibility and insights into how employees work. Even remotely

Our computer monitoring software allows employees, field contractors, and freelancers to manually clock in when they begin working on an assignment. The application will take screenshots randomly or at set intervals, which allows employers to observe the work process. The application only tracks activity when the employee is clocked in. No spying, only transparency.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pq!

Additional Project Details

Operating Systems

Windows

Programming Language

Go

Related Categories

Go Database Software, Go Hardware Drivers

Registered

2021-08-25