@pwngh/economy-lab
    Preparing search index...

    Function createMariadbPool

    • Create a MysqlPool from a connection URL using the mariadb driver — the pipelining-capable opt-in behind the same seam createMysqlPool fills with mysql2. Same store, same schema, same SQL: hand the pool to mysqlStore and every statement above the seam is identical. The difference is the wire: mysql2's command queue holds one command in flight per connection, while mariadb writes the next command before the previous response returns.

      Matches the mysql2 pool's configuration: big integer and decimal columns come back as exact strings (the engine converts them to bigint), and the connection collation is pinned to the schema's utf8mb4 default. connectionLimit caps the pool exactly as on createMysqlPool and defaults to 10; each in-flight transaction holds one connection, so size it to at least the number of concurrent submits. The URL must carry no query parameters — this factory maps the URL to driver config by hand and throws rather than silently drop options mysql2 would honor.

      Parameters

      • url: string
      • options: { connectionLimit?: number } = {}

      Returns Promise<MysqlPool>

      import { createMariadbPool } from '@pwngh/economy-lab/engines/mysql-mariadb';
      import { mysqlStore } from '@pwngh/economy-lab/engines/mysql';

      const pool = await createMariadbPool('mysql://econ:secret@127.0.0.1:3306/economy', {
      connectionLimit: 32,
      });
      const store = mysqlStore({ pool, schema: 'assert' });