FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(utils): add SQL query validator utility by ROSPL07 · Pull Request #621 · sql-js/sql.js · GitHub

/ sql.js Public

feat(utils): add SQL query validator utility - #621

Closed
ROSPL07 wants to merge 1 commit into
sql-js:masterfrom
ROSPL07:master
Closed

feat(utils): add SQL query validator utility#621
ROSPL07 wants to merge 1 commit into
sql-js:masterfrom
ROSPL07:master

Conversation

ROSPL07 commented Oct 3, 2025

Copy link
Copy Markdown

What I Did

  • Added validateQuery.js in src/ to ensure SQL queries are validated before execution.
  • Added validateQuery.test.js in test/ to verify detection of unsafe SQL queries.
  • This helps detect and prevent potentially destructive SQL operations such as DROP, DELETE, ALTER, and TRUNCATE.

Why This Change

  • Databases are vulnerable to unsafe or unintended SQL operations.
  • Adding this validation layer promotes safer query execution practices.
  • This directly supports the repository’s focus on database and SQL fundamentals.

How It Helps

  • Prevents unsafe queries from running unintentionally.
  • Demonstrates safe database practices.
  • Adds a testable, extendable utility to the project.

✅ Safe to merge — this PR adds new functionality without altering existing project behavior.

lovasoa commented Oct 3, 2025

Copy link
Copy Markdown
Member

Hey ! I have nothing against AI, but I like it when there are at least a few human words attached to a PR ! It may be a single sentence saying Hi and explaining why you think you need this :)

On the PR itself: feel free to publish this as a separate library, but I don't think checking whether an SQL string contains the one of the substrings DROP, DELETE, ALTER, or TRUNCATE is ever an useful operation.

lovasoa closed this Oct 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL