MCPcopy Create free account
hub / github.com/bytebase/bytebase / convertForeignKeyActionCode

Function convertForeignKeyActionCode

backend/plugin/db/redshift/sync.go:197–212  ·  view source on GitHub ↗
(in string)

Source from the content-addressed store, hash-verified

195}
196
197func convertForeignKeyActionCode(in string) string {
198 switch in {
199 case "a":
200 return "NO ACTION"
201 case "r":
202 return "RESTRICT"
203 case "c":
204 return "CASCADE"
205 case "n":
206 return "SET NULL"
207 case "d":
208 return "SET DEFAULT"
209 default:
210 return in
211 }
212}
213
214func getForeignKeyColumnsAndReferencedColumns(definition string) ([]string, []string, error) {
215 columnsRegexp := regexp.MustCompile(`FOREIGN KEY \((.*)\) REFERENCES (.*)\((.*)\)`)

Callers 1

getForeignKeysFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected