Skip to content
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

Add test cases for DB query parsing and sanitization #1923

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

alanwest
Copy link
Member

Towards #984

Opening this PR to start a discussion for how we want to format test cases for database query parsing and sanitization.

Each test case includes the following fields

  • A name identifying the test case
  • A sql statement representing the input
  • An array of valid sanitized versions of the input
    • For example, the specification states that IN clauses MAY be collapsed. So, both IN (?) and IN (?,?,?) are valid.
  • summary is what db.query.summary should equal
  • operation is what db.operation.name should equal
  • collection is what db.collection.name should equal
  • An array of dialects that the test case targets
    • For now I have only validated this test suite against my work on MSSQL. However, many of these test cases are equally valid for other dialects.

For this first iteration I would like to settle on the format for presenting these test cases. In follow ups we can expand the test cases and also handle additional idiosyncrasies of other dialects.

@alanwest alanwest requested review from a team as code owners February 19, 2025 22:09
@alanwest
Copy link
Member Author

@trask @lmolkova I plan to attend the DB semconv meeting tomorrow so we have a chance to discuss this synchronously first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants