validateSchemaForCreate returns an error if a schema with the name given cannot be created
(existingSchemas []schema.DatabaseSchema, dbSchema schema.DatabaseSchema)
| 139 | |
| 140 | // validateSchemaForCreate returns an error if a schema with the name given cannot be created |
| 141 | func validateSchemaForCreate(existingSchemas []schema.DatabaseSchema, dbSchema schema.DatabaseSchema) error { |
| 142 | if dbSchema.Name == "" { |
| 143 | return errors.New("Schema name cannot be empty") |
| 144 | } |
| 145 | |
| 146 | for _, s := range existingSchemas { |
| 147 | if strings.EqualFold(s.Name, dbSchema.Name) { |
| 148 | return errors.Errorf("A schema with the name %s already exists", dbSchema.Name) |
| 149 | } |
| 150 | } |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | func (root *RootValue) TableListHash() uint64 { |
| 155 | return 0 |
no test coverage detected