mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Python: Add up-/downgrade scripts
In the upgrade direction, we simply do nothing. In the downgrade direction, we remove the two new relations, and also any `Stmt` nodes corresponding to `TypeAlias` nodes.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
// We must wrap the DB types, as these cannot appear in argument lists
|
||||
class Stmt_ extends @py_stmt {
|
||||
string toString() { result = "Stmt" }
|
||||
}
|
||||
|
||||
class StmtList_ extends @py_stmt_list {
|
||||
string toString() { result = "StmtList" }
|
||||
}
|
||||
|
||||
query predicate py_stmts_without_typealias(Stmt_ id, int kind, StmtList_ parent, int idx) {
|
||||
py_stmts(id, kind, parent, idx) and
|
||||
// From the dbscheme:
|
||||
//
|
||||
// case @py_stmt.kind of
|
||||
// ...
|
||||
// | 27 = @py_TypeAlias;
|
||||
kind != 27
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
description: Remove support for type parameters and type alias statements
|
||||
compatibility: backwards
|
||||
py_type_parameters.rel: delete
|
||||
py_type_parameter_lists.rel: delete
|
||||
py_stmts.rel: run py_stmts.qlo py_stmts_without_typealias
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Add support for type parameters and type alias statements
|
||||
compatibility: backwards
|
||||
Reference in New Issue
Block a user