support sqlite3

This commit is contained in:
tangpanqing
2022-12-23 12:34:37 +08:00
parent fccbc17ada
commit ba576f26ae
2 changed files with 42 additions and 15 deletions

View File

@@ -306,7 +306,10 @@ func (ex *Builder) Delete() (int64, error) {
// Truncate 清空记录, sqlte3不支持此操作
func (ex *Builder) Truncate() (int64, error) {
sqlStr := "TRUNCATE TABLE " + ex.tableName
sqlStr := "TRUNCATE TABLE " + ex.tableName
if ex.driverName == "sqlite3" {
sqlStr = "DELETE FROM " + ex.tableName
}
return ex.ExecAffected(sqlStr)
}