ged/ruby-pg
FreeA PostgreSQL client library for Ruby
About ged/ruby-pg
Pg is the Ruby interface to the PostgreSQL RDBMS, supporting PostgreSQL 10 and later. It provides a native Ruby client library that allows developers to connect to PostgreSQL databases, execute SQL queries, and process results. The library is available as a binary gem (with libpq built-in) for major platforms including x86_64-linux, aarch64-linux, arm64-darwin, and x64-mingw-ucrt, and can also be installed from source when needed. Binary gems are pre-built and do not require system libpq, simplifying deployment. The library is actively maintained on GitHub with over 870 stars and supports various installation methods through RubyGems. Example usage demonstrates connecting to a database and querying current connections.
Key Features
Pros & Cons
- Easy installation via gem with pre-built binary gems for multiple platforms
- Active maintenance with 870+ stars and 193 forks on GitHub
- Binary gems eliminate need for system libpq installation
- Supports cross-platform development (Linux, macOS, Windows)
- Well-documented with example code and configuration guides
- LDAP connection options not supported in binary gems
- Requires Ruby 2.7+ and PostgreSQL 10+
- Source gem installation may require libpq headers and pg_config
- Binary gems on Alpine Linux need additional gcompat package