subuta / play-with-pg

Play with pg and knex.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

play-with-pg

Play with pg and knex.

🚨 CAUTION 🚨

Running test will create temporary database into postgres(for concurrent execution). You should check these database's are cleaned correctly, They might be remains in case of test failure or drop database command failure :(

🚨 CAUTION 🚨

SEE: play-with-sqlite3 also :)

How to setup

# Install dependencies
npm i

# Run postgres by docker-compose
docker-compose up

# Migrate database
npm run migrate

# Seed database
npm run seed

# Dump dev-database
npm run dump

# Run concurrent tests
npm test

# Run serial tests(slower)
npm run test-serial

DB related commands

# Generate seed
npx knex seed:make seed_name

# Generate migration
npx knex migrate:make migration_name

About

Play with pg and knex.

License:MIT License


Languages

Language:JavaScript 100.0%