Feature: Raise an error when query parameters are missing #3259
Labels
feature
New feature or request
topic:surrealql
This is related to the SurrealQL query language
triage
This issue is new
Is your feature request related to a problem?
To be frank, this one is related to my own ineptitude. 馃拃
I parameterize stuff like table names when working with my little Pydantic-based abstraction over surrealdb.py, for example:
When I tried to use this query before, there was a parameter missing--the table name to search in (
$tbl
)--it defaulted tonull
and so it tried to search a non-existent table (NULL
per my experimentation in Surrealist) so it returned nothing. It took me longer than I care to admit rummaging through log files to catch that bug.Describe the solution
This one should be fairly simple: just make it so that an error is raised when there's a parameter declared in the query string, but no value--
null
or otherwise--is provided for it.Alternative methods
You could implement this at the application layer by scanning the query string with a regex pattern like
\$(\w*)
and then checking if a value is provided for each param name found.SurrealDB version
1.0.0+20230913.54aedcd for linux on x86_64
Contact Details
@m1n3r_spl on Discord
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: