Why use Sequelize? Sometimes you want your team to use an ORM. Often you need to run migrations. Sequelize provides ORM features and a much needed migrations library that allows us to create producible and version controlled database schemas. Setup your project Step 1: Create an npm project in your desired directory $ npm init…
All posts in databases
Postgres timestamp with timezone – “timestamptz”
Postgres can store your “timestamp with timezone” or “timestamp without timezone”.If you don’t specify either, it will default to “timestamp without timezone” Which one should you use? TLDR: “timestamps with time zones” Whats the problem living life without timezones? Say you have two users in two different timezones – one in California and one in…
Postgres tutorial – installing with brew + basics
Step 1: Install postgres brew install postgres Step 2: Start postgres server brew services start postgresql Step 3: Create a database Lets call our database “book” $ createdb book Step 4: open the psql shell List all databases in terminal with: $ psql –list Adding the name of the db after the command psql will open…