mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-16 11:54:08 +08:00
- SQL、CSV、JSON 与 XLSX 改为资源受限的流式解析,并支持压缩、编码和方言预检 - 增加遇错停止/继续策略、持久任务、错误行导出、源文件身份与安全取消 - 为数据库驱动补齐上下文事务和写入结果未知语义,避免失败重放与脏会话复用
23 lines
782 B
Go
23 lines
782 B
Go
//go:build gonavi_full_drivers || gonavi_mariadb_driver
|
|
|
|
package db
|
|
|
|
import "testing"
|
|
|
|
func TestMariaDBBatchWriteCapabilityReflectsNegotiatedDSN(t *testing.T) {
|
|
mariaDB := &MariaDB{}
|
|
if _, ok := any(mariaDB).(BatchWriteCapability); !ok {
|
|
t.Fatal("MariaDB must expose runtime batch-write capability")
|
|
}
|
|
|
|
mariaDB.batchWritesEnabled = mysqlDSNSupportsBatchWrites("user:pass@tcp(localhost:3306)/app?multiStatements=true")
|
|
if !mariaDB.SupportsBatchWrites() {
|
|
t.Fatal("multiStatements=true MariaDB connection should allow batch writes")
|
|
}
|
|
|
|
mariaDB.batchWritesEnabled = mysqlDSNSupportsBatchWrites("user:pass@tcp(localhost:3306)/app?multiStatements=false")
|
|
if mariaDB.SupportsBatchWrites() {
|
|
t.Fatal("multiStatements=false MariaDB connection must disable batch writes")
|
|
}
|
|
}
|