Skip to content

Instantly share code, notes, and snippets.

View ferox's full-sized avatar
🏠
Working from home

Fernando "ferox" dos Santos ferox

🏠
Working from home
View GitHub Profile
@ferox
ferox / postgres-cheatsheet.md
Created January 20, 2018 18:22 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ferox
ferox / rails_annotations.md
Last active January 12, 2018 19:14 — forked from daltonjorge/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create