mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Add clickhouse_driver model
This commit is contained in:
committed by
Rasmus Wriedt Larsen
parent
83e6e51e95
commit
f5bed2d955
@@ -9,6 +9,7 @@ private import python
|
||||
private import semmle.python.Concepts
|
||||
private import semmle.python.ApiGraphs
|
||||
private import semmle.python.frameworks.PEP249
|
||||
private import semmle.python.frameworks.data.ModelsAsData
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
@@ -37,6 +38,9 @@ module ClickhouseDriver {
|
||||
or
|
||||
// commonly used alias
|
||||
classRef = API::moduleImport("clickhouse_driver").getMember("Client")
|
||||
or
|
||||
// Models-as-Data subclass
|
||||
classRef = ModelOutput::getATypeNode("clickhouse_driver.client.Client~Subclass")
|
||||
|
|
||||
result = classRef.getASubclass*()
|
||||
)
|
||||
|
||||
@@ -15,6 +15,7 @@ private import semmle.python.frameworks.Tornado
|
||||
private import semmle.python.frameworks.Stdlib
|
||||
private import semmle.python.frameworks.Requests
|
||||
private import semmle.python.frameworks.Starlette
|
||||
private import semmle.python.frameworks.ClickhouseDriver
|
||||
import semmle.python.frameworks.data.internal.ApiGraphModelsExtensions as Extensions
|
||||
|
||||
class FlaskViewClasses extends FindSubclassesSpec {
|
||||
@@ -234,6 +235,12 @@ class StarletteWebsocket extends FindSubclassesSpec {
|
||||
override API::Node getAlreadyModeledClass() { result = Starlette::WebSocket::classRef() }
|
||||
}
|
||||
|
||||
class ClickhouseClient extends FindSubclassesSpec {
|
||||
ClickhouseClient() { this = "clickhouse_driver.client.Client~Subclass" }
|
||||
|
||||
override API::Node getAlreadyModeledClass() { result = ClickhouseDriver::Client::subclassRef() }
|
||||
}
|
||||
|
||||
bindingset[fullyQualified]
|
||||
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
|
||||
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |
|
||||
|
||||
Reference in New Issue
Block a user