@databases/mysql
Advanced tools
Comparing version 5.2.0 to 5.2.1-canary-1804
@@ -399,2 +399,43 @@ "use strict"; | ||
}); | ||
test('timestamp NULL', async () => { | ||
await db.task(async (db) => { | ||
await db.query((0, __1.sql) `SET time_zone = "+00:00";`); | ||
await db.query((0, __1.sql) ` | ||
DROP TABLE IF EXISTS dates_test_timestamp_null; | ||
CREATE TABLE dates_test_timestamp_null ( | ||
id INT NOT NULL PRIMARY KEY, | ||
a TIMESTAMP NULL DEFAULT NULL | ||
); | ||
`); | ||
const sampleDate = new Date('2000-06-03T05:40:10.123Z'); | ||
await db.query((0, __1.sql) ` | ||
INSERT INTO dates_test_timestamp_null (id, a) | ||
VALUES (1, ${sampleDate}), | ||
(2, NULL); | ||
`); | ||
expect((await (await rawConnection).query(`SELECT * from dates_test_timestamp_null`))[0]).toEqual([ | ||
{ | ||
a: '2000-06-03 15:10:10', | ||
id: 1, | ||
}, | ||
{ | ||
a: null, | ||
id: 2, | ||
}, | ||
]); | ||
const result = await db.query((0, __1.sql) ` | ||
SELECT * from dates_test_timestamp_null; | ||
`); | ||
expect(result).toEqual([ | ||
{ | ||
a: new Date('2000-06-03T05:40:10.000Z'), | ||
id: 1, | ||
}, | ||
{ | ||
a: null, | ||
id: 2, | ||
}, | ||
]); | ||
}); | ||
}); | ||
//# sourceMappingURL=dates.test.mysql.js.map |
@@ -122,3 +122,7 @@ "use strict"; | ||
var _a, _b; | ||
const match = /^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})\:(\d{2})\:(\d{2})(?:\.(\d+))?$/.exec(f.string()); | ||
const fBuffer = f.buffer(); | ||
if (fBuffer === null || fBuffer.length === 0) { | ||
return null; | ||
} | ||
const match = /^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})\:(\d{2})\:(\d{2})(?:\.(\d+))?$/.exec(fBuffer.toString()); | ||
if (!match) { | ||
@@ -125,0 +129,0 @@ throw new Error('Expected yyyy-mm-dd HH:MM:SS'); |
{ | ||
"name": "@databases/mysql", | ||
"version": "5.2.0", | ||
"version": "5.2.1-canary-1804", | ||
"description": "", | ||
@@ -9,7 +9,7 @@ "main": "./lib/index.js", | ||
"@babel/code-frame": "^7.0.0", | ||
"@databases/escape-identifier": "^1.0.2", | ||
"@databases/mysql-config": "^3.0.0", | ||
"@databases/push-to-async-iterable": "^3.0.0", | ||
"@databases/shared": "^3.0.0", | ||
"@databases/sql": "^3.2.0", | ||
"@databases/escape-identifier": "1.0.3", | ||
"@databases/mysql-config": "3.0.0", | ||
"@databases/push-to-async-iterable": "3.0.0", | ||
"@databases/shared": "3.0.0", | ||
"@databases/sql": "3.2.0", | ||
"@types/mysql": "^2.15.5", | ||
@@ -16,0 +16,0 @@ "mysql2": "^2.2.5" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145521
1520
1
+ Added@databases/mysql-config@3.0.0(transitive)
+ Added@databases/shared@3.0.0(transitive)
+ Added@databases/sql@3.2.0(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedcaller-callsite@2.0.0(transitive)
+ Addedcaller-path@2.0.0(transitive)
+ Addedcallsites@2.0.0(transitive)
+ Addedcosmiconfig@5.2.1(transitive)
+ Addedcuid@2.1.8(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedimport-fresh@2.0.0(transitive)
+ Addedis-directory@0.3.1(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedresolve-from@3.0.0(transitive)
+ Addedsprintf-js@1.0.3(transitive)
- Removed@databases/mysql-config@3.2.0(transitive)
- Removed@databases/shared@3.1.0(transitive)
- Removed@databases/sql@3.3.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedcallsites@3.1.0(transitive)
- Removedcosmiconfig@8.3.6(transitive)
- Removedimport-fresh@3.3.0(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedparent-module@1.0.1(transitive)
- Removedparse-json@5.2.0(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedresolve-from@4.0.0(transitive)
Updated@databases/shared@3.0.0
Updated@databases/sql@3.2.0