(schemaName string)
| 270 | } |
| 271 | |
| 272 | func (d *DatabaseMetadata) CreateSchema(schemaName string) *SchemaMetadata { |
| 273 | // Create new schema proto |
| 274 | newSchemaProto := &storepb.SchemaMetadata{ |
| 275 | Name: schemaName, |
| 276 | Tables: []*storepb.TableMetadata{}, |
| 277 | Views: []*storepb.ViewMetadata{}, |
| 278 | } |
| 279 | |
| 280 | // Add to proto's schema list |
| 281 | d.proto.Schemas = append(d.proto.Schemas, newSchemaProto) |
| 282 | |
| 283 | // Create SchemaMetadata wrapper |
| 284 | schemaMeta := &SchemaMetadata{ |
| 285 | isObjectCaseSensitive: d.isObjectCaseSensitive, |
| 286 | isDetailCaseSensitive: d.isDetailCaseSensitive, |
| 287 | internalTables: make(map[string]*TableMetadata), |
| 288 | internalExternalTable: make(map[string]*ExternalTableMetadata), |
| 289 | internalViews: make(map[string]*storepb.ViewMetadata), |
| 290 | internalMaterializedView: make(map[string]*storepb.MaterializedViewMetadata), |
| 291 | internalProcedures: make(map[string]*storepb.ProcedureMetadata), |
| 292 | internalPackages: make(map[string]*storepb.PackageMetadata), |
| 293 | internalSequences: make(map[string]*storepb.SequenceMetadata), |
| 294 | proto: newSchemaProto, |
| 295 | } |
| 296 | |
| 297 | // Add to internal map |
| 298 | schemaID := normalizeNameByCaseSensitivity(schemaName, d.isObjectCaseSensitive) |
| 299 | d.internal[schemaID] = schemaMeta |
| 300 | |
| 301 | return schemaMeta |
| 302 | } |
| 303 | |
| 304 | func (d *DatabaseMetadata) DropSchema(schemaName string) error { |
| 305 | // Check if schema exists |
no test coverage detected