优化结构

This commit is contained in:
Yvan
2026-08-28 00:29:40 +08:00
parent 04ff85116c
commit 03a4131f6e
118 changed files with 758 additions and 834 deletions
+18
View File
@@ -0,0 +1,18 @@
package system
import "testing"
func TestExportQueryValueUsesDatabaseType(t *testing.T) {
if value := exportQueryValue([]byte("42"), "VARCHAR"); value != "42" {
t.Fatalf("text value = %#v, want string 42", value)
}
if value, ok := exportQueryValue([]byte("42"), "BIGINT").(int64); !ok || value != 42 {
t.Fatalf("integer value = %#v", exportQueryValue([]byte("42"), "BIGINT"))
}
if value, ok := exportQueryValue([]byte("12.5"), "DECIMAL").(float64); !ok || value != 12.5 {
t.Fatalf("decimal value = %#v", exportQueryValue([]byte("12.5"), "DECIMAL"))
}
if value, ok := exportQueryValue([]byte("1234567890123456.78"), "DECIMAL").(string); !ok || value != "1234567890123456.78" {
t.Fatalf("high-precision decimal value = %#v", exportQueryValue([]byte("1234567890123456.78"), "DECIMAL"))
}
}