Skip to content

Commit c080cba

Browse files
committed
Swift: add database migration scripts
1 parent 526f6cd commit c080cba

File tree

7 files changed

+10515
-0
lines changed

7 files changed

+10515
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
newtype TAddedUnspecifiedElement =
6+
TNonExplicitClosureExprClosureBody(Element list, Element body) {
7+
capture_list_exprs(list, body) and not explicit_closure_exprs(body)
8+
}
9+
10+
module Fresh = QlBuiltins::NewEntity<TAddedUnspecifiedElement>;
11+
12+
class TNewElement = @element or Fresh::EntityId;
13+
14+
class NewElement extends TNewElement {
15+
string toString() { none() }
16+
}
17+
18+
query predicate new_unspecified_elements(NewElement u, string property, string error) {
19+
unspecified_elements(u, property, error)
20+
or
21+
u = Fresh::map(TNonExplicitClosureExprClosureBody(_, _)) and
22+
property = "closure_body" and
23+
error = "while downgrading: closure_body not an @explicit_closure_expr"
24+
}
25+
26+
query predicate new_unspecified_element_parents(NewElement u, Element parent) {
27+
unspecified_element_parents(u, parent)
28+
or
29+
u = Fresh::map(TNonExplicitClosureExprClosureBody(parent, _))
30+
}
31+
32+
query predicate new_capture_list_exprs(Element list, NewElement body) {
33+
capture_list_exprs(list, body) and explicit_closure_exprs(body)
34+
or
35+
body = Fresh::map(TNonExplicitClosureExprClosureBody(list, _))
36+
}

0 commit comments

Comments
 (0)