Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various fixes to mssql dialect (#2653)
* Fixed float type of mssql to be float * Many tests where postgres test was not actually ran at all * Migrations to be mssql compatible Mssql driver doesn't handle if multiple queries are sent to same transaction concurrently. * Prevented mssql failing when invalid schema builder was executed by accident Instead of trying to generate sql from broken schema calls, just make exception to leak before query compiling is started * Fixed mssql trx rollback to always throw an error Also modified some connection test query to be mssql compatible * Fixed various bugs from MSSQL driver to make tests run * Fixed mssql unique index to be compatible with other dialect implementations * Enable running mssql tests on CI * Test for #2588 * Updated tests to not be dependend on tables left from previous test rans * Trying to make mssql server work on travis
- Loading branch information
Showing
27 changed files
with
381 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var Connection = require('tedious').Connection; | ||
|
||
var config = { | ||
userName: "sa", | ||
password: "S0meVeryHardPassword", | ||
server: "localhost", | ||
options: { | ||
database: "knex_test", | ||
} | ||
}; | ||
|
||
let didConnect = false; | ||
let tryCount = 0; | ||
|
||
function tryToConnect() { | ||
tryCount++; | ||
if (tryCount > 50) { | ||
console.log("Giving up... it fails if it fails"); | ||
process.exit(0); | ||
} | ||
|
||
console.log("Connecting... to mssql"); | ||
|
||
var connection = new Connection(config); | ||
|
||
connection.on('end', () => { | ||
if (!didConnect) { | ||
console.log("Couldnt connnect yet... try again in two secs..."); | ||
setTimeout(tryToConnect, 2000); | ||
} | ||
}); | ||
|
||
connection.on('error', () => { | ||
// prevent leaking errors.. driver seems to sometimes emit error event, | ||
// sometimes connect event with error | ||
// and some times just closes connection without error / connect events | ||
// (debug event says that socket was ended and thats it...) | ||
}); | ||
|
||
connection.on('connect', (err) => { | ||
if (!err) { | ||
console.log("Connecting mssql server was a great success!"); | ||
didConnect = true; | ||
} else { | ||
console.log("Error was passed to connect event."); | ||
} | ||
connection.close(); | ||
}); | ||
} | ||
|
||
tryToConnect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.