1.0.1 • Published 3 years ago

@rematter/paranoid-sql v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

paranoid-sql

Add conditions to verify rows are not soft deleted.

Installation

$ npm i @rematter/paranoid-sql
OR
$ yarn add @rematter/paranoid-sql

Usage

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 - Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList, columnList and convert it back to SQL.

Authors/maintainers

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.0.1

3 years ago

1.0.0

3 years ago