Open joescharf opened 10 months ago
Identifier.Sanitize() should probably check for parts[0] == ""
Maybe it should also ensure len(parts) <= 2
Sanitize
doesn't return an error so there is really nothing that can be done about length. As far as checking for ""
, again there is no error return. I suppose ""
could be filtered out. Not sure if that would just be hiding an application bug though.
Maybe just a note in the docs could suffice.
Describe the bug Turns out it's a minor thing but tripped me up for a bit. If you send a null schema into pgx.Identifier like so:
then
Identifier.Sanitize()
will return"\"\".\"dst_table\""
and you'll end up with the error:
"zero-length delimited identifier at or near \"\"\"\""
Identifier.Sanitize()
should probably check forparts[0] == ""
Maybe it should also ensure
len(parts) <= 2
To Reproduce Runnable example:
Version go 1.21.6 pgx 5.4.3
Additional Thanks for the great library!