From 00f788fad5a9721a7441d524ed990ff9b9213acd Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 22 Feb 2023 19:12:26 +0800 Subject: [PATCH] =?UTF-8?q?scanner=E7=9A=84=E6=80=A7=E8=83=BD=E6=AF=94sqlx?= =?UTF-8?q?=E7=9A=84select=E5=A5=BD=E4=BA=9B=E7=9A=84=E6=A0=B7=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/query_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/model/query_test.go b/model/query_test.go index e53fd3d..3affc63 100644 --- a/model/query_test.go +++ b/model/query_test.go @@ -84,7 +84,6 @@ func BenchmarkSelectXX(b *testing.B) { } func BenchmarkScannerXX(b *testing.B) { for i := 0; i < b.N; i++ { - _, err := scanners[options](anyDb[options](), ctx, Conditions()) if err != nil { panic(err) @@ -92,6 +91,16 @@ func BenchmarkScannerXX(b *testing.B) { } } +func BenchmarkSqlXQueryXX(b *testing.B) { + for i := 0; i < b.N; i++ { + var r []options + err := sq.Select(&r, "select * from wp_options") + if err != nil { + panic(err) + } + } +} + type options struct { OptionId uint64 `gorm:"column:option_id" db:"option_id" json:"option_id" form:"option_id"` OptionName string `gorm:"column:option_name" db:"option_name" json:"option_name" form:"option_name"`