Created
October 9, 2013 20:45
-
-
Save ml242/6908035 to your computer and use it in GitHub Desktop.
Sinatra DB helper DO
This file contains 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