Skip to content

Commit

Permalink
v2 - Use tedious mssql module instead of sqlcmd (#96)
Browse files Browse the repository at this point in the history
* Use tedious mssql library instead of sqlcmd

* Fix mssql connection

* Fix SqlUtils tests

* Use config instead of connection string

* Replace conn string builder with mssql config

* Connect to master db

* Restore connection string validation regex

* PR comments, fix error handling

* Update main.js

* Use try catch for error handling

* Fix typo
  • Loading branch information
zijchen committed Oct 6, 2022
1 parent fdd530a commit ee94e77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,10 @@ jobs:
connection-string: '${{ secrets[matrix.connection_string_secret] }}Initial Catalog=${{ env.TEST_DB }};'
path: ./__testdata__/testsql.sql

# Test that go-sqlcmd has been added to runner, this step will be removed in future PR when go-sqlcmd is hooked up
- name: Test go-sqlcmd is setup
run: sqlcmd -?

- name: Set database name for cleanup
if: always()
run: sed 's/$(DbName)/${{ env.TEST_DB }}/' ./__testdata__/cleanup.sql > ${{ runner.temp }}/cleanup.sql

- name: Cleanup Test Database
if: always()
uses: ./
with:
connection-string: '${{ secrets[matrix.connection_string_secret] }}Initial Catalog=master;'
path: ${{ runner.temp }}/cleanup.sql
arguments: '-v DbName="${{ env.TEST_DB }}"'
2 changes: 1 addition & 1 deletion lib/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';

export const sqlcmdToolName = 'go-sqlcmd';
export const sqlcmdVersion = '0.8.1';
export const sqlcmdVersion = '0.9.1';

export default class Setup {

Expand Down

0 comments on commit ee94e77

Please sign in to comment.