interfaces.go 601 B

123456789101112131415161718192021
  1. package gorm
  2. import (
  3. "context"
  4. "database/sql"
  5. )
  6. // Dialector GORM database dialector
  7. type Dialector interface {
  8. Initialize(*DB) error
  9. Migrator() Migrator
  10. BindVar(stmt Statement, v interface{}) string
  11. }
  12. // CommonDB common db interface
  13. type CommonDB interface {
  14. ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
  15. PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
  16. QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
  17. QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
  18. }