Skip to content

Instantly share code, notes, and snippets.

@fijimunkii
Created October 11, 2013 00:11
Show Gist options
  • Select an option

  • Save fijimunkii/6927679 to your computer and use it in GitHub Desktop.

Select an option

Save fijimunkii/6927679 to your computer and use it in GitHub Desktop.
ruby: PG.connect escape method
def self::quote_connstr( value )
return "'" + value.to_s.gsub( /[\\']/ ) {|m| '\\' + m } + "'"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment