lxd/db/query/dump.go
func dumpParseSchema(schema string) map[string]string {
	tables := map[string]string{}
	for _, statement := range strings.Split(schema, ";") {
		statement = strings.Trim(statement, " \n") + ";"
		if !strings.HasPrefix(statement, "CREATE TABLE") {
			continue
		}
		table := strings.Split(statement, " ")[2]
		tables[table] = statement
	}
	return tables
}
func dumpParseSchema(schema string) map[string]string {
	tables := map[string]string{}
	for _, statement := range strings.Split(schema, ";") {
		statement = strings.Trim(statement, " \n") + ";"
		if !strings.HasPrefix(statement, "CREATE TABLE") {
			continue
		}
		table := strings.Split(statement, " ")[2]
		tables[table] = statement
	}
	return tables
}
func dumpParseSchema ( schema string ) map [ string ] string { tables := map [ string ] string { } for _ , statement := range strings . Split ( schema , " " ) { statement = strings . Trim ( statement , " \n " ) + " " if ! strings . HasPrefix ( statement , " " ) { continue } table := strings . Split ( statement , " " ) [ 2 ] tables [ table ] = statement } return tables }
// Return a map from table names to their schema definition, taking a full
// schema SQL text generated with schema.Schema.Dump().
Return a map from table names to their schema definition taking a full schema SQL text generated with schema . Schema . Dump () .