drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[mysql] Stop truncating timestamp milliseconds

Open steviec opened this issue 1 year ago • 2 comments

The mysql Timestamp column's mapToDriverValue method was incorrectly truncating everything after the seconds when serializing Date objects to strings. This commit preserves the milliseconds. Note that this only applies to {mode: 'date'}; the string mode doesn't seem to have this same problem.

I noticed that there's a variety of other bugs related to time precision in the mysql adapter. I'll continue to look at ways to improve it, but I wanted to at least get this fix in.

steviec avatar May 30 '23 23:05 steviec

Whoops, sorry about that! I rebased, amended my commit with the signed version, and force pushed. Let me know if there's anything else I need to do.

steviec avatar Jun 05 '23 16:06 steviec

Done.

Has your team talked about making dprint linting integrated more directly into the repo? E.g. adding a script in package.json, or making it a pre-commit hook to ensure that it's happening? I'd be happy to add that, but didn't know if you were intentionally not doing it for some reason.

steviec avatar Jun 08 '23 13:06 steviec

Hi @dankochetov, could I get this merged in? It would be great to not have to continue using the forked version and having to keep it up-to-date with the upstream.

steviec avatar Jun 19 '23 15:06 steviec