Skip to content

Commit e1fc0ca

Browse files
committed
Added implementation hdbcli as part of PEP249::PEP249ModuleApiNode
1 parent 0325f36 commit e1fc0ca

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

python/ql/lib/semmle/python/Frameworks.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ private import semmle.python.frameworks.FlaskAdmin
3535
private import semmle.python.frameworks.FlaskSqlAlchemy
3636
private import semmle.python.frameworks.Genshi
3737
private import semmle.python.frameworks.Gradio
38+
private import semmle.python.frameworks.Hdbcli
3839
private import semmle.python.frameworks.Httpx
3940
private import semmle.python.frameworks.Idna
4041
private import semmle.python.frameworks.Invoke
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Provides classes modeling security-relevant aspects of the `hdbcli` PyPI package.
3+
* See https://pypi.org/project/hdbcli/
4+
*/
5+
6+
private import python
7+
private import semmle.python.dataflow.new.RemoteFlowSources
8+
private import semmle.python.Concepts
9+
private import semmle.python.ApiGraphs
10+
private import semmle.python.frameworks.PEP249
11+
12+
/**
13+
* Provides models for the `hdbcli` PyPI package.
14+
* See https://pypi.org/project/hdbcli/
15+
*/
16+
private module Hdbcli {
17+
/**
18+
* A model of `hdbcli` as a module that implements PEP 249, providing ways to execute SQL statements
19+
* against a database.
20+
*/
21+
class HdbcliPEP249 extends PEP249::PEP249ModuleApiNode {
22+
HdbcliPEP249() { this = API::moduleImport("hdbcli").getMember("dbapi") }
23+
}
24+
}

python/ql/test/library-tests/frameworks/hdbcli/pep249.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
conn = dbapi.connect(address="hostname", port=300, user="username", password="password")
44
cursor = conn.cursor()
55

6-
cursor.execute("some sql", (42,)) # $ MISSING: getSql="some sql"
7-
cursor.executemany("some sql", (42,)) # $ MISSING: getSql="some sql"
6+
cursor.execute("some sql", (42,)) # $ getSql="some sql"
7+
cursor.executemany("some sql", (42,)) # $ getSql="some sql"
88

99
cursor.close()

0 commit comments

Comments
 (0)