ueberdb2 is a Node.js library that provides a high-level abstraction layer over various database systems, allowing them to be used as simple key-value stores. It currently stands at version 5.0.48 and generally follows a release cadence driven by bug fixes, dependency updates, and new database support. Key differentiators include its ability to use a cache and buffer for performance optimization, reducing database transaction overhead through bulk writing, and offering a unified API across a wide array of database backends like MySQL, PostgreSQL, MongoDB, Redis, SQLite, Elasticsearch, and SurrealDB. It supports complex JSON objects and provides methods for getting and setting subkeys, making it versatile for diverse data storage needs.
npm install ueberdb2Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates initializing a MySQL database, setting and retrieving key-value pairs, accessing subkeys, setting nested subkeys, and using `findKeys` to query patterns. It highlights `async/await` usage and environment variable best practices for credentials.
Refactor all database interactions to use `await` with the returned Promises or `.then/.catch`.
Upgrade your Node.js environment to version 18.0.0 or higher. Consider using an LTS version for production.
Review the specific client library documentation for your chosen database if you encounter connection or configuration issues. If using Elasticsearch, ensure you've enabled `migrate_to_newer_schema` option if needed.
Before initializing a `Database` instance, install the required database driver: `npm install <your-database-driver-package>` (e.g., `npm install mysql2`).
Always call `await db.init();` and ensure it completes before making `set`, `get`, `findKeys`, etc., calls.
For CommonJS, use `const ueberdb = require('ueberdb2'); const db = new ueberdb.Database(...)`. For ESM, use `import { Database } from 'ueberdb2'; const db = new Database(...)`.Install the required database driver package: `npm install <driver-name>` (e.g., `npm install mysql2`).
Wrap `await` calls in `try...catch` blocks or chain `.catch()` to handle potential errors from asynchronous database operations.
Verify that your database server is running, reachable from your application host, and that the connection details (host, port, user, password, database name) in your `DatabaseOptions` are correct.
No dependency data recorded yet.