mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Merge pull request #20276 from github/tausbn/python-model-psycopg2-connection-pools
Python: Add support for Psycopg2 database connection pools
This commit is contained in:
@@ -29,4 +29,17 @@ private module Psycopg2 {
|
||||
class Psycopg2 extends PEP249::PEP249ModuleApiNode {
|
||||
Psycopg2() { this = API::moduleImport("psycopg2") }
|
||||
}
|
||||
|
||||
/** A database connection obtained from a psycopg2 connection pool. */
|
||||
class Psycopg2ConnectionPoolMember extends PEP249::DatabaseConnection {
|
||||
Psycopg2ConnectionPoolMember() {
|
||||
this =
|
||||
any(Psycopg2 p)
|
||||
.getMember("pool")
|
||||
.getMember(["SimpleConnectionPool", "ThreadedConnectionPool", "AbstractConnectionPool"])
|
||||
.getAnInstance()
|
||||
.getMember("getconn")
|
||||
.getReturn()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user