UNPKG

arlet-db

Version:

A simple database manager for Node.js

28 lines (21 loc) 723 B
[🏠 Inicio](../README.md) ## Method: delete ### Description: The delete method removes rows from a table that match the specified criteria. ### Usage: ````javascript async delete(tableName, criteria) ```` ### Parameters: * tableName (String): The name of the table from which to delete data. * criteria (Object): An object containing key-value pairs to identify which rows to delete. ### Returns: * (Boolean): Returns true if the deletion was successful. ### Example: ````javascript const db = new ArletDb('path/to/database', 'myDatabase'); const success = await db.delete('users', { id: 1 }); console.log(success); // true ```` ### Errors: * Throws an error if the table does not exist.