Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Apr 21, 2024
1 parent 4fa9cc6 commit 7863f54
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions internal/dialect/dialectquery/dialectquery.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
package dialectquery

// Querier is the interface that wraps the basic methods to create a dialect
// specific query.
// Querier is the interface that wraps the basic methods to create a dialect specific query.
type Querier interface {
// CreateTable returns the SQL query string to create the db version table.
CreateTable(tableName string) string

// InsertVersion returns the SQL query string to insert a new version into
// the db version table.
// InsertVersion returns the SQL query string to insert a new version into the db version table.
InsertVersion(tableName string) string

// DeleteVersion returns the SQL query string to delete a version from
// the db version table.
// DeleteVersion returns the SQL query string to delete a version from the db version table.
DeleteVersion(tableName string) string

// GetMigrationByVersion returns the SQL query string to get a single
// migration by version.
// GetMigrationByVersion returns the SQL query string to get a single migration by version.
//
// The query should return the timestamp and is_applied columns.
GetMigrationByVersion(tableName string) string

// ListMigrations returns the SQL query string to list all migrations in
// descending order by id.
// ListMigrations returns the SQL query string to list all migrations in descending order by id.
//
// The query should return the version_id and is_applied columns.
ListMigrations(tableName string) string
Expand All @@ -38,6 +33,10 @@ func NewQueryController(querier Querier) *QueryController {

// Optional methods

// TableExists returns the SQL query string to check if the version table exists. If the Querier
// does not implement this method, it will return an empty string.
//
// The query should return a boolean value.
func (c *QueryController) TableExists(tableName string) string {
if t, ok := c.querier.(interface {
TableExists(string) string
Expand Down

0 comments on commit 7863f54

Please sign in to comment.