{"id":18151,"library":"berry-database","title":"berryDB","description":"berryDB is a lightweight, file-based relational database tool for Node.js, version 1.3.4. It aims to provide a simple and secure storage solution using a Key Word Storage (KWS) philosophy. Compared to full-featured databases like SQLite or LevelDB, berryDB is minimal and intended for small-scale applications. Release cadence is irregular; the package has seen limited updates and community adoption.","status":"active","version":"1.3.4","language":"javascript","source_language":"en","source_url":"https://github.com/qianduanXIAOHAOZI/berryDB","tags":["javascript","db","database","berry","berrydb","yhzheng"],"install":[{"cmd":"npm install berry-database","lang":"bash","label":"npm"},{"cmd":"yarn add berry-database","lang":"bash","label":"yarn"},{"cmd":"pnpm add berry-database","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library does not ship ES modules; use CommonJS require() as shown in the documentation.","wrong":"import berry from 'berry-database';","symbol":"berry","correct":"const berry = require('berry-database');"},{"note":"The CLI tool is a separate npm package 'berry-tool', not part of 'berry-database'.","wrong":"berry-database -c db mydb","symbol":"berry-tool CLI","correct":"berry -c db mydb"},{"note":"Database must be created via command-line tool before using the library.","wrong":"","symbol":"Database creation","correct":"berry -c db mydb"}],"quickstart":{"code":"const berry = require('berry-database');\n\n// Example: creating a new database (via CLI, not shown here)\n// Then, you can use the library to interact with it.\n// Assuming the tool has been used to create a database named 'testdb' and a table 'users'\n\n// Opening the database\nconst db = new berry.Database('testdb');\n\n// Inserting a record\nconst result = db.insert('users', { name: 'Alice', age: 30 });\nconsole.log('Inserted ID:', result.id);\n\n// Querying records\nconst users = db.select('users', { name: 'Alice' });\nconsole.log('Users:', users);\n\n// Updating a record\ndb.update('users', { age: 31 }, { name: 'Alice' });\n\n// Deleting a record\ndb.delete('users', { name: 'Alice' });\n\nconsole.log('Done.');","lang":"javascript","description":"Demonstrates basic CRUD operations after creating a database and table via CLI."},"warnings":[{"fix":"Install berry-tool globally: npm install -g berry-tool, then use CLI commands to set up the database structure.","message":"The library requires a separate CLI tool 'berry-tool' to create databases and tables. Without it, you cannot create new databases programmatically.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Test operations thoroughly; check the source code on GitHub for accurate method signatures.","message":"The API exposes methods like 'insert', 'select', 'update', 'delete' but the documentation is sparse and may not match actual behavior. The library may have limited error handling.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using a more actively maintained database library like SQLite (better-sqlite3) or LevelDB.","message":"The library appears to be in maintenance mode with infrequent updates. Newer Node.js versions may cause compatibility issues.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Create your own definition file or use '// @ts-ignore' when importing.","message":"No types or TypeScript definitions are provided, making integration with TypeScript projects cumbersome.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install berry-database' to install the package.","cause":"The package is not installed in the current directory.","error":"Error: Cannot find module 'berry-database'"},{"fix":"Install berry-tool and run 'berry -c db yourdbname' to create the database.","cause":"The database directory does not exist; you must create the database using the CLI tool first.","error":"Error: ENOENT: no such file or directory, open './data/db.json'"},{"fix":"Ensure you have created the database via CLI and that the library version supports that method. Check the source.","cause":"The 'Database' class may not have been instantiated correctly, or the API has changed.","error":"TypeError: db.insert is not a function"},{"fix":"Run 'npm install -g berry-tool' to install the command-line tool.","cause":"The berry-tool package is not installed globally.","error":"Dependency not found: berry-tool"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}