Skip to content

Instance Method

appendInterpolation(idents:joinedBy:)

Embed an array of Strings as a list of SQL identifiers, using the joiner to separate them.
mutating func appendInterpolation(idents: [String], joinedBy joiner: String)

Discussion

Important

This interprets each string as an identifier, not as a literal value!

Example:

sqliteDatabase.serialize("""
    SELECT
        \(idents: "a", "b", "c", "d", joinedBy: ",")
    FROM
        \(ident: "nowhere")
    """ as SQLQueryString
).sql
// SELECT "a", "b", "c", "d" FROM "nowhere"