
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
sqlite-statement-type
Advanced tools
This is a set of functions that let you test is the SQLite statement is a certain operation.
This is useful when you want to know if a statement is a SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, etc.
The next steps for this library would be to add support for checking recursive statements.
npm install sqlite-statement-type
import { isSelect } from "sqlite-statement-type";
const statement = "SELECT * FROM users";
console.log(isSelect(statement)); // true
isSelect
import { isSelect } from "sqlite-statement-type";
const statement = "SELECT * FROM table";
const result = isSelect(statement);
isInsert
import { isInsert } from "sqlite-statement-type";
const statement = "INSERT INTO table (column) VALUES ('value')";
const result = isInsert(statement);
isUpdate
import { isUpdate } from "sqlite-statement-type";
const statement = "UPDATE table SET column = 'value'";
const result = isUpdate(statement);
isDelete
import { isDelete } from "sqlite-statement-type";
const statement = "DELETE FROM table";
const result = isDelete(statement);
isCreateTable
import { isCreateTable } from "sqlite-statement-type";
const statement = "CREATE TABLE table (column TEXT)";
const result = isCreateTable(statement);
isAlterTable
import { isAlterTable } from "sqlite-statement-type";
const statement = "ALTER TABLE table ADD COLUMN column TEXT";
const result = isAlterTable(statement);
isDropTable
import { isDropTable } from "sqlite-statement-type";
const statement = "DROP TABLE table";
const result = isDropTable(statement);
isCreateIndex
import { isCreateIndex } from "sqlite-statement-type";
const statement = "CREATE INDEX index ON table (column)";
const result = isCreateIndex(statement);
isDropIndex
import { isDropIndex } from "sqlite-statement-type";
const statement = "DROP INDEX index";
const result = isDropIndex(statement);
isCreateView
import { isCreateView } from "sqlite-statement-type";
const statement = "CREATE VIEW view AS SELECT * FROM table";
const result = isCreateView(statement);
isAlterView
import { isAlterView } from "sqlite-statement-type";
const statement = "ALTER VIEW view AS SELECT * FROM table";
const result = isAlterView(statement);
isDropView
import { isDropView } from "sqlite-statement-type";
const statement = "DROP VIEW view";
const result = isDropView(statement);
isPragma
import { isPragma } from "sqlite-statement-type";
const statement = "PRAGMA table_info(table)";
const result = isPragma(statement);
isBeginTransaction
import { isBeginTransaction } from "sqlite-statement-type";
const statement = "BEGIN TRANSACTION";
const result = isBeginTransaction(statement);
isCommit
import { isCommit } from "sqlite-statement-type";
const statement = "COMMIT";
const result = isCommit(statement);
isRollback
import { isRollback } from "sqlite-statement-type";
const statement = "ROLLBACK";
const result = isRollback(statement);
isVacuum
import { isVacuum } from "sqlite-statement-type";
const statement = "VACUUM";
const result = isVacuum(statement);
isAnalyze
import { isAnalyze } from "sqlite-statement-type";
const statement = "ANALYZE";
const result = isAnalyze(statement);
isAttach
import { isAttach } from "sqlite-statement-type";
const statement = "ATTACH DATABASE 'file.db' AS db";
const result = isAttach(statement);
isDetach
import { isDetach } from "sqlite-statement-type";
const statement = "DETACH DATABASE db";
const result = isDetach(statement);
isReindex
import { isReindex } from "sqlite-statement-type";
const statement = "REINDEX";
const result = isReindex(statement);
isSavepoint
import { isSavepoint } from "sqlite-statement-type";
const statement = "SAVEPOINT sp1";
const result = isSavepoint(statement);
isRelease
import { isRelease } from "sqlite-statement-type";
const statement = "RELEASE SAVEPOINT sp1";
const result = isRelease(statement);
isCreateTrigger
import { isCreateTrigger } from "sqlite-statement-type";
const statement = "CREATE TRIGGER trigger AFTER INSERT ON table BEGIN END";
const result = isCreateTrigger(statement);
isDropTrigger
import { isDropTrigger } from "sqlite-statement-type";
const statement = "DROP TRIGGER trigger";
const result = isDropTrigger(statement);
isCreateVirtualTable
import { isCreateVirtualTable } from "sqlite-statement-type";
const statement = "CREATE VIRTUAL TABLE vt USING module";
const result = isCreateVirtualTable(statement);
isDropVirtualTable
import { isDropVirtualTable } from "sqlite-statement-type";
const statement = "DROP VIRTUAL TABLE vt";
const result = isDropVirtualTable(statement);
FAQs
Check what type of statement a SQL query is.
The npm package sqlite-statement-type receives a total of 444 weekly downloads. As such, sqlite-statement-type popularity was classified as not popular.
We found that sqlite-statement-type demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.