From 95b430252cde0e3a6d737ed81e700034a56cdbc8 Mon Sep 17 00:00:00 2001 From: jialei Date: Thu, 14 Nov 2024 16:54:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A5=E5=85=85jsonQuery=20=E5=AF=B9?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=20=E7=B1=BB=E4=BC=BC=EF=BC=9A=20SELECT=20*=20FROM=20`table=5Fn?= =?UTF-8?q?ame`=20WHERE=20JSON=5FEXTRACT(`number`,'$')=20LIKE=20'%26787-78?= =?UTF-8?q?%'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- json.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/json.go b/json.go index e6d021e..5604bdc 100644 --- a/json.go +++ b/json.go @@ -305,6 +305,9 @@ const prefix = "$." func jsonQueryJoin(keys []string) string { if len(keys) == 1 { + if keys[0] == "$" { + return "$" + } return prefix + keys[0] } From e41af2e0564d0ff9c7453cc169c097d45c6d8735 Mon Sep 17 00:00:00 2001 From: jialei Date: Thu, 14 Nov 2024 17:06:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9gomod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2f447e0..ba11691 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gorm.io/datatypes +module github.com/MichealJl/datatypes go 1.19