Documentation ¶
Index ¶
- func ExtractAlterTableAddColComment(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableAddColName(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableAddColType(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableChangeColComment(spec *ast.AlterTableSpec) string
- func ExtractAlterTableChangeColNewName(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableChangeColOldName(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableChangeColType(spec *ast.AlterTableSpec) string
- func ExtractAlterTableDropColName(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableModifyColComment(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableModifyColName(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableModifyColType(stmt *ast.AlterTableSpec) string
- func ExtractAlterTableName(stmt *ast.AlterTableStmt) string
- func ExtractColComment(col *ast.ColumnDef) string
- func ExtractColName(col *ast.ColumnDef) string
- func ExtractColType(col *ast.ColumnDef) string
- func ExtractCreateName(stmt *ast.CreateTableStmt) string
- func ExtractDropNames(stmt *ast.DropTableStmt) []string
- func ExtractRename(stmt *ast.RenameTableStmt) (newName, oldName string)
- type Components
- type DDLConverter
- func (o *DDLConverter) Enter(in ast.Node) (ast.Node, bool)
- func (o *DDLConverter) JSON() []byte
- func (o *DDLConverter) Leave(in ast.Node) (ast.Node, bool)
- func (o *DDLConverter) Write(sql []byte) (int, error)
- func (o *DDLConverter) WriteString(sql string) (int, error)
- func (o *DDLConverter) YAML() []byte
- type OpenapiSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAlterTableAddColComment ¶
func ExtractAlterTableAddColComment(stmt *ast.AlterTableSpec) string
func ExtractAlterTableAddColName ¶
func ExtractAlterTableAddColName(stmt *ast.AlterTableSpec) string
func ExtractAlterTableAddColType ¶
func ExtractAlterTableAddColType(stmt *ast.AlterTableSpec) string
func ExtractAlterTableChangeColComment ¶
func ExtractAlterTableChangeColComment(spec *ast.AlterTableSpec) string
func ExtractAlterTableChangeColNewName ¶
func ExtractAlterTableChangeColNewName(stmt *ast.AlterTableSpec) string
func ExtractAlterTableChangeColOldName ¶
func ExtractAlterTableChangeColOldName(stmt *ast.AlterTableSpec) string
func ExtractAlterTableChangeColType ¶
func ExtractAlterTableChangeColType(spec *ast.AlterTableSpec) string
func ExtractAlterTableDropColName ¶
func ExtractAlterTableDropColName(stmt *ast.AlterTableSpec) string
func ExtractAlterTableModifyColComment ¶
func ExtractAlterTableModifyColComment(stmt *ast.AlterTableSpec) string
func ExtractAlterTableModifyColName ¶
func ExtractAlterTableModifyColName(stmt *ast.AlterTableSpec) string
func ExtractAlterTableModifyColType ¶
func ExtractAlterTableModifyColType(stmt *ast.AlterTableSpec) string
func ExtractAlterTableName ¶
func ExtractAlterTableName(stmt *ast.AlterTableStmt) string
func ExtractColComment ¶
func ExtractColName ¶
func ExtractColType ¶
func ExtractCreateName ¶
func ExtractCreateName(stmt *ast.CreateTableStmt) string
func ExtractDropNames ¶
func ExtractDropNames(stmt *ast.DropTableStmt) []string
func ExtractRename ¶
func ExtractRename(stmt *ast.RenameTableStmt) (newName, oldName string)
Types ¶
type Components ¶
type Components struct {
Schemas map[string]OpenapiSchema `json:"schemas" yaml:"schemas"`
}
type DDLConverter ¶
type DDLConverter struct { Openapi string `json:"openapi" yaml:"openapi"` Info map[string]string `json:"info" yaml:"info"` Paths struct{} `json:"paths" yaml:"paths"` Components Components `json:"components" yaml:"components"` }
func New ¶
func New(sql ...string) (*DDLConverter, error)
func (*DDLConverter) JSON ¶
func (o *DDLConverter) JSON() []byte
func (*DDLConverter) WriteString ¶
func (o *DDLConverter) WriteString(sql string) (int, error)
func (*DDLConverter) YAML ¶
func (o *DDLConverter) YAML() []byte
type OpenapiSchema ¶
Click to show internal directories.
Click to hide internal directories.