MetadataToSDL converts database metadata to SDL text using the registered GetDatabaseDefinition.
(engine storepb.Engine, meta *model.DatabaseMetadata)
| 333 | |
| 334 | // MetadataToSDL converts database metadata to SDL text using the registered GetDatabaseDefinition. |
| 335 | func MetadataToSDL(engine storepb.Engine, meta *model.DatabaseMetadata) (string, error) { |
| 336 | if meta == nil { |
| 337 | return "", nil |
| 338 | } |
| 339 | proto := meta.GetProto() |
| 340 | if proto == nil { |
| 341 | return "", nil |
| 342 | } |
| 343 | return GetDatabaseDefinition(engine, GetDefinitionContext{ |
| 344 | SkipBackupSchema: true, |
| 345 | SDLFormat: true, |
| 346 | }, proto) |
| 347 | } |
| 348 | |
| 349 | func RegisterDiffSDLMigration(engine storepb.Engine, f diffSDLMigration) { |
| 350 | mux.Lock() |