public SQLiteObjectNames(DmTable tableDescription) { this.TableDescription = tableDescription; (tableName, trackingName) = SQLiteBuilder.GetParsers(this.TableDescription); SetDefaultNames(); }
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)); }
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(); }
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)); }
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)); }
public string CreateTableScriptText() { string str = string.Concat("Create Tracking Table ", trackingName.QuotedString); return(SQLiteBuilder.WrapScriptTextWithComments(this.CreateTableCommandText(), str)); }