I didn’t check to confirm your syntax is correct re: enum_range(NULL::$1) but I assume you did. However you can reference this post: SQL Connector SQL Server Parameter Format
And this one: SQL Database Connector connection issues - #14 by wwweb2401
For postgres the $1 syntax is correct however there are limitations in the syntax (per the second post) where legal syntax is disallowed by the Bubble’s SQL DB connector.
This is the reason we created our SQL Pro plugin to support standard SQL syntax.