Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bonddim/go-sqlcmd
go-sqlcmd cli for Microsoft SQL Server, Azure SQL and Azure Synapse
https://github.com/bonddim/go-sqlcmd
azure-sql go-sqlcmd mssql sql-server sqlcmd
Last synced: about 2 months ago
JSON representation
go-sqlcmd cli for Microsoft SQL Server, Azure SQL and Azure Synapse
- Host: GitHub
- URL: https://github.com/bonddim/go-sqlcmd
- Owner: bonddim
- License: mit
- Created: 2024-05-09T09:01:51.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-09T17:38:39.000Z (about 2 months ago)
- Last Synced: 2024-11-09T18:20:29.888Z (about 2 months ago)
- Topics: azure-sql, go-sqlcmd, mssql, sql-server, sqlcmd
- Language: Dockerfile
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [go-sqlcmd](https://github.com/microsoft/go-sqlcmd) docker image
[docker-hub]: https://hub.docker.com/r/bonddim/go-sqlcmd
[![Docker](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml/badge.svg)](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml)
[![Docker Image Version](https://img.shields.io/docker/v/bonddim/go-sqlcmd?logo=docker&label=latest)][docker-hub]
[![Docker Image Size](https://img.shields.io/docker/image-size/bonddim/go-sqlcmd?logo=docker)][docker-hub]
[![Docker Pulls](https://img.shields.io/docker/pulls/bonddim/go-sqlcmd?logo=docker&label=pulls)][docker-hub]
[![GitHub License](https://img.shields.io/github/license/bonddim/go-sqlcmd)](https://github.com/bonddim/go-sqlcmd?tab=MIT-1-ov-file)## About
- Supported architectures: **amd64**, **arm64**, **s390x**
- Uses [gcr.io/distroless/static:nonroot](https://github.com/GoogleContainerTools/distroless) as image base
- Uses [released sqlcmd](https://github.com/microsoft/go-sqlcmd/releases) binary
- Updated automatically by Renovate## Usage
```bash
# 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:
```bash
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:
```yaml
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](https://docs.microsoft.com/sql/tools/go-sqlcmd-utility) for syntax and command line arguments
## License
Inherited from [microsoft/go-sqlcmd](https://github.com/microsoft/go-sqlcmd?tab=MIT-1-ov-file)