NodeJS で Postgres を使う
とりあえずインストール
brew install postgresql ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
zshrcに、
alias pg-start="brew services start postgresql" alias pg-stop="brew services stop postgresql" alias pg-restart="brew services restart postgresql"
(brew services 便利)
その上で、
source ~/.zshrc pg-start createdb `dbname` psql -l // list all databases psql -d dbname
で接続される。
接続後は普通にDBのコマンドを打つ。
参考:
Installing Postgres via Brew (OSX) · GitHub
http://www.postgresonline.com/downloads/special_feature/postgresql83_psql_cheatsheet.pdf
Heroku Postgres | Heroku Dev Center