medz / prisma-dart

Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
https://prisma.pub
BSD 3-Clause "New" or "Revised" License
459 stars 31 forks source link

Query Raw fails if a column has DateTime and null values #427

Closed AndryHTC closed 2 months ago

AndryHTC commented 2 months ago

When performing a raw query using the Dart ORM, the query fails if a column contains both DateTime and null values. The following error is thrown:

FormatException: Invalid date format
null
#0      DateTime.parse (dart:core/date_time.dart:351:7)
#1      _decode (package:orm/src/runtime/raw/_deserialize_raw_results.dart:32:38)
#2      deserializeRawResult (package:orm/src/runtime/raw/_deserialize_raw_results.dart:18:42)
#3      RawClient.query (package:orm/src/runtime/raw/raw_client.dart:22:12)
<asynchronous suspension>
#4      ContrattiPrismaRepository.getContratti (package:ewocrm_server/src/features/contratti/repositories/contratti_prisma.dart:55:24)
<asynchronous suspension>
#5      ContrattiEndpoint.get (package:ewocrm_server/src/endpoints/contratti_endpoint.dart:23:12)
<asynchronous suspension>
medz commented 2 months ago

Thank you for your feedback. I will fix this problem later.

medz commented 2 months ago

Fixed in v5.1.1 version, ❤️ ~