예제 #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());
        }
예제 #5
0
        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));
        }