Files
mayfly-go/server/internal/db/dbm/dm/helper.go
meilin.huang e56788af3e refactor: dbm
2024-12-08 13:04:23 +08:00

23 lines
455 B
Go

package dm
import (
"fmt"
"io"
"mayfly-go/internal/db/dbm/dbi"
)
type DumpHelper struct {
}
func (dh *DumpHelper) BeforeInsert(writer io.Writer, tableName string) {
}
func (dh *DumpHelper) BeforeInsertSql(quoteSchema string, tableName string) string {
return fmt.Sprintf("set identity_insert %s on;", tableName)
}
func (dh *DumpHelper) AfterInsert(writer io.Writer, tableName string, columns []dbi.Column) {
writer.Write([]byte("COMMIT;\n"))
}