Skip to content

go-sqlcmd cli for Microsoft SQL Server, Azure SQL and Azure Synapse

License

Notifications You must be signed in to change notification settings

bonddim/go-sqlcmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-sqlcmd docker image

Docker Docker Image Version Docker Image Size Docker Pulls GitHub License

About

Usage

# Pull image from Docker Hub
docker pull bonddim/go-sqlcmd
# Or GitHub Container Registry
docker pull ghcr.io/bonddim/go-sqlcmd

Docker container with mounted scripts to run:

docker run \
  --rm \
  -v $(pwd)/sql_scripts:/mnt/sql \
  -e SQLCMDPASSWORD={{ password }} \
  ghcr.io/bonddim/go-sqlcmd \
    -i /mnt/sql \
    -S {{ server }} \
    -d {{ database }} \
    -u {{ user }}

K8s pod with Entra ID authentication:

apiVersion: v1
kind: Pod
metadata:
  name: go-sqlcmd
  labels:
    azure.workload.identity/use: "true"
spec:
  serviceAccountName: go-sqlcmd
  containers:
  - name: go-sqlcmd
    image: bonddim/go-sqlcmd
    args: 
      - --use-aad
      - --server
      - {{ server }}.database.windows.net
      - --database-name
      - {{ database }}
      - --query
      - {{ query }}
    securityContext:
      runAsNonRoot: true
...

Refer to official docs for syntax and command line arguments

License

Inherited from microsoft/go-sqlcmd

About

go-sqlcmd cli for Microsoft SQL Server, Azure SQL and Azure Synapse

Topics

Resources

License

Stars

Watchers

Forks

Packages