Skip to content

Commit b75d9b7

Browse files
committed
Review feedback
1 parent 86aa26f commit b75d9b7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

modules/module-mssql/src/common/mssqls-to-sqlite.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function toSqliteInputRow(row: any, columns: sql.IColumnMetadata): Sqlite
4545
const date = row[key] as DateWithNanosecondsDelta;
4646
if (isNaN(date.getTime())) {
4747
result[key] = null;
48+
break;
4849
}
4950

5051
const originalFormat = date.toISOString();

modules/module-mssql/test/src/mssql-to-sqlite.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ describe('MSSQL Data Types Tests', () => {
221221
test('Date types mappings', async () => {
222222
const beforeLSN = await getLatestLSN(connectionManager);
223223
const testDate = new Date('2023-03-06T15:47:00.123Z');
224+
// This adds 0.4567 milliseconds to the JS date, see https://github.com/tediousjs/tedious/blob/0c256f186600d7230aec05553ebad209bed81acc/src/data-types/datetime2.ts#L74.
225+
// Note that there's a typo in tedious there. When reading dates, the property is actually called nanosecondsDelta.
226+
// This is only relevant when binding datetime values, so only in this test.
224227
Object.defineProperty(testDate, 'nanosecondDelta', {
225228
enumerable: false,
226-
// Of course, nanosecondDelta is not measured in nanoseconds. It's actually in seconds.
227229
value: 0.0004567
228230
});
229231
await connectionManager.query(

0 commit comments

Comments
 (0)