Skip to content

Commit

Permalink
Include multiline string literals when creating statements (#1520)
Browse files Browse the repository at this point in the history
* Include multiline string literals when creating statements

* Bump version to 2.6.2
  • Loading branch information
diasdauletov committed Aug 9, 2023
1 parent 9238001 commit f053c33
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/compilers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ function extractSqlxParts(rootNode: SyntaxTreeNode) {
SyntaxTreeNodeType.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER,
SyntaxTreeNodeType.SQL_COMMENT,
SyntaxTreeNodeType.SQL_LITERAL_STRING,
SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,
SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR
].includes(node.type)
)
Expand Down
8 changes: 8 additions & 0 deletions tests/core/core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1319,11 +1319,19 @@ pre_operations {
compilers.compile(
`
select
"""
triple
quotes
""",
"asd\\"123'def",
'asd\\'123"def',
post_operations {
select
"""
triple
quotes
""",
"asd\\"123'def",
'asd\\'123"def',
}
Expand Down
8 changes: 8 additions & 0 deletions tests/core/strings-act-literally.js.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const database = ctx.database ? ctx.database.bind(ctx) : undefined;

return [`
select
"""
triple
quotes
""",
"asd\\"123'def",
'asd\\'123"def',

Expand All @@ -37,6 +41,10 @@ const database = ctx.database ? ctx.database.bind(ctx) : undefined;

return [`
select
"""
triple
quotes
""",
"asd\\"123'def",
'asd\\'123"def',
`];
Expand Down
2 changes: 1 addition & 1 deletion version.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# NOTE: If you change the format of this line, you must change the bash command
# in /scripts/publish to extract the version string correctly.
DF_VERSION = "2.6.1"
DF_VERSION = "2.6.2"

0 comments on commit f053c33

Please sign in to comment.