{"library":"knex-cleaner","type":"library","category":null,"description":"knex-cleaner is a helper library designed to programmatically clear database tables for Knex.js-based applications, primarily used in testing environments. It provides functionalities to truncate or delete all tables (or a specified subset) within a given Knex database instance. It supports PostgreSQL, MySQL, and SQLite3 databases. The current stable version is 1.3.1, with its last release in 2020, primarily focusing on dependency updates and minor feature enhancements like handling schemas other than 'public' for PostgreSQL. Its key differentiation lies in its direct integration with Knex instances, offering granular control over the cleaning process, including the ability to ignore specific tables and reset identity counters for PostgreSQL. This makes it a suitable tool for ensuring a clean and consistent database state before or after running integration tests, abstracting away manual SQL commands for table clearing. While it can be used with Bookshelf.js, it operates directly on the underlying Knex instance.","language":"javascript","status":"maintenance","version":"1.3.1","tags":["javascript","knex","knexjs","bookshelf","bookselfjs"],"last_verified":"Wed May 27","install":[{"cmd":"npm install knex-cleaner","imports":["import knexCleaner from 'knex-cleaner';\nknexCleaner.clean(knex, options)","const knexCleaner = require('knex-cleaner');","import knexCleaner from 'knex-cleaner';\nconst knex = require('knex')(config);\nknexCleaner.clean(knex);"]},{"cmd":"yarn add knex-cleaner","imports":[]},{"cmd":"pnpm add knex-cleaner","imports":[]}],"homepage":null,"github":"https://github.com/steven-ferguson/knex-cleaner","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/knex-cleaner","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/knex-cleaner/compatibility"}}