Instance Method
serialize(to:)
func serialize(to serializer: inout SQLSerializer)
Parameters
serializerThe
SQLSerializerto use.
Discussion
Implementations of this requirement should invoke various SQLSerializer methods as appropriate to convert its contents to raw SQL form, including inspecting SQLSerializer/dialect as needed.
Important
Because this method is not throwing, an expression which encounters a serialization failure has limited options to report it. Implementations are STRONGLY discouraged from triggering a runtime error (such as via fatalError()) or from using print() to inform the user; instead, the recommended behavior for such failures is:
(Optional) Use the
SQLDatabase/loggerof theSQLSerializer/databaseto log an appropriate message at an appropriate severity level.Either output no content at all, or output deliberately syntactically invalid SQL to ensure an attempt to execute a query containing the failing expression will fail in turn.