- vercel.json
- go to the project's dashboard on vercel.com
- click storage
- create a psql db
npm i pg knex dotenv- add
.envto.gitignore - click the
.env.localoption under the quickstart menu and copy its contents into a.envfile in the root of your local project - create a seed file resembling the
schema.sqlfile in those project (no dropping databases or managing connections only table and row creations/deletions) - seed the db using the connection string from the
psqlsnippet of the quickstart menu (psql "CONNECTION_STRING" < schema.sql) - configure you're knex config just as this project has in the
./knex.Config.jsfile. - use the knex client as you normally would!
NOTE: both your production and development environments will be connected to the same db unless you make the knexConfig.js use some conditional logic and/or fiddle with environment variables a bit.