Skip to content

Commit

Permalink
Merge pull request #62 from hasura/gil/use-sqlcmd-in-docker
Browse files Browse the repository at this point in the history
use sqlcmd in docker
  • Loading branch information
danieljharvey authored Nov 9, 2023
2 parents 4e8667a + 8e2eb1c commit 359eb9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ generated/
result

# temporary sql file used in justfile
temp.sql
static/temp.sql
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ services:
SA_PASSWORD: "Password!"
volumes:
- /var/opt/mssql
- type: bind
source: ./static
target: /static
healthcheck:
test:
- CMD-SHELL
Expand Down
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ start-dependencies:
# start sqlserver
docker compose down -v sqlserver
docker compose up --wait sqlserver
sqlcmd -S localhost,64003 -U SA -P "Password!" -i "./static/chinook-sqlserver.sql"
docker exec -it ndc-sqlserver-sqlserver-1 /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P "Password!" -i "/static/chinook-sqlserver.sql"

# run prometheus + grafana
start-metrics:
Expand All @@ -153,13 +153,13 @@ run-engine: start-dependencies
# smash a file in for rapid fire application development business value
run-temp-sql:
docker compose up --wait sqlserver
sqlcmd -S localhost,64003 -U SA -P "Password!" -d "Chinook" -i "./temp.sql"
docker exec -it ndc-sqlserver-sqlserver-1 /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P "Password!" -d "Chinook" -i "/static/temp.sql"

## repl-sqlserver: start a sqlserver docker image and connect to it using sqlcmd
repl-sqlserver:
#!/usr/bin/env bash
docker compose up -wait sqlserver
sqlcmd -S localhost,64003 -U SA -P "Password!" -d "Chinook"
docker compose up --wait sqlserver
docker exec -it ndc-sqlserver-sqlserver-1 /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P "Password!" -d "Chinook"
# run `clippy` linter
lint *FLAGS:
Expand Down

0 comments on commit 359eb9a

Please sign in to comment.