Danilo Fragoso 4 mesi fa
parent
commit
18c2a7a026

+ 2 - 1
cmd/sqllogictest/main.go

@@ -12,7 +12,6 @@ import (
 	"bufio"
 	"bytes"
 	"crypto/md5"
-	"encoding/json"
 	"flag"
 	"fmt"
 	"math"
@@ -23,6 +22,8 @@ import (
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/goccy/go-json"
 )
 
 const engineName = "pizzasql"

+ 2 - 0
go.mod

@@ -1,3 +1,5 @@
 module github.com/danfragoso/pizzasql-next
 
 go 1.24
+
+require github.com/goccy/go-json v0.10.6 // indirect

+ 2 - 1
pkg/httpserver/handler.go

@@ -1,7 +1,6 @@
 package httpserver
 
 import (
-	"encoding/json"
 	"fmt"
 	"io"
 	"net/http"
@@ -9,6 +8,8 @@ import (
 	"sync/atomic"
 	"time"
 
+	"github.com/goccy/go-json"
+
 	"github.com/danfragoso/pizzasql-next/pkg/csvexport"
 	"github.com/danfragoso/pizzasql-next/pkg/csvimport"
 	"github.com/danfragoso/pizzasql-next/pkg/lexer"

+ 4 - 3
pkg/httpserver/response.go

@@ -1,9 +1,10 @@
 package httpserver
 
 import (
-	"encoding/json"
 	"log"
 	"net/http"
+
+	"github.com/goccy/go-json"
 )
 
 // ColumnInfo represents column metadata.
@@ -82,11 +83,11 @@ func writeError(w http.ResponseWriter, status int, code, message string, details
 			Details: details,
 		},
 	}
-	
+
 	// Log server errors (5xx status codes)
 	if status >= 500 {
 		log.Printf("ERROR [%d] %s: %s", status, code, message)
 	}
-	
+
 	writeJSON(w, status, resp, false)
 }

+ 2 - 1
pkg/httpserver/server_test.go

@@ -3,7 +3,6 @@ package httpserver
 import (
 	"bytes"
 	"compress/gzip"
-	"encoding/json"
 	"io"
 	"net/http"
 	"net/http/httptest"
@@ -11,6 +10,8 @@ import (
 	"testing"
 	"time"
 
+	"github.com/goccy/go-json"
+
 	"github.com/danfragoso/pizzasql-next/pkg/executor"
 	"github.com/danfragoso/pizzasql-next/pkg/storage"
 )

+ 2 - 1
pkg/kvmanager/kvmanager.go

@@ -1,7 +1,6 @@
 package kvmanager
 
 import (
-	"encoding/json"
 	"fmt"
 	"net"
 	"os"
@@ -11,6 +10,8 @@ import (
 	"strings"
 	"syscall"
 	"time"
+
+	"github.com/goccy/go-json"
 )
 
 // KVInfo contains information about the running PizzaKV instance

+ 2 - 1
pkg/storage/schema.go

@@ -1,12 +1,13 @@
 package storage
 
 import (
-	"encoding/json"
 	"fmt"
 	"strings"
 	"sync"
 	"time"
 
+	"github.com/goccy/go-json"
+
 	"github.com/danfragoso/pizzasql-next/pkg/analyzer"
 )
 

+ 2 - 1
pkg/storage/table.go

@@ -1,10 +1,11 @@
 package storage
 
 import (
-	"encoding/json"
 	"fmt"
 	"strings"
 	"sync"
+
+	"github.com/goccy/go-json"
 )
 
 // Row represents a database row.