コード例 #1
0
 /// <summary>
 /// Add a column definition into the provided schema at the given column location
 /// </summary>
 private string InsertColumnInSchema(SQLiteConnection connection, string tableName, int newColumnNumber, ColumnDefinition newColumn)
 {
     List<string> columnDefinitions = this.GetColumnDefinitions(connection, tableName);
     columnDefinitions.Insert(newColumnNumber, newColumn.ToString());
     return String.Join(", ", columnDefinitions);
 }
コード例 #2
0
 // This method will create a column in a table of type TEXT, where it is added to its end
 // It assumes that the value, if not empty, should be treated as the default value for that column
 public void AddColumnToEndOfTable(string tableName, ColumnDefinition columnDefinition)
 {
     this.ExecuteNonQuery("ALTER TABLE " + tableName + " ADD COLUMN " + columnDefinition.ToString());
 }