You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function SyntaxError( message, from, to, severity ) {
17
+
this.from = from;
18
+
this.to = to;
19
+
if( to == null )
20
+
this.to = new Offset(from.line, from.depth+1);
21
+
this.message = message;
22
+
this.severity = severity; // warning or error
23
+
if( severity == null )
24
+
this.severity = 'error';
25
+
}
26
+
27
+
28
+
where error message offsets are stuctured as follows
29
+
30
+
31
+
function Offset( line, depth ) {
32
+
this.line = line; // 0-based
33
+
this.depth = depth; // 0-based
34
+
}
35
+
36
+
37
+
# Error Types
38
+
39
+
## Misaligned Attributes
40
+
41
+
Indentation refers to the spaces at the beginning of a code line. Where in most of the other other programming languages the indentation in code is for readability only, QSQL uses indentation to define QSQL tree/forest structure. Parent-child relationship in this tree is interpreted as ether table containing list of columns, or as 2 tables related with referential integrity key constraint.
42
+
43
+
Inconsistent indentation is detected, with the error message designed to resolve any confusion.
44
+
45
+
## Invalid Object references
46
+
47
+
### Invalid Table reference in a View
48
+
49
+
Exanple:
50
+
51
+
dept
52
+
name
53
+
54
+
view customer_view customer
55
+
56
+
57
+
Here the `customer` table (or view) is missing.
58
+
59
+
### Invalid foreign key
60
+
61
+
Exanple:
62
+
63
+
department
64
+
name
65
+
empployee
66
+
dept /fk dept
67
+
68
+
Here the `dept` table (or view) is missing.
69
+
70
+
### Duplicate ID
71
+
72
+
Since identity columns are generated by default, specifying them explictly like this
73
+
74
+
dept
75
+
id
76
+
77
+
would be diagnosed an error.
78
+
79
+
### Misconstructed column type
80
+
81
+
QSQL also recognizes syntactically invalid column types like this
0 commit comments