From 8e2eb1cd6058f245b9851dee6e711f40aa5345c6 Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Thu, 9 Nov 2023 15:28:36 +0200 Subject: [PATCH] use sqlcmd in docker --- .gitignore | 2 +- docker-compose.yaml | 3 +++ justfile | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4d6635b2..8b1af5e2 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ generated/ result # temporary sql file used in justfile -temp.sql +static/temp.sql diff --git a/docker-compose.yaml b/docker-compose.yaml index af4d5ad9..7c7f82f4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,6 +13,9 @@ services: SA_PASSWORD: "Password!" volumes: - /var/opt/mssql + - type: bind + source: ./static + target: /static healthcheck: test: - CMD-SHELL diff --git a/justfile b/justfile index b9b37c55..4386f50e 100644 --- a/justfile +++ b/justfile @@ -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: @@ -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: