This package is a Node.js database driver designed to interface with MariaDB and MySQL, specifically adapted for 'immutable-core' concepts, meaning it encourages or facilitates an append-only data pattern. It requires Node.js v7.6.0 or higher for native async/await support. However, `immutable-database-mariasql` appears to be a wrapper around the `mariasql` package, which itself is highly outdated, having been last published over a decade ago (version 0.2.6, April 2016). Due to its reliance on a deprecated and unmaintained underlying library, this package is effectively abandoned and should not be used for new development. Its 'immutable' aspect is likely implemented at the application or wrapper level, as MariaDB/MySQL are not inherently immutable databases. For modern Node.js applications connecting to MariaDB or MySQL, the actively maintained `@mariadb/mariadb-connector-nodejs` (npm `mariadb`) is the recommended alternative.
npm install immutable-database-mariasqlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates connecting to a MariaDB/MySQL database and performing append-only operations using the async/await pattern, illustrating how to implement an 'immutable' log for user actions rather than in-place updates.
Migrate to the official and actively maintained `@mariadb/mariadb-connector-nodejs` (npm `mariadb`) for all new and existing projects.
Avoid using this package. If absolutely necessary for legacy systems, ensure it runs on Node.js versions compatible with its dependencies, ideally within the 7.x-10.x range. Isolate it in containerized environments.
Understand that 'immutability' must be carefully designed and enforced at the application level through careful schema design (e.g., audit logs, versioning tables) and application logic. Do not expect tamper-proof cryptographic guarantees from the database driver itself. Consider dedicated immutable databases if strong guarantees are needed.
Replace `immutable-database-mariasql` with a modern, actively maintained database connector like `@mariadb/mariadb-connector-nodejs` (npm `mariadb`).
Ensure `new Client()` is used and refer to the specific API of `immutable-database-mariasql` if it deviates from standard `mariasql` connection methods. The original `mariasql` uses `client.connect()` with a callback, or implicitly connects on query if auto-connect is enabled.
Check network connectivity to the database server. Ensure the database server is running and accessible. Verify firewall rules. Consider upgrading or downgrading Node.js and/or the database server version to find a compatible combination if sticking with this legacy driver.
Run `npm install mariasql` alongside `npm install immutable-database-mariasql` if `mariasql` is a peer dependency or not properly declared in the wrapper's `package.json`. It's safer to avoid this package entirely and use a modern driver.