Add support for configuring the JSON unmarshal function used when querying SELECT_JSON statements.
This commit is contained in:
parent
7ab44bc61c
commit
1db6b12074
6 changed files with 74 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ package postgres
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/bytedance/sonic"
|
||||
"github.com/go-jet/jet/v2/internal/testutils"
|
||||
"github.com/go-jet/jet/v2/internal/utils/ptr"
|
||||
. "github.com/go-jet/jet/v2/postgres"
|
||||
|
|
@ -225,10 +226,24 @@ func BenchmarkJoinEverythingJSON(b *testing.B) {
|
|||
}
|
||||
}
|
||||
|
||||
func BenchmarkJoinEverythingJsonSonic(b *testing.B) {
|
||||
useJsonUnmarshalFunc(sonic.Unmarshal, func() {
|
||||
for i := 0; i < b.N; i++ {
|
||||
testJoinEverythingJSON(b)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestJoinEverythingJSON(t *testing.T) {
|
||||
testJoinEverythingJSON(t)
|
||||
}
|
||||
|
||||
func TestJoinEverythingJSONSonic(t *testing.T) {
|
||||
useJsonUnmarshalFunc(sonic.Unmarshal, func() {
|
||||
testJoinEverythingJSON(t)
|
||||
})
|
||||
}
|
||||
|
||||
func testJoinEverythingJSON(t require.TestingT) {
|
||||
|
||||
manager := Employee.AS("Manager")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue