Created
July 1, 2013 14:32
-
-
Save phlco/5901344 to your computer and use it in GitHub Desktop.
sinatra pg db helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helpers do | |
def db_exec(sql) | |
conn = PG.connect(:dbname =>'DB_NAME', :host => 'localhost') | |
result = conn.exec(sql) | |
conn.close | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment