Registry / database / agentledger-mysql

agentledger-mysql

JSON →
library1.2.4jsnpmunverified

MySQL adapter for AgentLedger Runtime (v1.2.4). Provides MySQL-specific implementations for ledger persistence and migrations. Must be used alongside agentledger-runtime core. Requires external mysql2 client injection – no bundled driver. Ships TypeScript types. Release cadence: patch releases as needed.

npm install agentledger-mysql
INSTALL
IMPORT
SIG · AGENTLEDGER-MYSQL
A
agentledger-mysql
databasejavascriptv1.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MySQLAdapter
import { MySQLAdapter } from 'agentledger-mysql'
import MySQLAdapter from 'agentledger-mysql'
Named export, not default.
agentledger-runtime/mysql
import { MySQLAdapter } from 'agentledger-mysql'
import { MySQLAdapter } from 'agentledger-runtime/mysql'
Direct import from agentledger-runtime/mysql is discouraged; use agentledger-mysql for stability.

Create MySQL connection pool, instantiate MySQLAdapter, and apply migrations.

import { MySQLAdapter } from 'agentledger-mysql'; import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: process.env.MYSQL_HOST ?? 'localhost', user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', database: process.env.MYSQL_DATABASE ?? 'ledger', waitForConnections: true, connectionLimit: 10 }); const adapter = new MySQLAdapter(pool); await adapter.applyMigrations();
Debug
Known issues
breakingMySQLAdapter constructor requires a mysql2 Pool or Connection, not a raw driver instance.
fix
Use mysql2/promise pool or connection.
affects: >=1.0.0
deprecatedDirect import from agentledger-runtime/mysql is deprecated in favor of agentledger-mysql.
fix
Import from 'agentledger-mysql' instead.
affects: >=1.0.0
gotchaapplyMigrations() must be called after the adapter is constructed, before any ledger operations, or migrations may not run.
fix
Call await adapter.applyMigrations() before using other adapter methods.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'agentledger-mysql'
Package not installed or missing from node_modules.
fix
npm install agentledger-mysql
TypeError: MySQLAdapter is not a constructor
Importing default instead of named export.
fix
Use import { MySQLAdapter } from 'agentledger-mysql';
Error: Cannot find module 'mysql2'
mysql2 package not installed.
fix
npm install mysql2
Upgrade
Version history
1.2.4latest on npm
Audit
Dependencies
agentledger-runtimerequiredpeer dependency – core runtime required
mysql2requiredexternal MySQL client – must be provided by user
Agent activity
35 hits · last 30 days
node
30
OpenAI (training)
2
Resources
agentledger-mysql — npm install agentledger-mysql · libregistry