[#7761] fixed view collection * validator and added more friendly error messages

This commit is contained in:
Gani Georgiev
2026-07-15 08:00:39 +03:00
parent 7ec875a49e
commit c388ade7f0
5 changed files with 77 additions and 92 deletions
+10 -4
View File
@@ -235,6 +235,12 @@ func TestCreateViewFields(t *testing.T) {
true,
nil,
},
{
"wrapped query with wildcard column",
"select * from (select 1 as id)",
true,
nil,
},
{
"query without id",
"select text, url, created, updated from demo1",
@@ -781,7 +787,7 @@ func TestDryRunView(t *testing.T) {
},
{
"select resolving to records with missing id",
"(select 'a' as id UNION ALL select null as id UNION ALL select 'c' as id)",
"select id from (select 'a' as id UNION ALL select null as id UNION ALL select 'c' as id)",
10,
true,
nil,
@@ -789,7 +795,7 @@ func TestDryRunView(t *testing.T) {
},
{
"select resolving to records with duplicated ids",
"(select 'a' as id UNION ALL select 'a' as id UNION ALL select 'c' as id)",
"select id from (select 'a' as id UNION ALL select 'a' as id UNION ALL select 'c' as id)",
10,
true,
nil,
@@ -797,7 +803,7 @@ func TestDryRunView(t *testing.T) {
},
{
"no sample size and valid select query but with invalid records result",
"(select 'a' as id UNION ALL select 'a' as id UNION ALL select 'c' as id)",
"select id from (select 'a' as id UNION ALL select 'a' as id UNION ALL select 'c' as id)",
0,
false, // still "valid" because there is no sample to check
map[string]string{"id": "text"},
@@ -805,7 +811,7 @@ func TestDryRunView(t *testing.T) {
},
{
"sample size < total select records",
"(select 'a' as id UNION ALL select 'b' as id UNION ALL select 'c' as id UNION ALL select 'd' as id)",
"select id from (select 'a' as id UNION ALL select 'b' as id UNION ALL select 'c' as id UNION ALL select 'd' as id)",
3,
false,
map[string]string{"id": "text"},