-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nico Gallinal
committed
Aug 13, 2022
1 parent
f7aa16c
commit c4cfa46
Showing
7 changed files
with
162 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# paranoid-sql | ||
|
||
> Add conditions to verify rows are not soft deleted. | ||
## Installation | ||
|
||
$ npm i @rematter/paranoid-sql | ||
OR | ||
$ yarn add @rematter/paranoid-sql | ||
|
||
## Usage | ||
|
||
```js | ||
import { getParanoidSql } from '@rematter/paranoid-sql'; | ||
|
||
const paranoidSql = getParanoidSql('SELECT * FROM t WHERE status = ?') | ||
|
||
paranoidSql // => 'SELECT * FROM `t` WHERE `status` = ? AND `t`.`deletedAt` IS NULL' | ||
``` | ||
|
||
## Built With | ||
|
||
- [`node-sql-parser`](https://github.com/taozhi8833998/node-sql-parser) - Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList, columnList and convert it back to SQL. | ||
|
||
## Authors/maintainers | ||
|
||
- **Nico Gallinal** - [nicoabie](https://github.com/nicoabie) | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.