jaguar_orm
jaguar_orm copied to clipboard
PostgreSQL DateTime field "insert" crash
The bug is inside:
postgresql/lib/src/compose/insert.dart
When try to insert a DateTime in a timestamp field:
ModelAccount(13bfc209-ae58-4aa5-a340-aa444cfac1a4, 2020-09-06 22:39:15.556270, 2020-09-06 22:39:15.556271, [email protected]) Unhandled exception: PostgreSQLSeverity.error 42601: syntax error at or near "22"
So it's trying to use 2020-09-06 22:39:15.556270 as integer and crashes because of that.
} else if (val is DateTime) {
return "$val"; //TODO
} else if (val is bool) {
there is even // TODO the correct code is:
} else if (val is DateTime) {
return "'$val'";
} else if (val is bool) {