graphql-engine/scripts/make/repl.mk
Daniel Harvey 9c83934869 chore(tooling): add make repl-postgres command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8638
GitOrigin-RevId: 8cbc8317a661e2bb43e965be5c32696d03d394bd
2023-04-05 13:24:04 +00:00

16 lines
667 B
Makefile

# passwords/ports are set in docker-compose/databases.yaml
.PHONY: repl-sqlserver
## repl-sqlserver: start a sqlserver docker image and connect to it using sqlcmd
repl-sqlserver:
@docker compose up -d --wait sqlserver-healthcheck
@sqlcmd -S localhost,$(shell docker compose port sqlserver 1433 | sed -e 's#.*:\(\)#\1#') -U SA -P "Password!"
.PHONY: repl-postgres
## repl-postgres: start a postgres docker image and connect to it using psql
repl-postgres:
@docker compose up -d --wait postgres;
@PORT=$(shell docker compose port postgres 5432 | sed s/.*://); \
CONNECT_STRING="postgresql://hasura:hasura@localhost:$${PORT}/hasura"; \
psql $${CONNECT_STRING}