Skip to content

JS: Add model of pg-promise #5553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 30, 2021
Merged

JS: Add model of pg-promise #5553

merged 6 commits into from
Mar 30, 2021

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Mar 29, 2021

Adds a model of pg-promise, a PostgreSQL connector library.

Evaluations: (internal link)

@asgerf asgerf added JS JS:changes-sources-or-sinks Changes taint sources/sinks for the JS analysis labels Mar 29, 2021
@asgerf asgerf requested a review from a team as a code owner March 29, 2021 09:19
Copy link
Contributor

@esbena esbena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Impressive numbers!

Subjective module structuring:

What do you think of splittling the Postgres module into two internal modules Postgres::pg and Postgres::pg-promise to avoid the explicit mention of pg-promise in all of the docstrings?

Types

pg-promise has types, can we add the ofType cases to this PR, like we do for our related mongodb/mongoose models?

result = API::Node::ofType("mongoose", "Model")

@asgerf
Copy link
Contributor Author

asgerf commented Mar 29, 2021

What do you think of splittling the Postgres module into two internal modules Postgres::pg and Postgres::pg-promise to avoid the explicit mention of pg-promise in all of the docstrings?

I don't think it's a huge problem to mention pg-promise in the docstring. It's also easier to read than having to scroll upwards to see what module you're inside.

pg-promise has types, can we add the ofType cases to this PR, like we do for our related mongodb/mongoose models?

👍

@@ -0,0 +1,13 @@
import { IDatabase } from "pg-promise";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this file belongs to the typed directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typed directory is for tests that rely on type information provided by the TypeScript compiler, which in turn requires a .d.ts shim.

As of #4401, however, we don't need that in our tests anymore, which is why the test works in this directory.

esbena
esbena previously approved these changes Mar 29, 2021
@codeql-ci codeql-ci merged commit 6cceb73 into github:main Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation JS:changes-sources-or-sinks Changes taint sources/sinks for the JS analysis JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants