public async Task RunAsync(FileOptions options) { logger.LogInformation("Executing {sqlFile} ...", Path.GetFullPath(options.InputSqlFile)); sqlCommandAdapter.ExecuteSqlCommand(); logger.LogDebug("Reading SQL schema ..."); RelationalModel model = relationalModelReader.ReadRelationalModel(); if (!model.Tables.Any()) { logger.LogWarning("No tables were found ..."); return; } logger.LogDebug("Running Annotation Combiner ..."); annotationCombiner.ReadAnnotationsAndCombineWithModel(model); logger.LogDebug("Generating CDM folder ..."); CdmManifestDefinition manifest = await cdmGenerator.GenerateCdmAsync(model); logger.LogInformation("Saving CDM folder at {cdmOutput}...", Path.GetFullPath(options.OutputCdmFolder)); await manifest.SaveAsync(); logger.LogInformation("Success!"); }
public async Task CdmManifestDefinitionIsNotNull() { CdmGenerator generator = CreateCdmGenerator(); var model = new RelationalModel(); CdmManifestDefinition manifest = await generator.GenerateCdmAsync(model); Assert.NotNull(manifest); }
public async Task CdmManifestDefinitionWithEmptyTablesContainsEmptyEntitiesAndRelationships() { CdmGenerator generator = CreateCdmGenerator(); var model = new RelationalModel(); CdmManifestDefinition manifest = await generator.GenerateCdmAsync(model); Assert.Empty(manifest.Entities); Assert.Empty(manifest.Relationships); }