trim view query semicolon chars and allow single quotes for column aliases

This commit is contained in:
Gani Georgiev
2023-10-05 09:31:24 +03:00
parent 837134559f
commit 7fa1ff53c9
3 changed files with 57 additions and 47 deletions

View File

@@ -402,6 +402,8 @@ func (dao *Dao) saveViewCollection(newCollection, oldCollection *models.Collecti
// currently we don't support non-string model ids
// (see https://github.com/pocketbase/pocketbase/issues/3110).
func (dao *Dao) normalizeViewQueryId(query string) (string, error) {
query = strings.Trim(strings.TrimSpace(query), ";")
parsed, err := dao.parseQueryToFields(query)
if err != nil {
return "", err