public override string GenerateCreateTableFullDdl([NotNull] DatabaseConnection databaseConnection, string database, string schema, [NotNull] string tableName) { if (databaseConnection == null) { throw new ArgumentNullException("databaseConnection"); } if (tableName == null) { throw new ArgumentNullException("tableName"); } var repo = new DB4Repository(databaseConnection.ConnectionString); var generator = new Generator4(repo); generator.GenerateTableCreate(tableName); var infoProvider = databaseConnection.DatabaseServer.GetInfoProvider(); using (var connection = databaseConnection.CreateNewConnection()) { connection.OpenIfRequired(); var indexes = infoProvider.GetIndexesForTable(connection, schema, tableName); foreach (var index in indexes) { generator.GenerateIndexScript(tableName, index.Name); } } return(generator.GeneratedScript); }
public void TestServerTableGenWithGeography() { using (IRepository sourceRepository = new ServerDBRepository4(@"Data Source=.\SQL2016DEV;Initial Catalog=AW2014Geo;Integrated Security=true;")) { var generator = new Generator4(sourceRepository); generator.GenerateTableCreate("Address"); var script = generator.GeneratedScript; } }
public void TestSQLiteDataTypes() { //cloud_service_product_infos //;DateFormatString=yyyy-MM-dd HH:mm:ss zzz using (IRepository sourceRepository = new SQLiteRepository(@"Data Source=C:\Users\erik\Downloads\spiceworks_prod.db")) { var generator = new Generator4(sourceRepository, "sw.sql"); generator.GenerateTableCreate("alerts"); } }
public void TestSQLiteDataTypes() { //cloud_service_product_infos //;DateFormatString=yyyy-MM-dd HH:mm:ss zzz using (IRepository sourceRepository = new SQLiteRepository(chinookSQLiteConnectionString)) { var generator = new Generator4(sourceRepository, "sw.sql", false, false, true); generator.GenerateTableCreate("Artist"); Assert.IsTrue(generator.GeneratedScript.Contains("INTEGER")); } }
public void TestSQLiteDataTypes() { //cloud_service_product_infos //;DateFormatString=yyyy-MM-dd HH:mm:ss zzz using (IRepository sourceRepository = new SQLiteRepository(@"Data Source=C:\Code\SqlCeToolbox\src\API\SqlCeScripting40\Tests\chinook.db")) { var generator = new Generator4(sourceRepository, "sw.sql", false, false, true); generator.GenerateTableCreate("Artist"); Assert.IsTrue(generator.GeneratedScript.Contains("INTEGER")); } }
public override string GenerateCreateTableDdl([NotNull] DatabaseConnection databaseConnection, string database, string schema, [NotNull] string tableName) { if (databaseConnection == null) { throw new ArgumentNullException("databaseConnection"); } if (tableName == null) { throw new ArgumentNullException("tableName"); } var repo = new DB4Repository(databaseConnection.ConnectionString); var generator = new Generator4(repo); generator.GenerateTableCreate(tableName); return(generator.GeneratedScript); }