FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/tests/dasSQLITE/failed_sql_view_schema.das at master · WhyNot135/daScript · GitHub
WhyNot135
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
tests
/
dasSQLITE
/
failed_sql_view_schema.das
Copy path
More file actions
More file actions
Latest commit
History
History
History
78 lines (67 loc) · 1.92 KB
Breadcrumbs
daScript
/
tests
/
dasSQLITE
/
failed_sql_view_schema.das
Copy path
File metadata and controls
78 lines (67 loc) · 1.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
options
gen2
// Each struct intentionally violates one [sql_view] schema-validation rule.
// Each failure produces error 30111 = "macro [sql_view] failed to apply to
// the structure". Validation is fail-fast (first error aborts that struct's
// apply()) so each struct contributes exactly one error.
expect
20800
:
9
require
daslib
/
sql
require
sqlite
/
sqlite_boost
// 1. @sql_primary_key — views are read-only and don't declare keys.
[
sql_view
(
name
=
"V1"
)]
struct
V1
{
@
sql_primary_key Id : int
Name : string
}
// 2. @sql_unique — uniqueness belongs to the underlying table.
[
sql_view
(
name
=
"V2"
)]
struct
V2
{
Id : int
@
sql_unique Name : string
}
// 3. @sql_computed — view body expressions live inside _create_view, not
// GENERATED ALWAYS columns.
[
sql_view
(
name
=
"V3"
)]
struct
V3
{
Id : int
@
sql_computed = "Id * 2" Doubled : int
}
// 4. @sql_default_fn — defaults belong to the underlying table.
[
sql_view
(
name
=
"V4"
)]
struct
V4
{
Id : int
@
sql_default_fn = "CURRENT_TIMESTAMP" CreatedAt : string
}
// 5. Daslang field initializer — view fields are read-only projections.
[
sql_view
(
name
=
"V5"
)]
struct
V5
{
Id : int
Name : string = "default"
}
// 6. @sql_references — FKs belong to the underlying table.
[
sql_table
(
name
=
"Parent"
)]
struct
Parent
{
@
sql_primary_key Id : int
}
[
sql_view
(
name
=
"V6"
)]
struct
V6
{
Id : int
@
sql_references = "Parent" ParentId : int
}
// 7. @sql_on_delete — FK action belongs to the underlying table.
[
sql_view
(
name
=
"V7"
)]
struct
V7
{
Id : int
@
sql_on_delete = "cascade" ParentId : int
}
// 8. Both @sql_json and @sql_blob on the same field.
[
sql_view
(
name
=
"V8"
)]
struct
V8
{
Id : int
@
sql_json @sql_blob Payload : tuple<a : int; b : string>
}
// 9. @sql_column collision — two fields renaming to the same SQL column.
[
sql_view
(
name
=
"V9"
)]
struct
V9
{
@
sql_column = "name" A : string
@
sql_column = "name" B : string
}
Back
|
FazBrowse Home
|
New Git URL