https://github.com/shadowmoose/sql-sieve
Abstraction SQL layer to recursively select test DB staging data.
https://github.com/shadowmoose/sql-sieve
database sql typescript
Last synced: about 1 month ago
JSON representation
Abstraction SQL layer to recursively select test DB staging data.
- Host: GitHub
- URL: https://github.com/shadowmoose/sql-sieve
- Owner: shadowmoose
- Created: 2020-10-31T00:45:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T15:33:46.000Z (over 3 years ago)
- Last Synced: 2025-07-01T11:51:48.422Z (12 months ago)
- Topics: database, sql, typescript
- Language: TypeScript
- Homepage:
- Size: 684 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# SQL Sieve
 [](https://www.npmjs.com/package/sql-sieve)
This tool helps with Database access,
as well as providing powerful tools to recursively pick specific row data for staging and testing.
See [tests](./tests) for more.
```typescript
let db = new Database({
database: 'test_db',
password: 'password',
user: 'root'
});
await db.loadAll();
const row = await db.tables['USERS'].select({ id: 1 });
const tree = await db.findTree(row, true);
// "tree" now contains a map of all the rows required to migrate the selected data into a fresh DB.
console.log(tree);
/*
Outputs something like:
{ USERS: [ Row { table: [Table], id: '[1]', data: [TextRow] } ],
SECOND_TABLE: [ Row { table: [Table], id: '[2]', data: [TextRow] } ] }
*/
```