mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-18 17:54:47 +01:00
fixed unhandled panic and wrapped all internal goroutines
This commit is contained in:
1 parent
a6deb6ab90
commit
30b4184305
11 files changed
+76
-22
No files matched your search
+6
-4
@@ -260,6 +260,12 @@ func (dao *Dao) parseQueryToFields(selectQuery string) (map[string]*queryField,
|
||||
}
|
||||
|
||||
for _, col := range p.columns {
|
||||
// note: it should be safe to use the already parsed alias as there
|
||||
// is no valid SQL where * column can be aliased to something else
|
||||
if col.alias == "*" {
|
||||
return nil, errors.New("wildcard columns (*) are not supported - manually type the collection field names you want the view query to have")
|
||||
}
|
||||
|
||||
colLower := strings.ToLower(col.original)
|
||||
|
||||
// numeric aggregations
|
||||
@@ -326,10 +332,6 @@ func (dao *Dao) parseQueryToFields(selectQuery string) (map[string]*queryField,
|
||||
continue
|
||||
}
|
||||
|
||||
if fieldName == "*" {
|
||||
return nil, errors.New("dynamic column names are not supported")
|
||||
}
|
||||
|
||||
// find the first field by name (case insensitive)
|
||||
var field *schema.SchemaField
|
||||
for _, f := range collection.Schema.Fields() {
|
||||
|
||||
@@ -243,6 +243,12 @@ func TestCreateViewSchema(t *testing.T) {
|
||||
true,
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"wrapped query with wildcard column",
|
||||
"select * from (select 1 as id)",
|
||||
true,
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"query with comments",
|
||||
`
|
||||
|
||||
Reference in new issue
Block a user