mysql-native v3.0.0

API Reference Home: [This Version] [Latest Version] [Other Versions]


Function MySQLPool.this

Sets up a connection pool with the provided connection settings.

this (
  string host,
  string user,
  string password,
  string database,
  ushort port = cast(ushort)3306u,
  uint maxConcurrent = 4294967295u,
  SvrCapFlags capFlags = cast(SvrCapFlags)33293u,
  void delegate(Connection) onNewConnection = cast(void delegate(Connection))null
);

this (
  string host,
  string user,
  string password,
  string database,
  ushort port,
  SvrCapFlags capFlags,
  void delegate(Connection) onNewConnection = cast(void delegate(Connection))null
);

this (
  string host,
  string user,
  string password,
  string database,
  ushort port,
  void delegate(Connection) onNewConnection
);

this (
  string connStr,
  uint maxConcurrent = 4294967295u,
  SvrCapFlags capFlags = cast(SvrCapFlags)33293u,
  void delegate(Connection) onNewConnection = cast(void delegate(Connection))null
);

this (
  string connStr,
  SvrCapFlags capFlags,
  void delegate(Connection) onNewConnection = cast(void delegate(Connection))null
);

this (
  string connStr,
  void delegate(Connection) onNewConnection
);

The optional onNewConnection param allows you to set a callback which will be run every time a new connection is created.