Project

pgsql

0.0
Low commit activity in last 3 years
No release in over a year
This is not the official PostgreSQL library that was originally written by Guy Decoux. As the project wasn't maintained a long time after Guy's decease, I decided to create my own project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.0
~> 13.0
 Project Readme

pgsql Ruby Gem

A PostgreSQL library that was carefully designed.

Author

Bertram Scharpf software@bertram-scharpf.de

Features

  • Connection parameters from hash
  • Query parameters
  • Asynchronous queries
  • Quick query of single lines or values
  • Full PostgreSQL quoting support
  • Built-in transactions and savepoints by Ruby blocks

Example

Write something like this:

require "pgsql"

Pg::Conn.open :dbname => "test1", :user => "jdoe" do |conn|
  conn.exec "SELECT * FROM mytable;" do |result|
  result.each { |row|
    l = row.join ", "
    ...
  }
  end
  cmd = <<~ENDSQL
    SELECT * FROM mytable WHERE num=$1::INTEGER;
  ENDSQL
  conn.query cmd, 42 do |row|
    l = row.join ", "
    ...
  end
  ...
end

Thanks

In the remembrance of Guy Decoux.

Copyright