コード例 #1
0
        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);
        }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
 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");
     }
 }
コード例 #4
0
 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"));
     }
 }
コード例 #5
0
 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"));
     }
 }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: Test.cs プロジェクト: inickvel/SqlCeToolbox
 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");
     }
 }