https://github.com/pyramation/pg-utils
https://github.com/pyramation/pg-utils
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyramation/pg-utils
- Owner: pyramation
- Created: 2020-07-20T20:38:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T13:20:12.000Z (over 2 years ago)
- Last Synced: 2025-04-06T09:27:05.858Z (15 days ago)
- Language: PLpgSQL
- Size: 633 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- jimsghstars - pyramation/pg-utils - (PLpgSQL)
README
# start the postgres db process
First you'll want to start the postgres docker (you can also just use `docker-compose up -d`):
```sh
make up
```# install modules
Install modules
```sh
yarn install
```# install the Postgres extensions
Now that the postgres process is running, install the extensions:
```sh
make install
```This basically `ssh`s into the postgres instance with the `packages/` folder mounted as a volume, and installs the bundled sql code as pgxn extensions.
# testing
Testing will load all your latest sql changes and create fresh, populated databases for each sqitch module in `packages/`.
```sh
yarn test:watch
```# building new modules
Create a new folder in `packages/`
```sh
lql init
```Then, run a generator:
```sh
lql generate
```You can also add arguments if you already know what you want to do:
```sh
lql generate schema --schema myschema
lql generate table --schema myschema --table mytable
```# deploy code as extensions
`cd` into `packages/`, and run `lql package`. This will make an sql file in `packages//sql/` used for `CREATE EXTENSION` calls to install your sqitch module as an extension.
# recursive deploy
You can also deploy all modules utilizing versioning as sqtich modules. Remove `--createdb` if you already created your db:
```sh
lql deploy awesome-db --yes --recursive --createdb
```