Exemplo n.º 1
0
        public string ScriptAddFilterColumn(DmColumn filterColumn)
        {
            var quotedColumnName = ParserName.Parse(filterColumn.ColumnName).Quoted().ToString();

            string str = string.Concat("Add new filter column, ", quotedColumnName, ", to Tracking Table ", trackingName.Quoted().ToString());

            return(SqliteBuilder.WrapScriptTextWithComments(this.AddFilterColumnCommandText(filterColumn), str));
        }
Exemplo n.º 2
0
        public string ScriptAddFilterColumn(DmColumn filterColumn)
        {
            var quotedColumnName = new ObjectNameParser(filterColumn.ColumnName, "[", "]");

            string str = string.Concat("Add new filter column, ", quotedColumnName.UnquotedString, ", to Tracking Table ", trackingName.QuotedString);

            return(SqliteBuilder.WrapScriptTextWithComments(this.AddFilterColumnCommandText(filterColumn), str));
        }
Exemplo n.º 3
0
        public string CreateDropTriggerScriptText(DbCommandType triggerType)
        {
            var    triggerName = string.Format(this.sqliteObjectNames.GetCommandName(triggerType), tableName.UnquotedStringWithUnderScore);
            string dropTrigger = $"DROP TRIGGER IF EXISTS {triggerName}";
            string str         = $"Drop Trigger {triggerName} for table {tableName.QuotedString}";

            return(SqliteBuilder.WrapScriptTextWithComments(dropTrigger, str));
        }
Exemplo n.º 4
0
        public string DropTableScriptText()
        {
            StringBuilder stringBuilder   = new StringBuilder();
            var           tableNameScript = $"Drop Table {tableName.QuotedString}";
            var           tableScript     = $"DROP TABLE IF EXISTS {tableName.QuotedString}";

            stringBuilder.Append(SqliteBuilder.WrapScriptTextWithComments(tableScript, tableNameScript));
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
        public string CreateTableScriptText()
        {
            StringBuilder stringBuilder   = new StringBuilder();
            var           tableNameScript = $"Create Table {tableName.FullQuotedString}";
            var           tableScript     = BuildTableCommand().CommandText;

            stringBuilder.Append(SqliteBuilder.WrapScriptTextWithComments(tableScript, tableNameScript));
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
        public string CreateUpdateTriggerScriptText()
        {
            var           updTriggerName = string.Format(this.sqliteObjectNames.GetCommandName(DbCommandType.UpdateTrigger), tableName.UnquotedStringWithUnderScore);
            StringBuilder createTrigger  = new StringBuilder($"CREATE TRIGGER IF NOT EXISTS {updTriggerName} AFTER UPDATE ON {tableName.QuotedString} ");

            createTrigger.AppendLine();
            createTrigger.AppendLine(this.UpdateTriggerBodyText());

            string str = $"Update Trigger for table {tableName.QuotedString}";

            return(SqliteBuilder.WrapScriptTextWithComments(createTrigger.ToString(), str));
        }
Exemplo n.º 7
0
        public string CreateInsertTriggerScriptText()
        {
            var           insTriggerName = string.Format(this.sqliteObjectNames.GetCommandName(DbCommandType.InsertTrigger), tableName.ObjectNameNormalized);
            StringBuilder createTrigger  = new StringBuilder($"CREATE TRIGGER IF NOT EXISTS {insTriggerName} AFTER INSERT ON {tableName.FullQuotedString} ");

            createTrigger.AppendLine();
            createTrigger.AppendLine(this.InsertTriggerBodyText());

            string str = $"Insert Trigger for table {tableName.FullQuotedString}";

            return(SqliteBuilder.WrapScriptTextWithComments(createTrigger.ToString(), str));
        }
Exemplo n.º 8
0
        public string CreateDeleteTriggerScriptText()
        {
            var           delTriggerName = string.Format(this.sqliteObjectNames.GetCommandName(DbCommandType.DeleteTrigger), tableName.Unquoted().ToString());
            StringBuilder createTrigger  = new StringBuilder($"CREATE TRIGGER IF NOT EXISTS {delTriggerName} AFTER DELETE ON {tableName.Quoted().ToString()} ");

            createTrigger.AppendLine();
            createTrigger.AppendLine(this.DeleteTriggerBodyText());

            string str = $"Delete Trigger for table {tableName.Quoted().ToString()}";

            return(SqliteBuilder.WrapScriptTextWithComments(createTrigger.ToString(), str));
        }
Exemplo n.º 9
0
        public string CreatePopulateFromBaseTableScriptText()
        {
            string str = string.Concat("Populate tracking table ", trackingName.QuotedString, " for existing data in table ", tableName.QuotedString);

            return(SqliteBuilder.WrapScriptTextWithComments(this.CreatePopulateFromBaseTableCommandText(), str));
        }
Exemplo n.º 10
0
        public string CreateTableScriptText()
        {
            string str = string.Concat("Create Tracking Table ", trackingName.QuotedString);

            return(SqliteBuilder.WrapScriptTextWithComments(this.CreateTableCommandText(), str));
        }