Skip to content

Commit b6d3cfd

Browse files
committed
multiline string migrations
1 parent 53cd0b6 commit b6d3cfd

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Sources/Compiler/Gen/SwiftGenerator.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SwiftSyntaxBuilder
1111
public struct SwiftGenerator: Language {
1212
public typealias Table = DeclSyntax
1313
public typealias File = SourceFileSyntax
14-
public typealias Migration = StringLiteralExprSyntax
14+
public typealias Migration = SwiftSyntax.ExprSyntax
1515

1616
public struct Query {
1717
public let statement: Statement
@@ -32,8 +32,12 @@ public struct SwiftGenerator: Language {
3232

3333
public static func migration(
3434
source: String
35-
) throws -> StringLiteralExprSyntax {
36-
StringLiteralExprSyntax(content: source)
35+
) throws -> SwiftSyntax.ExprSyntax {
36+
return """
37+
\"\"\"
38+
\(raw: source)
39+
\"\"\"
40+
"""
3741
}
3842

3943
public static func table(

0 commit comments

Comments
 (0)