Domain Documentation

Class MySQLDatabase​Manager

public final class MySQLDatabaseManager  

Class that manages operations to MySQL.

Initializers

init(hostname:​port:​username:​password:​database:​tls​Configuration:​max​Connections​Per​Event​Loop:​connection​Pool​Timeout:​encoder:​decoder:​)

public init(
        hostname: String,
        port: Int = 3306,
        username: String,
        password: String,
        database: String,
        tlsConfiguration: TLSConfiguration? = .forClient(certificateVerification: .none),
        maxConnectionsPerEventLoop: Int = 1,
        connectionPoolTimeout: NIO.TimeAmount = .seconds(10),
        encoder: MySQLDataEncoder = .init(),
        decoder: MySQLDataDecoder = .init()
    ) 

Properties

environmental

public static var environmental: Self  

Standard global instance of this class.

fluent

public var fluent: FluentKit.Database  

database connection with fleunt

Refer to it when you need to connect to the database. Otherwise, an unnecessary connection will be generated.

mysql

public var mysql: MySQLNIO.MySQLDatabase  

sql

public var sql: SQLKit.SQLDatabase