Exemplo n.º 1
0
        private string CreateProcedureCommandScriptText <T>(Func <T, MySqlCommand> BuildCommand, string procName, T t, DbConnection connection, DbTransaction transaction)
        {
            var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}";
            var str  = CreateProcedureCommandText(BuildCommand(t), procName);

            return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1));
        }
        private string CreateProcedureCommandScriptText <T>(Func <T, MySqlCommand> BuildCommand, string procName, T t)
        {
            bool alreadyOpened = connection.State == ConnectionState.Open;

            try
            {
                if (!alreadyOpened)
                {
                    connection.Open();
                }

                var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}";
                var str  = CreateProcedureCommandText(BuildCommand(t), procName);
                return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1));
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"Error during CreateProcedureCommand : {ex}");
                throw;
            }
            finally
            {
                if (!alreadyOpened && connection.State != ConnectionState.Closed)
                {
                    connection.Close();
                }
            }
        }
Exemplo n.º 3
0
        private string CreateProcedureCommandScriptText(Func <MySqlCommand> BuildCommand, string procName)
        {
            var str1 = $"Command {procName} for table {tableName.Quoted().ToString()}";
            var str  = CreateProcedureCommandText(BuildCommand(), procName);

            return(MyTableSqlBuilder.WrapScriptTextWithComments(str, str1));
        }
Exemplo n.º 4
0
 public MySqlBuilderTrackingTable(SyncTable tableDescription, DbConnection connection, DbTransaction transaction = null)
 {
     this.connection       = connection as MySqlConnection;
     this.transaction      = transaction as MySqlTransaction;
     this.tableDescription = tableDescription;
     (this.tableName, this.trackingName) = MyTableSqlBuilder.GetParsers(this.tableDescription);
     this.mySqlDbMetadata = new MySqlDbMetadata();
 }
Exemplo n.º 5
0
        public override DbTableBuilder GetTableBuilder(SyncTable tableDescription, SyncSetup setup)
        {
            var(tableName, trackingName) = GetParsers(tableDescription, setup);

            var tableBuilder = new MyTableSqlBuilder(tableDescription, tableName, trackingName, setup);

            return(tableBuilder);
        }