Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PostgreSQL DateTime field "insert" crash #195

Open
unipenlabs opened this issue Sep 6, 2020 · 0 comments
Open

PostgreSQL DateTime field "insert" crash #195

unipenlabs opened this issue Sep 6, 2020 · 0 comments

Comments

@unipenlabs
Copy link

unipenlabs commented Sep 6, 2020

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, account@test.com)
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) {
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant