vanstyn / RapidApp

Turnkey ajaxy webapps
http://rapi.io
Other
48 stars 15 forks source link

Pre-validate enum values in quick search (needed for PostgreSQL) #56

Closed vanstyn closed 10 years ago

vanstyn commented 10 years ago

PostgreSQL throws an exception when when testing a value of an enum column (i.e. in a WHERE clause) against a value that is not in the predefined enum list. As a result, for quick search to be able to work, the enum values must be pre-validated.

NOTE: this is less of an issue for MultiFilter (quick search is a common/shared input) because it has access to the column editor , which already forces the user to select from the valid list -- assuming they select the 'is' type. If they don't (such as picking 'is equal to' and then using an invalid value, then, well, RapidApp is just exposing the native db behavior which is to throw an exception. In that case, they are at least intentionally creating a condition for the column. This is not the case for quick search... But, it would probably also make sense to force/default the condition type to 'is' in MultiFilter....