{"modulePath":"github.com/sunary/sqlize","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package element\n\n## Constants\n\n```go\nconst (\n\t// UppercaseRestoreFlag ...\n\tUppercaseRestoreFlag = format.RestoreStringSingleQuotes | format.RestoreKeyWordUppercase | format.RestoreNameUppercase | format.RestoreNameBackQuotes\n\t// LowerRestoreFlag ...\n\tLowerRestoreFlag = format.RestoreStringSingleQuotes | format.RestoreKeyWordLowercase | format.RestoreNameLowercase | format.RestoreNameBackQuotes\n)\n```\n\n## Types\n\n```go\ntype Column struct {\n\tNode\n\n\tCurrentAttr  SqlAttr\n\tPreviousAttr SqlAttr\n}\n```\nColumn ...\n\n```go\nfunc (c Column) Constraint() string\n```\nConstraint ...\n\n```go\nfunc (c Column) DataType() string\n```\nDataType ...\n\n```go\nfunc (c Column) GetType() byte\n```\nGetType ...\n\n```go\nfunc (c Column) HasDefaultValue() bool\n```\nHasDefaultValue ...\n\n```go\ntype ForeignKey struct {\n\tNode\n\tTable      string\n\tColumn     string\n\tRefTable   string\n\tRefColumn  string\n\tConstraint string\n}\n```\nForeignKey ...\n\n```go\ntype Index struct {\n\tNode\n\tTyp       ast.IndexKeyType\n\tIndexType ast.IndexType\n\tCnsTyp    ast.ConstraintType\n\tColumns   []string\n}\n```\nIndex ...\n\n```go\ntype MigrateAction int8\n```\nMigrateAction ...\n\n```go\nconst (\n\t// MigrateNoAction ...\n\tMigrateNoAction MigrateAction = iota\n\t// MigrateAddAction ...\n\tMigrateAddAction\n\t// MigrateRemoveAction ...\n\tMigrateRemoveAction\n\t// MigrateModifyAction ...\n\tMigrateModifyAction\n\t// MigrateRevertAction ...\n\tMigrateRevertAction\n\t// MigrateRenameAction ...\n\tMigrateRenameAction\n)\n```\n\n```go\ntype Migration struct {\n\tTables []Table\n\t// contains filtered or unexported fields\n}\n```\nMigration ...\n\n```go\nfunc NewMigration(dialect sqltemplates.SqlDialect, lowercase, ignoreOrder bool) Migration\n```\nNewMigration ...\n\n```go\nfunc (m *Migration) AddColumn(tbName string, col Column)\n```\nAddColumn ...\n\n```go\nfunc (m *Migration) AddComment(tbName, colName, comment string)\n```\nAddIndex ...\n\n```go\nfunc (m *Migration) AddForeignKey(tbName string, fk ForeignKey)\n```\nAddForeignKey ...\n\n```go\nfunc (m *Migration) AddIndex(tbName string, idx Index)\n```\nAddIndex ...\n\n```go\nfunc (m *Migration) AddTable(tb Table)\n```\nAddTable ...\n\n```go\nfunc (m *Migration) Diff(old Migration)\n```\nDiff differ between 2 migrations\n\n```go\nfunc (m Migration) HashValue() int64\n```\nHashValue ...\n\n```go\nfunc (m Migration) MigrationDown() string\n```\nMigrationDown ...\n\n```go\nfunc (m Migration) MigrationUp() string\n```\nMigrationUp ...\n\n```go\nfunc (m *Migration) RemoveColumn(tbName, colName string)\n```\nRemoveColumn ...\n\n```go\nfunc (m *Migration) RemoveForeignKey(tbName, fkName string)\n```\nRemoveForeignKey ...\n\n```go\nfunc (m *Migration) RemoveIndex(tbName, idxName string)\n```\nRemoveIndex ...\n\n```go\nfunc (m *Migration) RemoveTable(tbName string)\n```\nRemoveTable ...\n\n```go\nfunc (m *Migration) RenameColumn(tbName, oldName, newName string)\n```\nRenameColumn ...\n\n```go\nfunc (m *Migration) RenameIndex(tbName, oldName, newName string)\n```\nRenameIndex ...\n\n```go\nfunc (m *Migration) RenameTable(oldName, newName string)\n```\nRenameTable ...\n\n```go\nfunc (m *Migration) SetColumnPosition(tbName string, pos *ast.ColumnPosition)\n```\nSetColumnPosition ...\n\n```go\nfunc (m *Migration) Using(tbName string)\n```\nUsing set current table\n\n```go\ntype Node struct {\n\tName    string\n\tOldName string\n\tAction  MigrateAction\n}\n```\nNode primitive element\n\n```go\ntype SqlAttr struct {\n\tMysqlType *types.FieldType\n\tPgType    *ptypes.T\n\tLiteType  *sqlite.Type\n\tOptions   []*ast.ColumnOption\n\tComment   string\n}\n```\n\n```go\ntype Table struct {\n\tNode\n\n\tColumns []Column\n\n\tIndexes []Index\n\n\tForeignKeys []ForeignKey\n\t// contains filtered or unexported fields\n}\n```\nTable ...\n\n```go\nfunc NewTable(name string) *Table\n```\nNewTable ...\n\n```go\nfunc NewTableWithAction(name string, action MigrateAction) *Table\n```\nNewTableWithAction ...\n\n```go\nfunc (t *Table) AddColumn(col Column)\n```\nAddColumn ...\n\n```go\nfunc (t *Table) AddForeignKey(fk ForeignKey)\n```\nAddForeignKey ...\n\n```go\nfunc (t *Table) AddIndex(idx Index)\n```\nAddIndex ...\n\n```go\nfunc (t *Table) Arrange()\n```\nArrange correct column order\n\n```go\nfunc (t *Table) Diff(old Table)\n```\nDiff differ between 2 migrations\n\n```go\nfunc (t Table) MigrationColumnDown() ([]string, map[string]struct{})\n```\nMigrationColumnDown ...\n\n```go\nfunc (t Table) MigrationColumnUp() ([]string, map[string]struct{})\n```\nMigrationColumnUp ...\n\n```go\nfunc (t Table) MigrationForeignKeyDown(dropCols map[string]struct{}) []string\n```\nMigrationForeignKeyDown ...\n\n```go\nfunc (t Table) MigrationForeignKeyUp(dropCols map[string]struct{}) []string\n```\nMigrationForeignKeyUp ...\n\n```go\nfunc (t Table) MigrationIndexDown(dropCols map[string]struct{}) []string\n```\nMigrationIndexDown ...\n\n```go\nfunc (t Table) MigrationIndexUp(dropCols map[string]struct{}) []string\n```\nMigrationIndexUp ...\n\n```go\nfunc (t *Table) RemoveForeignKey(fkName string)\n```\nRemoveForeignKey ...\n\n```go\nfunc (t *Table) RemoveIndex(idxName string)\n```\nRemoveIndex ...\n\n```go\nfunc (t *Table) RenameColumn(oldName, newName string)\n```\nRenameColumn ...\n\n```go\nfunc (t *Table) RenameIndex(oldName, newName string)\n```\nRenameIndex ...\n\n","path":"github.com/sunary/sqlize/element","name":"element","synopsis":"","isRedistributable":true}
