From ab3cc1aeea4bc36228a7b53c868a79523d88b75a Mon Sep 17 00:00:00 2001 From: yizhi <946185759@qq.com> Date: Wed, 13 Nov 2024 14:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsearch=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/query.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b21fb3e..c516c87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yizhi/postgres", - "version": "1.0.6", + "version": "1.0.7", "main": "dist/index.js", "types": "typing/index.d.ts", "scripts": {}, diff --git a/src/query.ts b/src/query.ts index f59ef2e..94735b9 100644 --- a/src/query.ts +++ b/src/query.ts @@ -692,7 +692,7 @@ export class SelectBuilder extends WithGroup(WithJoin(Wit if (!this.#whereCache) { const result = [...this.wheres]; this.joinners.forEach(j => result.push(...j.__wheres__)); - if (this.ctx.searchs.length) result.push(this.ctx.searchs.join(" or ")) + if (this.ctx.searchs.length) result.push("(" + this.ctx.searchs.join(" or ") + ")") this.#whereCache = result.join(" and "); } return this.#whereCache;