Skip to content

Commit

Permalink
remove extra pair of parentheses from "create index" query
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas committed Oct 1, 2022
1 parent f2b6f7c commit fb5229e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kysely",
"version": "0.21.6",
"version": "0.22.0",
"description": "Type safe SQL query builder",
"repository": {
"type": "git",
Expand Down
10 changes: 0 additions & 10 deletions src/query-compiler/default-query-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,17 +783,7 @@ export class DefaultQueryCompiler

if (node.expression) {
this.append(' (')

if (RawNode.is(node.expression)) {
this.append('(')
}

this.visitNode(node.expression)

if (RawNode.is(node.expression)) {
this.append(')')
}

this.append(')')
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/node/src/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ for (const dialect of BUILT_IN_DIALECTS) {
const builder = ctx.db.schema
.createIndex('test_first_name_index')
.on('test')
.expression(sql`first_name < 'Sami'`)
.expression(sql`(first_name < 'Sami')`)

testSql(builder, dialect, {
postgres: {
Expand Down

0 comments on commit fb5229e

Please sign in to comment.