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

    Function createMysqlPool

    • Create a mysql2 connection pool from a connection URL. mysql2 is imported here, only when this function runs, since it's an optional dependency the rest of the code never needs. The pool returns large integer columns (the money columns, stored as 64-bit integers) as strings, which the engine then converts to bigint exactly.

      The connection collation is pinned to the schema's utf8mb4 default so the strings the posting routine derives from JSON join the table columns without collation errors.

      connectionLimit caps the pool. Each in-flight transaction holds one connection for its whole BEGIN..COMMIT, so a caller driving N concurrent submits must size this to at least N. Left unset, mysql2's default of 10 applies, which is the historical behavior.

      Parameters

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

      Returns Promise<MysqlPool>