https://github.com/potatoqualitee/mssqlsuite
A GitHub Action that automatically install SQL Server suite of tools
https://github.com/potatoqualitee/mssqlsuite
Last synced: about 1 month ago
JSON representation
A GitHub Action that automatically install SQL Server suite of tools
- Host: GitHub
- URL: https://github.com/potatoqualitee/mssqlsuite
- Owner: potatoqualitee
- License: mit
- Created: 2021-07-10T11:20:47.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T16:31:39.000Z (over 1 year ago)
- Last Synced: 2024-05-23T00:32:43.090Z (11 months ago)
- Language: PowerShell
- Size: 33.2 KB
- Stars: 39
- Watchers: 4
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - potatoqualitee/mssqlsuite - A GitHub Action that automatically install SQL Server suite of tools (PowerShell)
README
# mssqlsuite
This GitHub Action automatically installs a SQL Server suite of tools including sqlcmd, bcp, sqlpackage, the sql engine, localdb and more for Windows, macOS and Linux.## Documentation
Just copy the code below and modify the line **`install: sqlengine, sqlclient, sqlpackage, localdb, fulltext`** with the options you need.
```yaml
- name: Install a SQL Server suite of tools
uses: potatoqualitee/mssqlsuite@v1.8
with:
install: sqlengine, sqlclient, sqlpackage, localdb, fulltext
```## Usage
### Pre-requisites
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
### Inputs
* `install` - The apps to install. Options include: `sqlengine`, `sqlclient`, `sqlpackage`, `localdb`, and `fulltext`
* `sa-password` - The sa password for the SQL instance. The default is `dbatools.I0`
* `collation` - Change the collation associated with the SQL Server instance
* `version` - The version of SQL Server to install in year format. Options are 2019 and 2022 (defaults to 2022)
* `show-log` - Show logs, including docker logs, for troubleshooting### Outputs
None
### Details
| Application | Keyword | OS | Details | Time |
| -------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ------------- |
| SQL Engine | sqlengine | Linux | Docker container with SQL Server 2022, accessible at `localhost` | ~30s |
| SqlLocalDB | localdb | Linux | Not supported | N/A |
| Client Tools | sqlclient | Linux | Includes sqlcmd, bcp, and odbc drivers | ~15s |
| sqlpackage | sqlpackage | Linux | Installed from web | ~5s |
| Full-Text Search | fulltext | Linux | Installed using apt-get | ~45s |
| SQL Engine | sqlengine | Windows | Full install of SQL Server 2022, accessible at `localhost`. Docker took like 15 minutes. Windows and SQL authentication both supported. | ~3m |
| SqlLocalDB | localdb | Windows | Accessible at `(localdb)\MSSQLLocalDB` | ~30s |
| Client Tools | sqlclient | Windows | Already included in runner, including sqlcmd, bcp, and odbc drivers | N/A |
| sqlpackage | sqlpackage | Windows | Installed using chocolatey | ~20s |
| Full-Text Search | fulltext | Windows | Enabled during SQL Engine install | ~1m |
| SQL Engine | sqlengine | macOS | Docker container with SQL Server 2022 accessible at `localhost`. | ~7m |
| SqlLocalDB | localdb | macOS | Not supported | N/A |
| Client Tools | sqlclient | macOS | Includes sqlcmd, bcp, and odbc drivers | ~20s |
| sqlpackage | sqlpackage | macOS | Installed from web | ~5s |
| Full-Text Search | fulltext | macOS | Installed using apt-get | ~5m |### Example workflows
Create a SQL Server 2022 container and sqlpackage on Linux (the fastest runner, by far)
```yaml
on: [push]jobs:
test-everywhere:
name: Test Action on all platforms
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v3- name: Run the action
uses: potatoqualitee/mssqlsuite@v1.8
with:
install: sqlengine, sqlpackage- name: Run sqlclient
run: sqlcmd -S localhost -U sa -P dbatools.I0 -d tempdb -Q "SELECT @@version;" -C
```Installing everything on all OSes, plus using a different sa password and collation
```yaml
on: [push]jobs:
test-everywhere:
name: Test Action on all platforms
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]steps:
- uses: actions/checkout@v3- name: Run the action
uses: potatoqualitee/mssqlsuite@v1.8
with:
install: sqlengine, sqlclient, sqlpackage, localdb, fulltext
version: 2019
sa-password: c0MplicatedP@ssword
show-log: true
collation: Latin1_General_BIN- name: Run sqlcmd
run: sqlcmd -S localhost -U sa -P c0MplicatedP@ssword -d tempdb -Q "SELECT @@version;" -C
```## Contributing
Pull requests are welcome!## TODO
* MacOS: Migrate docker from qemu to vz to speed up the process.
* Wait for GitHub Actions to support more stuff to make the install sleeker.
* Maybe more tools from [here](https://docs.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver15).
* mssql-cli (command-line query tool)
* osql
* SQLdiag
* sqlmaint
* sqllogship
* tablediff## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)## Notes
The `SqlServer` PowerShell module is included on the Windows runner. You can find more information about what's installed on GitHub runners on their [docs page](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software).