From 2fc9d4016c8d72f3b9ab44cbd734b659fb5c00b7 Mon Sep 17 00:00:00 2001 From: black-eagle17 Date: Fri, 27 Aug 2021 16:39:41 -0400 Subject: [PATCH] modified RunPlatformOptions to print derived manifest data --- yuniql-cli/CommandLineService.cs | 471 +++++++++--------- yuniql-cli/ManifestData.cs | 12 - yuniql-extensibility/IDataService.cs | 75 +-- yuniql-extensibility/ManifestData.cs | 12 + yuniql-platforms/mysql/MySqlDataService.cs | 211 ++++---- .../postgresql/PostgreSqlDataService.cs | 188 +++---- .../redshift/RedshiftDataService.cs | 16 + .../snowflake/SnowflakeDataService.cs | 13 + .../sqlserver/SqlServerDataService.cs | 13 + 9 files changed, 545 insertions(+), 466 deletions(-) delete mode 100644 yuniql-cli/ManifestData.cs diff --git a/yuniql-cli/CommandLineService.cs b/yuniql-cli/CommandLineService.cs index 4bc3263..59f05d0 100644 --- a/yuniql-cli/CommandLineService.cs +++ b/yuniql-cli/CommandLineService.cs @@ -1,31 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using Yuniql.Core; +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using Yuniql.Core; using Yuniql.Extensibility; -namespace Yuniql.CLI -{ - public class CommandLineService : ICommandLineService - { +namespace Yuniql.CLI +{ + public class CommandLineService : ICommandLineService + { private IMigrationServiceFactory _migrationServiceFactory; private readonly IDataServiceFactory _dataServiceFactory; - private readonly IWorkspaceService _workspaceService; - private readonly IEnvironmentService _environmentService; + private readonly IWorkspaceService _workspaceService; + private readonly IEnvironmentService _environmentService; private ITraceService _traceService; private readonly IConfigurationService _configurationService; - public CommandLineService( - IMigrationServiceFactory migrationServiceFactory, - IDataServiceFactory dataServiceFactory, - IWorkspaceService workspaceService, - IEnvironmentService environmentService, - ITraceService traceService, - IConfigurationService configurationService) - { - this._workspaceService = workspaceService; - this._environmentService = environmentService; + public CommandLineService( + IMigrationServiceFactory migrationServiceFactory, + IDataServiceFactory dataServiceFactory, + IWorkspaceService workspaceService, + IEnvironmentService environmentService, + ITraceService traceService, + IConfigurationService configurationService) + { + this._workspaceService = workspaceService; + this._environmentService = environmentService; this._traceService = traceService; this._configurationService = configurationService; this._migrationServiceFactory = migrationServiceFactory; @@ -64,13 +64,13 @@ private Configuration SetupRunConfiguration(BaseRunPlatformOption opts, bool isV configuration.AppliedByToolVersion = this.GetType().Assembly.GetName().Version.ToString(); return configuration; - } + } public int RunCheckOption(CheckOption opts) { //run the migration string connectionString = _configurationService.GetValueOrDefault(opts.ConnectionString, ENVIRONMENT_VARIABLE.YUNIQL_CONNECTION_STRING); ; - string platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); + string platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); try { @@ -86,106 +86,106 @@ public int RunCheckOption(CheckOption opts) } return 0; - } - - public int RunInitOption(InitOption opts) - { - try - { + } + + public int RunInitOption(InitOption opts) + { + try + { opts.Workspace = _configurationService.GetValueOrDefault(opts.Workspace, ENVIRONMENT_VARIABLE.YUNIQL_WORKSPACE, defaultValue: _environmentService.GetCurrentDirectory()); _workspaceService.Init(opts.Workspace); - _traceService.Success($"Initialized {opts.Workspace}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute init function", opts.IsDebug); - } - } - - public int RunNextVersionOption(NextVersionOption opts) - { - try - { - opts.Workspace = _configurationService.GetValueOrDefault(opts.Workspace, ENVIRONMENT_VARIABLE.YUNIQL_WORKSPACE, defaultValue: _environmentService.GetCurrentDirectory()); - if (opts.IncrementMajorVersion) - { - var nextVersion = _workspaceService.IncrementMajorVersion(opts.Workspace, opts.File); - _traceService.Success($"New major version created {nextVersion} on {opts.Workspace}."); - } - else if (opts.IncrementMinorVersion || (!opts.IncrementMajorVersion && !opts.IncrementMinorVersion)) - { - var nextVersion = _workspaceService.IncrementMinorVersion(opts.Workspace, opts.File); - _traceService.Success($"New minor version created {nextVersion} on {opts.Workspace}."); + _traceService.Success($"Initialized {opts.Workspace}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute init function", opts.IsDebug); + } + } + + public int RunNextVersionOption(NextVersionOption opts) + { + try + { + opts.Workspace = _configurationService.GetValueOrDefault(opts.Workspace, ENVIRONMENT_VARIABLE.YUNIQL_WORKSPACE, defaultValue: _environmentService.GetCurrentDirectory()); + if (opts.IncrementMajorVersion) + { + var nextVersion = _workspaceService.IncrementMajorVersion(opts.Workspace, opts.File); + _traceService.Success($"New major version created {nextVersion} on {opts.Workspace}."); + } + else if (opts.IncrementMinorVersion || (!opts.IncrementMajorVersion && !opts.IncrementMinorVersion)) + { + var nextVersion = _workspaceService.IncrementMinorVersion(opts.Workspace, opts.File); + _traceService.Success($"New minor version created {nextVersion} on {opts.Workspace}."); } - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute vnext function", opts.IsDebug); - } + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute vnext function", opts.IsDebug); + } } - - public int RunRunOption(RunOption opts) - { - try - { - //run the migration - var configuration = SetupRunConfiguration(opts, isVerifyOnly: false); - var migrationService = _migrationServiceFactory.Create(configuration.Platform); + + public int RunRunOption(RunOption opts) + { + try + { + //run the migration + var configuration = SetupRunConfiguration(opts, isVerifyOnly: false); + var migrationService = _migrationServiceFactory.Create(configuration.Platform); migrationService.Run(); - - _traceService.Success($"Schema migration completed successfuly on {configuration.Workspace}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute run function", opts.IsDebug); - } + + _traceService.Success($"Schema migration completed successfuly on {configuration.Workspace}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute run function", opts.IsDebug); + } } - public int RunApplyOption(ApplyOption opts) - { - try - { - //run the migration - var configuration = SetupRunConfiguration(opts, isVerifyOnly: false); - var migrationService = _migrationServiceFactory.Create(configuration.Platform); + public int RunApplyOption(ApplyOption opts) + { + try + { + //run the migration + var configuration = SetupRunConfiguration(opts, isVerifyOnly: false); + var migrationService = _migrationServiceFactory.Create(configuration.Platform); migrationService.Run(); - - _traceService.Success($"Schema migration completed successfuly on {configuration.Workspace}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute apply function", opts.IsDebug); - } + + _traceService.Success($"Schema migration completed successfuly on {configuration.Workspace}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute apply function", opts.IsDebug); + } } - public int RunVerifyOption(VerifyOption opts) - { - try - { - //run the migration - var configuration = SetupRunConfiguration(opts, isVerifyOnly: true); - var migrationService = _migrationServiceFactory.Create(configuration.Platform); + public int RunVerifyOption(VerifyOption opts) + { + try + { + //run the migration + var configuration = SetupRunConfiguration(opts, isVerifyOnly: true); + var migrationService = _migrationServiceFactory.Create(configuration.Platform); migrationService.Run(); - _traceService.Success($"Schema migration verification completed successfuly on {configuration.Workspace}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute verification function. Target database will be rolled back to its previous state", opts.IsDebug); - } - } - - public int RunListOption(ListOption opts) - { - try + _traceService.Success($"Schema migration verification completed successfuly on {configuration.Workspace}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute verification function. Target database will be rolled back to its previous state", opts.IsDebug); + } + } + + public int RunListOption(ListOption opts) + { + try { - var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); + var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); var configuration = Configuration.Instance; configuration.Workspace = opts.Workspace; @@ -193,13 +193,13 @@ public int RunListOption(ListOption opts) configuration.Platform = platform; configuration.ConnectionString = opts.ConnectionString; - configuration.CommandTimeout = opts.CommandTimeout; + configuration.CommandTimeout = opts.CommandTimeout; configuration.MetaSchemaName = opts.MetaSchema; configuration.MetaTableName = opts.MetaTable; - - //get all exsiting db versions - var migrationService = _migrationServiceFactory.Create(configuration.Platform); + + //get all exsiting db versions + var migrationService = _migrationServiceFactory.Create(configuration.Platform); var versions = migrationService.GetAllVersions(configuration.MetaSchemaName, configuration.MetaTableName); //TODO: add duration @@ -220,22 +220,22 @@ public int RunListOption(ListOption opts) } _traceService.Success($"Listed all schema versions applied to database on {configuration.Workspace} workspace.{Environment.NewLine}" + - $"For platforms not supporting full transactional DDL operations (ex. MySql, Snowflake, CockroachDB), unsuccessful migrations will show the status as Failed and you can look for FailedScriptPath and FailedScriptError in the schema version tracking table."); - - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute list function", opts.IsDebug); - } - } - - public int RunEraseOption(EraseOption opts) - { - try - { - //parse tokens - var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); + $"For platforms not supporting full transactional DDL operations (ex. MySql, Snowflake, CockroachDB), unsuccessful migrations will show the status as Failed and you can look for FailedScriptPath and FailedScriptError in the schema version tracking table."); + + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute list function", opts.IsDebug); + } + } + + public int RunEraseOption(EraseOption opts) + { + try + { + //parse tokens + var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); var tokens = opts.Tokens.Select(t => new KeyValuePair(t.Split("=")[0], t.Split("=")[1])).ToList(); var configuration = Configuration.Instance; @@ -250,25 +250,25 @@ public int RunEraseOption(EraseOption opts) configuration.IsForced = opts.Force; configuration.Environment = opts.Environment; - //run all erase scripts - var migrationService = _migrationServiceFactory.Create(platform); + //run all erase scripts + var migrationService = _migrationServiceFactory.Create(platform); migrationService.Erase(); - _traceService.Success($"Schema erase completed successfuly on {configuration.Workspace}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute erase function", opts.IsDebug); - } + _traceService.Success($"Schema erase completed successfuly on {configuration.Workspace}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute erase function", opts.IsDebug); + } } - public int RunDestroyOption(DestroyOption opts) - { - try - { - //parse tokens - var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); + public int RunDestroyOption(DestroyOption opts) + { + try + { + //parse tokens + var platform = _configurationService.GetValueOrDefault(opts.Platform, ENVIRONMENT_VARIABLE.YUNIQL_PLATFORM, defaultValue: SUPPORTED_DATABASES.SQLSERVER); var connectionString = _configurationService.GetValueOrDefault(opts.ConnectionString, ENVIRONMENT_VARIABLE.YUNIQL_CONNECTION_STRING); var configuration = Configuration.Instance; @@ -281,65 +281,70 @@ public int RunDestroyOption(DestroyOption opts) configuration.IsForced = opts.Force; - var dataService = _dataServiceFactory.Create(platform); - dataService.Initialize(configuration.ConnectionString); - var connectionInfo = dataService.GetConnectionInfo(); + var dataService = _dataServiceFactory.Create(platform); + dataService.Initialize(configuration.ConnectionString); + var connectionInfo = dataService.GetConnectionInfo(); - //run all erase scripts - var migrationService = _migrationServiceFactory.Create(platform); + //run all erase scripts + var migrationService = _migrationServiceFactory.Create(platform); migrationService.Destroy(); - - _traceService.Success($"Database {connectionInfo.Database} destroyed successfuly from {connectionInfo.DataSource}."); - return 0; - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute destroy function", opts.IsDebug); - } + + _traceService.Success($"Database {connectionInfo.Database} destroyed successfuly from {connectionInfo.DataSource}."); + return 0; + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute destroy function", opts.IsDebug); + } } public int RunPlatformsOption(PlatformsOption opts) { try { - string platforms = @"Supported database platforms and available samples. For specific versions, please refer to latest documentation pages. - - //TODO: show released, preview, alpha, beta - SqlServer | Released: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Usage: yuniql run -a -c --platform sqlserver - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-sqlserver-sample - - PostgreSql | Released: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Usage: yuniql run -a -c --platform postgresql - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-postgresql-sample - - MySql | Released: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Usage: yuniql run -a -c --platform mysql - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-mysql-sample - - MariaDb | Released: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Supported versions: - Usage: yuniql run -a -c --platform mariadb - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-mysql-sample - - Snowflake | Preview: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Supported versions: - Usage: yuniql run -a -c --platform snowflake - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-snowflake-sample - - Redshift| Preview: - Supported versions: https://yuniql.io/docs/supported-platforms/ - Supported versions: - Usage: yuniql run -a -c --platform redshift - Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-redshift-sample -"; + string platforms = @"Supported database platforms and available samples. For specific versions, please refer to latest documentation pages."; + +// //TODO: show released, preview, alpha, beta +// SqlServer | Released: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Usage: yuniql run -a -c --platform sqlserver +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-sqlserver-sample + +// PostgreSql | Released: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Usage: yuniql run -a -c --platform postgresql +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-postgresql-sample + +// MySql | Released: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Usage: yuniql run -a -c --platform mysql +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-mysql-sample + +// MariaDb | Released: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Supported versions: +// Usage: yuniql run -a -c --platform mariadb +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-mysql-sample + +// Snowflake | Preview: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Supported versions: +// Usage: yuniql run -a -c --platform snowflake +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-snowflake-sample + +// Redshift| Preview: +// Supported versions: https://yuniql.io/docs/supported-platforms/ +// Supported versions: +// Usage: yuniql run -a -c --platform redshift +// Samples: https://github.com/rdagumampan/yuniql/tree/master/samples/basic-redshift-sample +// "; Console.WriteLine(platforms); + + var _dataService = _dataServiceFactory.Create("mysql"); + var _manifestData =_dataService.GetManifestData(); + _manifestData.printData(); + return 0; } @@ -347,44 +352,44 @@ public int RunPlatformsOption(PlatformsOption opts) { return OnException(ex, "Failed to execute platforms function", opts.IsDebug); } - } - - public int RunBaselineOption(BaselineOption opts) - { - try - { - throw new NotImplementedException("Not yet implemented, stay tune!"); - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute baseline function", opts.IsDebug); - - } - } - - public int RunRebaseOption(RebaseOption opts) - { - try - { - throw new NotImplementedException("Not yet implemented, stay tune!"); - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute rebase function", opts.IsDebug); - - } - } - - public int RunArchiveOption(ArchiveOption opts) - { - try - { - throw new NotImplementedException("Not yet implemented, stay tune!"); - } - catch (Exception ex) - { - return OnException(ex, "Failed to execute archive function", opts.IsDebug); - } + } + + public int RunBaselineOption(BaselineOption opts) + { + try + { + throw new NotImplementedException("Not yet implemented, stay tune!"); + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute baseline function", opts.IsDebug); + + } + } + + public int RunRebaseOption(RebaseOption opts) + { + try + { + throw new NotImplementedException("Not yet implemented, stay tune!"); + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute rebase function", opts.IsDebug); + + } + } + + public int RunArchiveOption(ArchiveOption opts) + { + try + { + throw new NotImplementedException("Not yet implemented, stay tune!"); + } + catch (Exception ex) + { + return OnException(ex, "Failed to execute archive function", opts.IsDebug); + } } private int OnException(Exception exception, string headerMessage, bool debug) @@ -397,6 +402,6 @@ private int OnException(Exception exception, string headerMessage, bool debug) $"If you think this is a bug, please report an issue here https://github.com/rdagumampan/yuniql/issues."); //TODO: create global constants for url return 1; } - + } -} +} diff --git a/yuniql-cli/ManifestData.cs b/yuniql-cli/ManifestData.cs deleted file mode 100644 index b4b88d5..0000000 --- a/yuniql-cli/ManifestData.cs +++ /dev/null @@ -1,12 +0,0 @@ - -namespace Yuniql.CLI{ - // container for supported platform and versions. - public class ManifestData - { - private string Name{get;set;} - private string SupportedVersions{get;set;} - private string Usage {get;set;} - private string Samples{get;set;} - } - -} diff --git a/yuniql-extensibility/IDataService.cs b/yuniql-extensibility/IDataService.cs index 447c8a2..3b29c38 100644 --- a/yuniql-extensibility/IDataService.cs +++ b/yuniql-extensibility/IDataService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; @@ -50,12 +50,12 @@ public interface IDataService /// Returns true if the database platform or version supports batch sql statements. /// For example, SQL Server uses GO word as default batch terminator while Snowflow uses semicolon (;). /// - bool IsBatchSqlSupported { get; } - - - /// - /// Returns true if the database supports single MERGE or UPSERT sql statement - /// + bool IsBatchSqlSupported { get; } + + + /// + /// Returns true if the database supports single MERGE or UPSERT sql statement + /// bool IsUpsertSupported { get; } /// @@ -86,8 +86,8 @@ public interface IDataService /// /// Returns the SQL statement to use for creating new database if --auto-createdb flag is set to true. /// - public string GetSqlForCreateDatabase(); - + public string GetSqlForCreateDatabase(); + /// /// Returns the SQL statement to use for dropping existing database /// @@ -127,38 +127,43 @@ public interface IDataService /// /// Returns the SQL statement to use for creating new entry into migration tracking table. /// - public string GetSqlForInsertVersion(); - + public string GetSqlForInsertVersion(); + /// /// Returns the SQL statement to use for updating version in migration tracking table. /// - public string GetSqlForUpdateVersion(); - + public string GetSqlForUpdateVersion(); + /// /// Returns the SQL statement to use for merging new entry into migration tracking table. /// - public string GetSqlForUpsertVersion(); - - /// - /// Returns true if the version tracking table requires upgrade for this release - /// - /// - public string GetSqlForCheckRequireMetaSchemaUpgrade(string currentSchemaVersion); - - /// - /// Returns sql for upgrade the existing version tracking table - /// - /// - public string GetSqlForUpgradeMetaSchema(string requiredSchemaVersion); - - /// - /// Try parses error from database specific exception. - /// - /// The exc. - /// The parsed error. - /// - /// True, if the parsing was sucessfull otherwise false - /// + public string GetSqlForUpsertVersion(); + + /// + /// Returns true if the version tracking table requires upgrade for this release + /// + /// + public string GetSqlForCheckRequireMetaSchemaUpgrade(string currentSchemaVersion); + + /// + /// Returns sql for upgrade the existing version tracking table + /// + /// + public string GetSqlForUpgradeMetaSchema(string requiredSchemaVersion); + + /// + /// Try parses error from database specific exception. + /// + /// The exc. + /// The parsed error. + /// + /// True, if the parsing was sucessfull otherwise false + /// bool TryParseErrorFromException(Exception exception, out string result); + + /// + /// Returns instance of ManifestData in IDataService implementations + /// + public ManifestData GetManifestData(); } } \ No newline at end of file diff --git a/yuniql-extensibility/ManifestData.cs b/yuniql-extensibility/ManifestData.cs index 03cf83a..3feadd8 100644 --- a/yuniql-extensibility/ManifestData.cs +++ b/yuniql-extensibility/ManifestData.cs @@ -1,3 +1,4 @@ +using System; namespace Yuniql.Extensibility{ @@ -10,6 +11,17 @@ public class ManifestData public string SupportedVersions; public string Usage; public string Samples; + + public void printData() + { + var info = string.Format(@" + Name: {0} + SupportedVersions: {1} + Usage:{2} + Samples: {3} + ",Name,SupportedVersions,Usage,Samples); + Console.WriteLine(info); + } } } \ No newline at end of file diff --git a/yuniql-platforms/mysql/MySqlDataService.cs b/yuniql-platforms/mysql/MySqlDataService.cs index a0c0905..f6a9fbb 100644 --- a/yuniql-platforms/mysql/MySqlDataService.cs +++ b/yuniql-platforms/mysql/MySqlDataService.cs @@ -1,157 +1,164 @@ -using System.Collections.Generic; -using System.Data; -using Yuniql.Extensibility; -using MySql.Data.MySqlClient; +using System.Collections.Generic; +using System.Data; +using Yuniql.Extensibility; +using MySql.Data.MySqlClient; using System; using System.IO; -namespace Yuniql.MySql -{ - /// - public class MySqlDataService : IDataService, IMixableTransaction - { - private string _connectionString; +namespace Yuniql.MySql +{ + /// + public class MySqlDataService : IDataService, IMixableTransaction + { + private string _connectionString; private readonly ITraceService _traceService; + + private ManifestData _manifestData = new ManifestData{ + Name = "SqlServer | Released:", + SupportedVersions = "https://yuniql.io/docs/supported-platforms/", + Usage = "yuniql run -a -c --platform sqlserver", + Samples = "https://github.com/rdagumampan/yuniql/tree/master/samples/basic-sqlserver-sample" + }; - /// - public MySqlDataService(ITraceService traceService) - { - this._traceService = traceService; + /// + public MySqlDataService(ITraceService traceService) + { + this._traceService = traceService; } - /// - public void Initialize(string connectionString) - { - this._connectionString = connectionString; + /// + public void Initialize(string connectionString) + { + this._connectionString = connectionString; } - /// + /// public bool IsTransactionalDdlSupported => false; - /// + /// public bool IsSchemaSupported { get; } = false; - /// + /// public bool IsBatchSqlSupported { get; } = false; - /// + /// public bool IsUpsertSupported => false; - /// + /// public string TableName { get; set; } = "__yuniql_schema_version"; - /// + /// public string SchemaName { get; set; } - /// - public IDbConnection CreateConnection() - { - return new MySqlConnection(_connectionString); + /// + public IDbConnection CreateConnection() + { + return new MySqlConnection(_connectionString); } - /// - public IDbConnection CreateMasterConnection() - { - var masterConnectionStringBuilder = new MySqlConnectionStringBuilder(_connectionString); - masterConnectionStringBuilder.Database = "INFORMATION_SCHEMA"; - - return new MySqlConnection(masterConnectionStringBuilder.ConnectionString); + /// + public IDbConnection CreateMasterConnection() + { + var masterConnectionStringBuilder = new MySqlConnectionStringBuilder(_connectionString); + masterConnectionStringBuilder.Database = "INFORMATION_SCHEMA"; + + return new MySqlConnection(masterConnectionStringBuilder.ConnectionString); } - /// - public List BreakStatements(string sqlStatementRaw) - { - return new List { sqlStatementRaw }; + /// + public List BreakStatements(string sqlStatementRaw) + { + return new List { sqlStatementRaw }; } - /// - public ConnectionInfo GetConnectionInfo() - { - var connectionStringBuilder = new MySqlConnectionStringBuilder(_connectionString); - return new ConnectionInfo { DataSource = connectionStringBuilder.Server, Database = connectionStringBuilder.Database }; + /// + public ConnectionInfo GetConnectionInfo() + { + var connectionStringBuilder = new MySqlConnectionStringBuilder(_connectionString); + return new ConnectionInfo { DataSource = connectionStringBuilder.Server, Database = connectionStringBuilder.Database }; } - /// - public string GetSqlForCheckIfDatabaseExists() + /// + public string GetSqlForCheckIfDatabaseExists() => @" SELECT 1 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '${YUNIQL_DB_NAME}'; "; - /// - public string GetSqlForCreateDatabase() + /// + public string GetSqlForCreateDatabase() => @" CREATE DATABASE `${YUNIQL_DB_NAME}`; "; - /// - public List GetSqlForDropDatabase() + /// + public List GetSqlForDropDatabase() => new List { @" DROP DATABASE `${YUNIQL_DB_NAME}`; " }; - /// - public string GetSqlForCreateSchema() + /// + public string GetSqlForCreateSchema() => throw new NotSupportedException("Custom schema is not supported in MySql."); - /// - public string GetSqlForCheckIfDatabaseConfigured() + /// + public string GetSqlForCheckIfDatabaseConfigured() => @" SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '${YUNIQL_DB_NAME}' AND TABLE_NAME = '${YUNIQL_TABLE_NAME}' LIMIT 1; "; - /// - public string GetSqlForCheckIfDatabaseConfiguredv10() + /// + public string GetSqlForCheckIfDatabaseConfiguredv10() => @" SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '${YUNIQL_DB_NAME}' AND TABLE_NAME = '__yuniqldbversion' LIMIT 1; "; - /// - public string GetSqlForConfigureDatabase() - => @" -CREATE TABLE ${YUNIQL_TABLE_NAME} ( - sequence_id INT AUTO_INCREMENT PRIMARY KEY NOT NULL, - version VARCHAR(190) NOT NULL, - applied_on_utc TIMESTAMP NOT NULL, - applied_by_user VARCHAR(128) NOT NULL, - applied_by_tool VARCHAR(32) NOT NULL, - applied_by_tool_version VARCHAR(16) NOT NULL, - status VARCHAR(32) NOT NULL, - duration_ms INT NOT NULL, - checksum VARCHAR(64) NOT NULL, - failed_script_path VARCHAR(4000) NULL, - failed_script_error VARCHAR(4000) NULL, - additional_artifacts VARCHAR(4000) NULL, - CONSTRAINT ix_${YUNIQL_TABLE_NAME} UNIQUE (version) -) ENGINE=InnoDB; + /// + public string GetSqlForConfigureDatabase() + => @" +CREATE TABLE ${YUNIQL_TABLE_NAME} ( + sequence_id INT AUTO_INCREMENT PRIMARY KEY NOT NULL, + version VARCHAR(190) NOT NULL, + applied_on_utc TIMESTAMP NOT NULL, + applied_by_user VARCHAR(128) NOT NULL, + applied_by_tool VARCHAR(32) NOT NULL, + applied_by_tool_version VARCHAR(16) NOT NULL, + status VARCHAR(32) NOT NULL, + duration_ms INT NOT NULL, + checksum VARCHAR(64) NOT NULL, + failed_script_path VARCHAR(4000) NULL, + failed_script_error VARCHAR(4000) NULL, + additional_artifacts VARCHAR(4000) NULL, + CONSTRAINT ix_${YUNIQL_TABLE_NAME} UNIQUE (version) +) ENGINE=InnoDB; "; - /// - public string GetSqlForGetCurrentVersion() + /// + public string GetSqlForGetCurrentVersion() => @" SELECT version FROM ${YUNIQL_TABLE_NAME} WHERE status = 'Successful' ORDER BY sequence_id DESC LIMIT 1; "; - /// - public string GetSqlForGetAllVersions() + /// + public string GetSqlForGetAllVersions() => @" SELECT sequence_id, version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, status, duration_ms, checksum, failed_script_path, failed_script_error, additional_artifacts FROM ${YUNIQL_TABLE_NAME} ORDER BY version ASC; "; - /// + /// public string GetSqlForInsertVersion() - => @" -INSERT INTO ${YUNIQL_TABLE_NAME} (version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, status, duration_ms, checksum, failed_script_path, failed_script_error, additional_artifacts) -VALUES ('${YUNIQL_VERSION}', UTC_TIMESTAMP(), CURRENT_USER(), '${YUNIQL_APPLIED_BY_TOOL}', '${YUNIQL_APPLIED_BY_TOOL_VERSION}','${YUNIQL_STATUS}', '${YUNIQL_DURATION_MS}', '${YUNIQL_CHECKSUM}', '${YUNIQL_FAILED_SCRIPT_PATH}', '${YUNIQL_FAILED_SCRIPT_ERROR}', '${YUNIQL_ADDITIONAL_ARTIFACTS}'); + => @" +INSERT INTO ${YUNIQL_TABLE_NAME} (version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, status, duration_ms, checksum, failed_script_path, failed_script_error, additional_artifacts) +VALUES ('${YUNIQL_VERSION}', UTC_TIMESTAMP(), CURRENT_USER(), '${YUNIQL_APPLIED_BY_TOOL}', '${YUNIQL_APPLIED_BY_TOOL_VERSION}','${YUNIQL_STATUS}', '${YUNIQL_DURATION_MS}', '${YUNIQL_CHECKSUM}', '${YUNIQL_FAILED_SCRIPT_PATH}', '${YUNIQL_FAILED_SCRIPT_ERROR}', '${YUNIQL_ADDITIONAL_ARTIFACTS}'); "; - /// + /// public string GetSqlForUpdateVersion() => @" UPDATE ${YUNIQL_TABLE_NAME} SET - applied_on_utc = UTC_TIMESTAMP(), - applied_by_user = CURRENT_USER(), + applied_on_utc = UTC_TIMESTAMP(), + applied_by_user = CURRENT_USER(), applied_by_tool = '${YUNIQL_APPLIED_BY_TOOL}', applied_by_tool_version = '${YUNIQL_APPLIED_BY_TOOL_VERSION}', status = '${YUNIQL_STATUS}', @@ -163,20 +170,20 @@ public string GetSqlForUpdateVersion() version = '${YUNIQL_VERSION}'; "; - /// + /// public string GetSqlForUpsertVersion() - => @" -INSERT INTO ${YUNIQL_TABLE_NAME} (version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, additional_artifacts, status, checksum, failed_script_path, failed_script_error) -VALUES ('${YUNIQL_VERSION}', UTC_TIMESTAMP(), CURRENT_USER(), '${YUNIQL_APPLIED_BY_TOOL}', '${YUNIQL_APPLIED_BY_TOOL_VERSION}', '${YUNIQL_ADDITIONAL_ARTIFACTS}', '${YUNIQL_STATUS}', '${YUNIQL_CHECKSUM}', '${YUNIQL_FAILED_SCRIPT_PATH}', '${YUNIQL_FAILED_SCRIPT_ERROR}') + => @" +INSERT INTO ${YUNIQL_TABLE_NAME} (version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, additional_artifacts, status, checksum, failed_script_path, failed_script_error) +VALUES ('${YUNIQL_VERSION}', UTC_TIMESTAMP(), CURRENT_USER(), '${YUNIQL_APPLIED_BY_TOOL}', '${YUNIQL_APPLIED_BY_TOOL_VERSION}', '${YUNIQL_ADDITIONAL_ARTIFACTS}', '${YUNIQL_STATUS}', '${YUNIQL_CHECKSUM}', '${YUNIQL_FAILED_SCRIPT_PATH}', '${YUNIQL_FAILED_SCRIPT_ERROR}') ON DUPLICATE KEY UPDATE - applied_on_utc = VALUES(applied_on_utc), - applied_by_user = VALUES(applied_by_user), - applied_by_tool = VALUES(applied_by_tool), - applied_by_tool_version = VALUES(applied_by_tool_version), - additional_artifacts = VALUES(additional_artifacts), - status = VALUES(status), - failed_script_path = VALUES(failed_script_path), - failed_script_error = VALUES(failed_script_error); + applied_on_utc = VALUES(applied_on_utc), + applied_by_user = VALUES(applied_by_user), + applied_by_tool = VALUES(applied_by_tool), + applied_by_tool_version = VALUES(applied_by_tool_version), + additional_artifacts = VALUES(additional_artifacts), + status = VALUES(status), + failed_script_path = VALUES(failed_script_path), + failed_script_error = VALUES(failed_script_error); "; /// @@ -195,7 +202,7 @@ public string GetSqlForUpgradeMetaSchema(string requiredSchemaVersion) return reader.ReadToEnd(); } - /// + /// public bool TryParseErrorFromException(Exception exception, out string result) { result = null; @@ -206,5 +213,11 @@ public bool TryParseErrorFromException(Exception exception, out string result) } return false; } - } + + /// + public ManifestData GetManifestData() + { + return _manifestData; + } + } } \ No newline at end of file diff --git a/yuniql-platforms/postgresql/PostgreSqlDataService.cs b/yuniql-platforms/postgresql/PostgreSqlDataService.cs index 90923df..d4646e0 100644 --- a/yuniql-platforms/postgresql/PostgreSqlDataService.cs +++ b/yuniql-platforms/postgresql/PostgreSqlDataService.cs @@ -1,91 +1,99 @@ -using System; -using System.Collections.Generic; -using System.Data; -using Yuniql.Extensibility; -using Npgsql; +using System; +using System.Collections.Generic; +using System.Data; +using Yuniql.Extensibility; +using Npgsql; using System.Collections; using System.IO; -namespace Yuniql.PostgreSql -{ - /// - public class PostgreSqlDataService : IDataService - { - private string _connectionString; +namespace Yuniql.PostgreSql +{ + /// + public class PostgreSqlDataService : IDataService + { + private string _connectionString; private readonly ITraceService _traceService; + private ManifestData _manifestData = new ManifestData{ + Name = "PostgreSql | Released:", + SupportedVersions = "https://yuniql.io/docs/supported-platforms/", + Usage = "yuniql run -a -c --platform postgresql", + Samples = "https://github.com/rdagumampan/yuniql/tree/master/samples/basic-postgresql-sample" - /// - public PostgreSqlDataService(ITraceService traceService) - { - this._traceService = traceService; + }; + + + /// + public PostgreSqlDataService(ITraceService traceService) + { + this._traceService = traceService; } - /// + /// public bool IsTransactionalDdlSupported => true; - /// + /// public bool IsSchemaSupported { get; } = true; - /// + /// public bool IsBatchSqlSupported { get; } = false; - /// + /// public bool IsUpsertSupported => false; - /// + /// public string TableName { get; set; } = "__yuniql_schema_version"; - /// + /// public string SchemaName { get; set; } = "public"; - /// - public void Initialize(string connectionString) - { - this._connectionString = connectionString; + /// + public void Initialize(string connectionString) + { + this._connectionString = connectionString; } - /// - public IDbConnection CreateConnection() - { - return new NpgsqlConnection(_connectionString); + /// + public IDbConnection CreateConnection() + { + return new NpgsqlConnection(_connectionString); } - /// - public IDbConnection CreateMasterConnection() - { - var masterConnectionStringBuilder = new NpgsqlConnectionStringBuilder(_connectionString); - masterConnectionStringBuilder.Database = "postgres"; - - return new NpgsqlConnection(masterConnectionStringBuilder.ConnectionString); + /// + public IDbConnection CreateMasterConnection() + { + var masterConnectionStringBuilder = new NpgsqlConnectionStringBuilder(_connectionString); + masterConnectionStringBuilder.Database = "postgres"; + + return new NpgsqlConnection(masterConnectionStringBuilder.ConnectionString); } - /// - public List BreakStatements(string sqlStatementRaw) - { - return new List { sqlStatementRaw }; + /// + public List BreakStatements(string sqlStatementRaw) + { + return new List { sqlStatementRaw }; } - /// - public ConnectionInfo GetConnectionInfo() - { - var connectionStringBuilder = new NpgsqlConnectionStringBuilder(_connectionString); - return new ConnectionInfo { DataSource = connectionStringBuilder.Host, Database = connectionStringBuilder.Database }; + /// + public ConnectionInfo GetConnectionInfo() + { + var connectionStringBuilder = new NpgsqlConnectionStringBuilder(_connectionString); + return new ConnectionInfo { DataSource = connectionStringBuilder.Host, Database = connectionStringBuilder.Database }; } - /// - public string GetSqlForCheckIfDatabaseExists() + /// + public string GetSqlForCheckIfDatabaseExists() => @" SELECT 1 from pg_database WHERE datname = '${YUNIQL_DB_NAME}'; "; - /// - public string GetSqlForCreateDatabase() + /// + public string GetSqlForCreateDatabase() => @" CREATE DATABASE ""${YUNIQL_DB_NAME}""; "; - /// - public List GetSqlForDropDatabase() + /// + public List GetSqlForDropDatabase() => new List { @" --disallow new connections, set exclusive to current session @@ -100,59 +108,59 @@ public List GetSqlForDropDatabase() DROP DATABASE ${YUNIQL_DB_NAME}; "}; - /// - public string GetSqlForCreateSchema() + /// + public string GetSqlForCreateSchema() => @" CREATE SCHEMA ""${YUNIQL_SCHEMA_NAME}""; "; - /// - public string GetSqlForCheckIfDatabaseConfigured() + /// + public string GetSqlForCheckIfDatabaseConfigured() => @" SELECT 1 FROM pg_tables WHERE tablename = '${YUNIQL_TABLE_NAME}'; "; - /// - public string GetSqlForCheckIfDatabaseConfiguredv10() + /// + public string GetSqlForCheckIfDatabaseConfiguredv10() => @" SELECT 1 FROM pg_tables WHERE tablename = '__yuniqldbversion'; "; - /// - public string GetSqlForConfigureDatabase() - => @" -CREATE TABLE ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME}( - sequence_id SMALLSERIAL PRIMARY KEY NOT NULL, - version VARCHAR(512) NOT NULL, - applied_on_utc TIMESTAMP NOT NULL DEFAULT(current_timestamp AT TIME ZONE 'UTC'), - applied_by_user VARCHAR(128) NOT NULL DEFAULT(user), - applied_by_tool VARCHAR(32) NOT NULL, - applied_by_tool_version VARCHAR(16) NOT NULL, - status VARCHAR(32) NOT NULL, - duration_ms INTEGER NOT NULL, - checksum VARCHAR(64) NOT NULL, - failed_script_path VARCHAR(4000) NULL, - failed_script_error VARCHAR(4000) NULL, - additional_artifacts VARCHAR(4000) NULL, - CONSTRAINT ix_${YUNIQL_TABLE_NAME} UNIQUE(version) + /// + public string GetSqlForConfigureDatabase() + => @" +CREATE TABLE ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME}( + sequence_id SMALLSERIAL PRIMARY KEY NOT NULL, + version VARCHAR(512) NOT NULL, + applied_on_utc TIMESTAMP NOT NULL DEFAULT(current_timestamp AT TIME ZONE 'UTC'), + applied_by_user VARCHAR(128) NOT NULL DEFAULT(user), + applied_by_tool VARCHAR(32) NOT NULL, + applied_by_tool_version VARCHAR(16) NOT NULL, + status VARCHAR(32) NOT NULL, + duration_ms INTEGER NOT NULL, + checksum VARCHAR(64) NOT NULL, + failed_script_path VARCHAR(4000) NULL, + failed_script_error VARCHAR(4000) NULL, + additional_artifacts VARCHAR(4000) NULL, + CONSTRAINT ix_${YUNIQL_TABLE_NAME} UNIQUE(version) ); "; - /// - public string GetSqlForGetCurrentVersion() + /// + public string GetSqlForGetCurrentVersion() => @" SELECT version FROM ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME} WHERE status = 'Successful' ORDER BY sequence_id DESC LIMIT 1; "; - /// - public string GetSqlForGetAllVersions() + /// + public string GetSqlForGetAllVersions() => @" SELECT sequence_id, version, applied_on_utc, applied_by_user, applied_by_tool, applied_by_tool_version, status, duration_ms, checksum, failed_script_path, failed_script_error, additional_artifacts FROM ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME} ORDER BY version ASC; "; - /// - public string GetSqlForInsertVersion() + /// + public string GetSqlForInsertVersion() => @" INSERT INTO ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME} (version, applied_by_tool, applied_by_tool_version, status, duration_ms, checksum, failed_script_path, failed_script_error, additional_artifacts) VALUES ('${YUNIQL_VERSION}', '${YUNIQL_APPLIED_BY_TOOL}', '${YUNIQL_APPLIED_BY_TOOL_VERSION}', '${YUNIQL_STATUS}', '${YUNIQL_DURATION_MS}', '${YUNIQL_CHECKSUM}', '${YUNIQL_FAILED_SCRIPT_PATH}', '${YUNIQL_FAILED_SCRIPT_ERROR}', '${YUNIQL_ADDITIONAL_ARTIFACTS}'); @@ -163,8 +171,8 @@ public string GetSqlForUpdateVersion() => @" UPDATE ${YUNIQL_SCHEMA_NAME}.${YUNIQL_TABLE_NAME} SET - applied_on_utc = current_timestamp AT TIME ZONE 'UTC', - applied_by_user = user, + applied_on_utc = current_timestamp AT TIME ZONE 'UTC', + applied_by_user = user, applied_by_tool = '${YUNIQL_APPLIED_BY_TOOL}', applied_by_tool_version = '${YUNIQL_APPLIED_BY_TOOL_VERSION}', status = '${YUNIQL_STATUS}', @@ -176,11 +184,11 @@ public string GetSqlForUpdateVersion() version = '${YUNIQL_VERSION}'; "; - /// + /// public string GetSqlForUpsertVersion() => throw new NotSupportedException("Not supported for the target platform"); - /// + /// public string GetSqlForCheckRequireMetaSchemaUpgrade(string currentSchemaVersion) //when table __yuniqldbversion exists, we need to upgrade from yuniql v1.0 to v1.1 version => @" @@ -196,7 +204,7 @@ public string GetSqlForUpgradeMetaSchema(string requiredSchemaVersion) return reader.ReadToEnd(); } - /// + /// public bool TryParseErrorFromException(Exception exception, out string result) { result = null; @@ -215,5 +223,11 @@ public bool TryParseErrorFromException(Exception exception, out string result) catch (Exception) { return false; } return false; } - } -} + + /// + public ManifestData GetManifestData() + { + return _manifestData; + } + } +} diff --git a/yuniql-platforms/redshift/RedshiftDataService.cs b/yuniql-platforms/redshift/RedshiftDataService.cs index 2a55277..5153328 100644 --- a/yuniql-platforms/redshift/RedshiftDataService.cs +++ b/yuniql-platforms/redshift/RedshiftDataService.cs @@ -13,6 +13,13 @@ public class RedshiftDataService : IDataService { private string _connectionString; private readonly ITraceService _traceService; + private ManifestData _manifestData = new ManifestData{ + Name = "Redshift| Preview:", + SupportedVersions = "https://yuniql.io/docs/supported-platforms/", + Usage = "yuniql run -a -c --platform redshift", + Samples = "https://github.com/rdagumampan/yuniql/tree/master/samples/basic-redshift-sample" + }; + /// public RedshiftDataService(ITraceService traceService) @@ -216,5 +223,14 @@ public bool TryParseErrorFromException(Exception exception, out string result) catch (Exception) { return false; } return false; } + + + /// + + public ManifestData GetManifestData() + { + return _manifestData; + } + } } diff --git a/yuniql-platforms/snowflake/SnowflakeDataService.cs b/yuniql-platforms/snowflake/SnowflakeDataService.cs index 98a99d0..cb7e23d 100644 --- a/yuniql-platforms/snowflake/SnowflakeDataService.cs +++ b/yuniql-platforms/snowflake/SnowflakeDataService.cs @@ -15,6 +15,13 @@ public class SnowflakeDataService : IDataService { private string _connectionString; private readonly ITraceService _traceService; + private ManifestData _manifestData = new ManifestData{ + Name = "Snowflake | Preview:", + SupportedVersions = "https://yuniql.io/docs/supported-platforms/", + Usage = "yuniql run -a -c --platform snowflake", + Samples = "https://github.com/rdagumampan/yuniql/tree/master/samples/basic-snowflake-sample" + }; + /// public SnowflakeDataService(ITraceService traceService) @@ -247,5 +254,11 @@ public bool TryParseErrorFromException(Exception exception, out string result) catch (Exception) { return false; } return false; } + + /// + public ManifestData GetManifestData() + { + return _manifestData; + } } } diff --git a/yuniql-platforms/sqlserver/SqlServerDataService.cs b/yuniql-platforms/sqlserver/SqlServerDataService.cs index 334bfaf..e8a6ecd 100644 --- a/yuniql-platforms/sqlserver/SqlServerDataService.cs +++ b/yuniql-platforms/sqlserver/SqlServerDataService.cs @@ -15,6 +15,13 @@ public class SqlServerDataService : IDataService { private string _connectionString; private readonly ITraceService _traceService; + private ManifestData _manifestData = new ManifestData{ + Name = "SqlServer | Released:", + SupportedVersions = "https://yuniql.io/docs/supported-platforms/", + Usage = "yuniql run -a -c --platform sqlserver", + Samples = "https://github.com/rdagumampan/yuniql/tree/master/samples/basic-sqlserver-sample" + }; + /// public SqlServerDataService(ITraceService traceService) @@ -213,5 +220,11 @@ public bool TryParseErrorFromException(Exception exception, out string result) catch (Exception) { return false; } return false; } + + /// + public ManifestData GetManifestData() + { + return _manifestData; + } } } \ No newline at end of file