@shelf/postgres-local
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

postgres-local CircleCI npm (scoped)

Run any version of Postgres locally

Usage

0. Install

$ yarn add @shelf/postgres-local --dev

1. Start Postgres

import {start} from '@shelf/postgres-local';

await start({
  seedPath: "schema.sql",
  version: 14,
  port: 5555,
  includeInstallation: true,
  debugMode: false
});
  • seedPath - absolute path to sql file with commands that will set up db structure before tests
  • includeInstallation
    • when this flag is true (default) macOS will run brew install and linux apt install to make sure postgres is installed
    • when false - package omit installing postgres and relly that it is already in place
  • debugMode - used for streaming terminal logs during executing start and stop methods

2. Stop Postgres

import {stop} from '@shelf/postgres-local';

await stop({version: 14});

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT © Shelf

/@shelf/postgres-local/

    Package Sidebar

    Install

    npm i @shelf/postgres-local

    Weekly Downloads

    584

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    9.27 kB

    Total Files

    10

    Last publish

    Collaborators

    • marianna-milovanova-shelf
    • andrew_batutin
    • marianna-milovanova
    • ksenia_holovko
    • petro.bodnarchuk
    • kateryna-kochina
    • maksym.tarnavskyi
    • andrii-nastenko
    • mykhailo.yatsko
    • ahavrysh
    • nikita_shelf
    • maciej.orlowski
    • monopotan
    • andrew214
    • bogdan.kolesnyk
    • andrii.batutin
    • kristina.zhak
    • anton-russo
    • mmazurowski
    • toms-shelf
    • mateuszgajdashelf
    • kchlon
    • dmytro.harazdovskiy
    • duch0416
    • i5adovyi
    • olesiamuller
    • mykola.khytra
    • yuliiakovalchuk
    • el_scrambone
    • bodyaflesh
    • slavammellnikov
    • andriisermiahin
    • mpushkin
    • batovpavlo
    • domovoj
    • vozemer
    • oleksii.dymnich
    • dima-bond
    • maksym.hayovets
    • oles.zadorozhnyy
    • ss1l
    • gemshelf
    • hartzler
    • vladgolubev
    • hmelenok
    • knupman
    • maaraanas
    • terret
    • chapelskyi.slavik
    • pihorb
    • irynah
    • diana.kryskuv
    • andy.raven
    • rafler
    • sskalp88
    • demiansua
    • yuriil
    • ktv18
    • drews_abuse
    • rostyslav-horytskyi
    • whodeen