示例#1
0
        public SQLiteObjectNames(DmTable tableDescription)
        {
            this.TableDescription     = tableDescription;
            (tableName, trackingName) = SQLiteBuilder.GetParsers(this.TableDescription);

            SetDefaultNames();
        }
示例#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));
        }
示例#3
0
 public SQLiteBuilderTrackingTable(DmTable tableDescription, DbConnection connection, DbTransaction transaction = null)
 {
     this.connection       = connection as SQLiteConnection;
     this.transaction      = transaction as SQLiteTransaction;
     this.tableDescription = tableDescription;
     (this.tableName, this.trackingName) = SQLiteBuilder.GetParsers(this.tableDescription);
     this.sqliteDbMetadata = new SQLiteDbMetadata();
 }
示例#4
0
        public string CreateTableScriptText()
        {
            StringBuilder stringBuilder   = new StringBuilder();
            var           tableNameScript = $"Create Table {tableName.QuotedString}";
            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));
        }
示例#6
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));
        }
示例#7
0
        public string CreateTableScriptText()
        {
            string str = string.Concat("Create Tracking Table ", trackingName.QuotedString);

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