Skip to content

Commit

Permalink
prepare for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Gallinal committed Aug 13, 2022
1 parent f7aa16c commit c4cfa46
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 25 deletions.
31 changes: 31 additions & 0 deletions README.md
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
125 changes: 114 additions & 11 deletions lib/getParanoidSql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/getParanoidSql.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c4cfa46

Please sign in to comment.