Netmask is absent when selecting INET datatype #17929
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
domain/client
Issue in the "Client" domain: Prisma Client, Prisma Studio etc.
kind/bug
A reported bug.
topic: broken query
topic: postgresql
Discussed in #17903
I have a project with table configured like that
Which gives me table as I expected (DDL as example):
In this table I have only one record (for test purposes):
Also I have a route, which should just return every records stored in IP table
As a result it gives:
Everything is nearly correct, but there is no mask in address field. In this case I'm expecting "address": "127.0.0.0/16" as it stored in Data Base.
The netmask should be in the output if it is not the single host, as it said in the reference here.
and
I've found one workaround:
This gives me output as I expected:
So everything is looks like function
host
applied somewhere under the hood of prisma (or maybe evenpg
driver) (take look at Table 9-32 here in reference). Or some other same thing happens. But I'm quite sure that functiontext
have to be applied when casting postgres INET datatype to JS String by default (and I found no proves that it is actually done).The text was updated successfully, but these errors were encountered: