Alinex Database is a Node.js module that provides a comprehensive database abstraction layer, designed to simplify interactions with various relational database management systems (RDBMS) such as MySQL and PostgreSQL. Currently at version 1.1.2, this library offers key features including robust connection pooling, support for database clustering, automatic SSH tunneling for secure connections, and an object-to-query language builder. It aims for ease of configuration and use across different database types, integrating closely with the broader Alinex Namespace ecosystem for configuration management. While a specific release cadence isn't detailed, the project appears actively maintained, offering a stable API for its stated features. Its primary differentiators lie in its bundled advanced connection management capabilities and integrated query building, aiming to reduce boilerplate for common database operations.
npm install alinex-databaseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core workflow: obtaining a database instance, connecting to it from the pool, executing a simple SQL query, and ensuring proper connection release and database instance closure using callback functions.
Use `util.promisify` for individual functions (e.g., `promisify(db.connect)`) or create custom Promise wrappers to adapt the API.
Ensure `alinex-config` is correctly set up in your project, with a 'database' section defining the required connection parameters for each named instance.
Always call `conn.release()` in both success and error paths within your callback logic, or ensure it's in a `finally` block if using Promise-wrapped functions.