website/docs/documentation/mysql-server.mdx
createServer() - creates server instanceServer.listen - listen port / unix socket (same arguments as net.Server.listen)serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })
capabilityFlags controls which protocol features are advertised. Client flags are masked against these capabilities when parsing the handshake response, so the server only honors mutually-supported features.writeOk({ affectedRows: num, insertId: num })
writeEof(warnings, statusFlags)
writeTextResult(rows, fields)
connection.query callback.writeColumns(fields)
writeTextRow(row)
Every command packet received by the server will be emitted as a packet event with the parameters:
In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked.
quit()
init_db(schemaName: string)
query(sql: string)
field_list(table: string, fields: string)
ping() - Default: return OK