Example #1
0
        public CreateTables detrectCreate()
        {
            var select       = new MysqlSelectAsObject <SqlTableDatailsObject>(this.ctx.Source);
            var sourceTables = select.Execute($"SELECT table_name FROM `information_schema`.`tables`  WHERE table_schema = '{this.ctx.SqlBlinkerConfig.Source.DatabaseName}'");
            var targetTables = select.Execute($"SELECT table_name FROM `information_schema`.`tables`  WHERE table_schema = '{this.ctx.SqlBlinkerConfig.Target.DatabaseName}'");

            var diffCreate = sourceTables.Except(targetTables);
            var ct         = new CreateTables();

            foreach (var item in diffCreate)
            {
                ct.Tables.Add(item.Name);
            }
            return(ct);
        }
Example #2
0
 /// <summary>
 /// Инициализация первоначальной структуры базы данных
 /// </summary>
 /// <param name="Path">Путь до файоа базы данных</param>
 private static void DBSetup()
 {
     try
     {
         SQLiteDataReader Result = ValidateTables.ExecuteReader();
         if (!Result.HasRows)
         {
             CreateTables.ExecuteNonQuery();
         }
     }
     catch (Exception e)
     {
         Program.ConsoleWrite($"Ошибка: {e.Message}", 3);
         _DBConnect.Close();
         return;
     }
 }
Example #3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            var create = new CreateTables();

            create.CheckTables();
        }
Example #4
0
 public override void Visit(CreateTableStatement node)
 {
     Creates++;
     CreateTables.Add(node.SchemaObjectName.BaseIdentifier.Value);
 }