A MySQL connection pool provider for the Meadow ORM, wrapping mysql2 as a Fable service. Current stable version 1.0.19. Provides connection pooling with named placeholders, auto-connect support, and DDL generation from Meadow table schemas. Supports both Meadow-style and mysql2-native configuration formats. Notable differentiator: integrates tightly with the Fable dependency injection framework, offering auto-connect guards and schema-driven table creation. Release cadence is irregular; last release November 2023.
npm install meadow-connection-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a Fable instance with MySQL config, adds MeadowConnectionMySQL as a service, auto-connects, and runs a test query.
Set the flag in constructor options or call fable.MeadowMySQLProvider.connect() after service registration.
Wrap calls with util.promisify() or use a Promise wrapper: const query = util.promisify(pool.query).bind(pool);
Always use fable.serviceManager.addAndInstantiateServiceType('MeadowMySQLProvider', MeadowConnectionMySQL).Ensure logging is disabled or sanitized in production. Consider using environment variables for credentials.
Check if fable.MeadowMySQLProvider.pool exists before calling connect() again, or rely on the guard.
Explicitly set ConnectionPoolLimit in config to avoid running out of connections under load.
Ensure MeadowConnectionMySQLAutoConnect: true in config, or call `fable.MeadowMySQLProvider.connect()` after addAndInstantiateServiceType.
Wrap pool.query inside the callback of connectAsync, or use events to check pool status.
Add `authPlugins: { sha256_password: undefined }` to mysql2 connection config, or set default auth plugin to mysql_native_password on server.Run: npm install fable meadow-connection-mysql (fable must be installed separately).