MCPcopy Index your code
hub / github.com/rubenv/sql-migrate / parseCommand

Function parseCommand

sqlparse/sqlparse.go:82–99  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

80}
81
82func parseCommand(line string) (*migrateCommand, error) {
83 cmd := &migrateCommand{}
84
85 if !strings.HasPrefix(line, sqlCmdPrefix) {
86 return nil, fmt.Errorf("ERROR: not a sql-migrate command")
87 }
88
89 fields := strings.Fields(line[len(sqlCmdPrefix):])
90 if len(fields) == 0 {
91 return nil, fmt.Errorf(`ERROR: incomplete migration command`)
92 }
93
94 cmd.Command = fields[0]
95
96 cmd.Options = fields[1:]
97
98 return cmd, nil
99}
100
101// Split the given sql script into individual statements.
102//

Callers 1

ParseMigrationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…