Skip to content

uses sqitch to manage starter schemas for a postgraphile server

Notifications You must be signed in to change notification settings

stlbucket/sqitch-phile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqitch-phile

boilerplate schemas to support quick implementation of postgraphile projects using sqitch to manage db scripts

basic packages include:

  • app-roles:
    • creates db roles to support postgres rls security
  • auth:
    • app_user management and login support.
    • this version supports the basic auth described in the postgraphile docs.
    • support for oauth or other strategies may be added here or in an alternate schema flavor
    • requires app-roles
  • org:
    • generic organization/location/contact support.
    • org.contact ==> auth.app_user
    • requires auth

quick usage

install sqitch

install postgraphile

npm install -g postgraphile

clone the repo

git clone https://github.com/stlbucket/sqitch-phile.git

git on in there

cd sqitch-phile

clean out the .git dir

rm -rf .git

init your git

git init
git add .
git commit -am 'init commit'

create a database

createdb [YOUR DATABASE NAME]

configure your environment

cd db
cp cmd.config.example cmd.config

... then set your database name in cmd.config ...

#!/usr/bin/env bash
database="[YOUR DATABASE NAME]"
hostname="localhost"

packages=(
  schema/app-roles
  schema/auth
  schema/auth_fn
  schema/org
  schema/org_fn
  core-data
)

... then let sqitch-phile configure all your packages ...

./cmd/configure

deploy

./cmd/deploy

assuming you've got postgraphile installed globally:

./cmd/server

run unit tests

in a second terminal, navigate to ./cli/ and...

npm run test

more things you can do from here ...

look at data resulting from unit tests

./dev/execute unit-test-results

revert

./cmd/revert

verify

./cmd/verify

work on your schemas individually the sqitch way

when you're ready to release, tag it:

./cmd/tag [tag-name] -n '[tag-message]'

About

uses sqitch to manage starter schemas for a postgraphile server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published