jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

PostgreSQL DateTime field "insert" crash

Open unipenlabs opened this issue 3 years ago • 0 comments

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) {

unipenlabs avatar Sep 06 '20 19:09 unipenlabs