Documentation
¶
Index ¶
- func AlterTableAddColStmt(tableName string, newColDef string) string
- func AlterTableAddForeignKeyStmt(fk doltdb.ForeignKey, sch, parentSch schema.Schema) string
- func AlterTableAddIndexStmt(tableName string, idx schema.Index) string
- func AlterTableAddPrimaryKeys(tableName string, pks *schema.ColCollection) string
- func AlterTableDropColStmt(tableName string, oldColName string) string
- func AlterTableDropForeignKeyStmt(fk doltdb.ForeignKey) string
- func AlterTableDropIndexStmt(tableName string, idx schema.Index) string
- func AlterTableDropPks(tableName string) string
- func AlterTableModifyColStmt(tableName string, newColDef string) string
- func AlterTableRenameColStmt(tableName string, oldColName string, newColName string) string
- func DropTableIfExistsStmt(tableName string) string
- func DropTableStmt(tableName string) string
- func FmtCol(indent, nameWidth, typeWidth int, col schema.Column) string
- func FmtColPrimaryKey(indent int, colStr string, newline bool) string
- func FmtColWithNameAndType(indent, nameWidth, typeWidth int, colName, typeStr string, col schema.Column) string
- func FmtForeignKey(fk doltdb.ForeignKey, sch, parentSch schema.Schema) string
- func FmtIndex(index schema.Index) string
- func InsertStatementPrefix(tableName string, tableSch schema.Schema) (string, error)
- func QuoteComment(s string) string
- func QuoteIdentifier(s string) string
- func RenameTableStmt(fromName string, toName string) string
- func RowAsDeleteStmt(r row.Row, tableName string, tableSch schema.Schema) (string, error)
- func RowAsInsertStmt(r row.Row, tableName string, tableSch schema.Schema) (string, error)
- func RowAsTupleString(ctx context.Context, r row.Row, tableSch schema.Schema) (string, error)
- func RowAsUpdateStmt(r row.Row, tableName string, tableSch schema.Schema, colDiffs *set.StrSet) (string, error)
- func SqlRowAsCreateFragStmt(r sql.Row) (string, error)
- func SqlRowAsCreateProcStmt(r sql.Row) (string, error)
- func SqlRowAsInsertStmt(ctx context.Context, r sql.Row, tableName string, tableSch schema.Schema) (string, error)
- func SqlRowAsTupleString(ctx context.Context, r sql.Row, tableSch schema.Schema) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlterTableAddColStmt ¶
func AlterTableAddForeignKeyStmt ¶
func AlterTableAddForeignKeyStmt(fk doltdb.ForeignKey, sch, parentSch schema.Schema) string
func AlterTableAddIndexStmt ¶
func AlterTableAddPrimaryKeys ¶
func AlterTableAddPrimaryKeys(tableName string, pks *schema.ColCollection) string
func AlterTableDropColStmt ¶
func AlterTableDropForeignKeyStmt ¶
func AlterTableDropForeignKeyStmt(fk doltdb.ForeignKey) string
func AlterTableDropIndexStmt ¶
func AlterTableDropPks ¶
func AlterTableModifyColStmt ¶
func AlterTableRenameColStmt ¶
func DropTableIfExistsStmt ¶
func DropTableStmt ¶
func FmtCol ¶
FmtCol converts a column to a string with a given indent space count, name width, and type width. If nameWidth or
typeWidth are 0 or less than the length of the name or type, then the length of the name or type will be used
func FmtColPrimaryKey ¶
FmtColPrimaryKey creates a string representing a primary key constraint within a sql create table statement with a given indent.
func FmtColWithNameAndType ¶
func FmtColWithNameAndType(indent, nameWidth, typeWidth int, colName, typeStr string, col schema.Column) string
FmtColWithNameAndType creates a string representing a column within a sql create table statement with a given indent space count, name width, and type width. If nameWidth or typeWidth are 0 or less than the length of the name or type, then the length of the name or type will be used.
func FmtForeignKey ¶
func FmtForeignKey(fk doltdb.ForeignKey, sch, parentSch schema.Schema) string
func InsertStatementPrefix ¶
InsertStatementPrefix returns the first part of an SQL insert query for a given table
func QuoteComment ¶
QuoteComment quotes the given string with apostrophes, and escapes any contained within the string.
func QuoteIdentifier ¶
Quotes the identifier given with backticks.
func RenameTableStmt ¶
func RowAsDeleteStmt ¶
func RowAsInsertStmt ¶
func RowAsTupleString ¶
RowAsTupleString converts a row into it's tuple string representation for SQL insert statements.
func RowAsUpdateStmt ¶
func SqlRowAsCreateFragStmt ¶
SqlRowAsCreateFragStmt Converts a Row into either a CREATE TRIGGER or CREATE VIEW statement This function expects a row from the dolt_schemas table
func SqlRowAsCreateProcStmt ¶
SqlRowAsCreateProcStmt Converts a Row into either a CREATE PROCEDURE statement This function expects a row from the dolt_procedures table.
func SqlRowAsInsertStmt ¶
Types ¶
This section is empty.