Sign inSign up

bonddim/go-sqlcmd

By bonddim

Updated 6 months ago

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

Image
Databases & storage
0

6.8K

bonddim/go-sqlcmd repository overview

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

Tag summary

Content type

Image

Digest

sha256:4aa8ee175

Size

9.1 MB

Last updated

6 months ago

docker pull bonddim/go-sqlcmd