Created
September 16, 2019 20:50
-
-
Save jougene/30f329853b00a45d7eb2081526acf594 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// PATCH | |
if (column.default !== undefined) { | |
expression_1 += this.connection.driver.normalizeDefault(column); | |
} else { | |
// sqlite | |
if (_this.connection.driver instanceof AbstractSqliteDriver_1.AbstractSqliteDriver) { | |
expression_1 += "NULL" | |
// not sqlite | |
} else { | |
expression_1 += "DEFAULT"; | |
} | |
} | |
if (this.connection.driver instanceof AbstractSqliteDriver) { // unfortunately sqlite does not support DEFAULT expression in INSERT queries | |
if (column.default !== undefined) { // try to use default defined in the column | |
expression += this.connection.driver.normalizeDefault(column); | |
} else { | |
expression += "NULL"; // otherwise simply use NULL and pray if column is nullable | |
} | |
} else { | |
expression += "DEFAULT"; | |
} | |
if (_this.connection.driver instanceof AbstractSqliteDriver_1.AbstractSqliteDriver) { // unfortunately sqlite does not support DEFAULT expression in INSERT queries | |
if (column.default !== undefined) { // try to use default defined in the column | |
expression_1 += _this.connection.driver.normalizeDefault(column); | |
} | |
else { | |
expression_1 += "NULL"; // otherwise simply use NULL and pray if column is nullable | |
} | |
} | |
else { | |
expression_1 += "DEFAULT"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment