github.com/Accefy/pop@v0.0.0-20230428174248-e9f677eab5b9/dialect.go (about)

     1  package pop
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/gobuffalo/fizz"
     7  	"github.com/gobuffalo/pop/v6/columns"
     8  )
     9  
    10  type crudable interface {
    11  	SelectOne(*Connection, *Model, Query) error
    12  	SelectMany(*Connection, *Model, Query) error
    13  	Create(*Connection, *Model, columns.Columns) error
    14  	Update(*Connection, *Model, columns.Columns) error
    15  	UpdateQuery(*Connection, *Model, columns.Columns, Query) (int64, error)
    16  	Destroy(*Connection, *Model) error
    17  	Delete(*Connection, *Model, Query) error
    18  }
    19  
    20  type fizzable interface {
    21  	FizzTranslator() fizz.Translator
    22  }
    23  
    24  type quotable interface {
    25  	Quote(key string) string
    26  }
    27  
    28  type dialect interface {
    29  	crudable
    30  	fizzable
    31  	quotable
    32  	Name() string
    33  	DefaultDriver() string
    34  	URL() string
    35  	MigrationURL() string
    36  	Details() *ConnectionDetails
    37  	TranslateSQL(string) string
    38  	CreateDB() error
    39  	DropDB() error
    40  	DumpSchema(io.Writer) error
    41  	LoadSchema(io.Reader) error
    42  	Lock(func() error) error
    43  	TruncateAll(*Connection) error
    44  }
    45  
    46  type afterOpenable interface {
    47  	AfterOpen(*Connection) error
    48  }