Skip to content

Instance Method

sql(encoder:decoder:queryLogLevel:)

Return an object allowing access to this database via the SQLDatabase interface.
func sql(encoder: MySQLDataEncoder = .init(), decoder: MySQLDataDecoder = .init(), queryLogLevel: Logger.Level? = .debug) -> any SQLDatabase

Parameters

encoder

A MySQLDataEncoder used to translate bound query parameters into MySQLData values.

decoder

A MySQLDataDecoder used to translate MySQLData values into output values in SQLRows.

Return Value

An instance of SQLDatabase which accesses the same database as self.