npm.io
1.0.10 • Published 2 years ago

pg-sanitize

Licence
ISC
Version
1.0.10
Deps
0
Size
12 kB
Vulns
0
Weekly
0
Stars
3

PG Sanitize

We used this libary for prevention our production SQL statement. Just need to purify SQL Query befor send it to execution method.

How to used

 import { sanitizeSQL } from 'pg-sanitize'
 let SQL = 'SELECT * from username; DROP TABLE username'
 SQL = sanitizeSQL(SQL);
 
 // This helper is not remove DROP TABLE but Query will be exception beacuse syntax is not correct.