[Postgres v3 experimental] support aliases for type in parameters
I'm experimenting with the postgres_v3_experimental.dart
I notice this throws an exception:
PgSql.map('select email from "AspNetUsers" where id=@userId:int')
FormatException: Error at offset 42 (@userId:int): Unknown type: int
According to this table: https://www.postgresql.org/docs/16/datatype.html#:~:text=Table%C2%A08.1.%C2%A0Data%20Types
integer, int and int4 are aliases.
It would be convenient to support them too.
Right now only int4 is implemented. Note: 3.0.0 is out since yesterday evening, I'd suggest to use that instead of the older one you seem to be using.
@simolus3: I think we should have multiple values in nameForSubstitution (I'm glad that it is hidden right now), or rather have a way to also add types ad-hoc in TypeRegistry.
I agree, nameForSubstitution should allow a way to include aliases.
Do you remember why serial and bigSerial map to int4 and int8 respectively when apparently serial4 and serial8 are type names supported by Postgres as well? Maybe we can use the opportunity to resolve that as well.
I believe this has been fixed.