Created
March 11, 2014 05:35
-
-
Save mathildathompson/9480027 to your computer and use it in GitHub Desktop.
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
| - Username and password; | |
| - \h => help; | |
| -\c butterflies_app; | |
| -\d (desribe the table) | |
| - cp -r butterflies_app butterflies_pg_app | |
| -psql --help | |
| - psql -f butterflies.sql butterflies_app (run where the butterflies.sql is) | |
| -\d butterflies | |
| -We need to connect to the postgres database; | |
| db = PG.connect(:dbname => 'butterflies_app', :host => 'localhost') | |
| puts "SQL: #{sql}" | |
| results = db.exec(sql) | |
| db.close | |
| results | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment