|
static bool | RemoveRow (this IMutableTable table, int rowIndex) |
|
static void | DeleteRows (this IMutableTable table, IEnumerable< int > rows) |
|
static Row | NewRow (this IMutableTable table) |
| Creates a new row that is compatible with the table context, ready to be populated and added. More...
|
|
static int | Delete (this IMutableTable table, ITable t) |
|
static int | Delete (this IMutableTable table, ITable other, int limit) |
|
static bool | Delete (this IMutableTable table, int columnOffset, DataObject value) |
|
static int | Update (this IMutableTable mutableTable, IQuery context, ITable table, IEnumerable< SqlAssignExpression > assignList, int limit) |
|
Definition at line 25 of file MutableTableExtensions.cs.
static int Deveel.Data.Sql.Tables.MutableTableExtensions.Delete |
( |
this IMutableTable |
table, |
|
|
ITable |
t |
|
) |
| |
|
inlinestatic |
static int Deveel.Data.Sql.Tables.MutableTableExtensions.Delete |
( |
this IMutableTable |
table, |
|
|
ITable |
other, |
|
|
int |
limit |
|
) |
| |
|
inlinestatic |
Definition at line 63 of file MutableTableExtensions.cs.
64 List<int> rowSet =
new List<int>(other.RowCount);
65 var e = other.GetEnumerator();
66 while (e.MoveNext()) {
67 rowSet.Add(e.Current.RowId.RowNumber);
73 int firstColumn = other.IndexOfColumn(table.GetResolvedColumnName(0));
75 if (firstColumn == -1)
76 throw new DatabaseSystemException(
"Search table does not contain any reference to table being deleted from");
79 var rowsToDelete = other.ResolveRows(firstColumn, rowSet, table).ToList();
87 limit = Int32.MaxValue;
91 int len =
System.Math.Min(rowsToDelete.Count, limit);
94 for (
int i = 0; i < len; ++i) {
95 int toRemove = rowsToDelete[i];
96 if (toRemove < lastRemoved)
97 throw new DatabaseSystemException(
"Internal error: row sorting error or row set not in the range > 0");
99 if (toRemove != lastRemoved) {
100 table.RemoveRow(toRemove);
101 lastRemoved = toRemove;
108 table.AssertConstraints();
static bool Deveel.Data.Sql.Tables.MutableTableExtensions.Delete |
( |
this IMutableTable |
table, |
|
|
int |
columnOffset, |
|
|
DataObject |
value |
|
) |
| |
|
inlinestatic |
Definition at line 113 of file MutableTableExtensions.cs.
114 var list = table.SelectRowsEqual(columnOffset, value).ToArray();
115 if (list.Length == 0)
118 return table.RemoveRow(list[0]);
static void Deveel.Data.Sql.Tables.MutableTableExtensions.DeleteRows |
( |
this IMutableTable |
table, |
|
|
IEnumerable< int > |
rows |
|
) |
| |
|
inlinestatic |
static Row Deveel.Data.Sql.Tables.MutableTableExtensions.NewRow |
( |
this IMutableTable |
table | ) |
|
|
inlinestatic |
Creates a new row that is compatible with the table context, ready to be populated and added.
When this method is called, a new RowId is generated and persisted: when a subsequent call to this method will be issued, another new row identifier will be generated, even if the row was not persisted into the table.
- Returns
- Returns an instance of Row that belongs to this table and can be added or updated through IMutableTable.AddRow or IMutableTable.UpdateRow method calls.
Definition at line 55 of file MutableTableExtensions.cs.
56 return new Row(table);
A single ROW in a database table, that holds tabular data as configured by the table specifications...
static bool Deveel.Data.Sql.Tables.MutableTableExtensions.RemoveRow |
( |
this IMutableTable |
table, |
|
|
int |
rowIndex |
|
) |
| |
|
inlinestatic |
Definition at line 121 of file MutableTableExtensions.cs.
125 var rowSet =
new List<int>();
126 var e = table.GetEnumerator();
127 while (e.MoveNext()) {
128 rowSet.Add(e.Current.RowId.RowNumber);
134 int firstColumn = table.FindColumn(mutableTable.GetResolvedColumnName(0));
135 if (firstColumn == -1)
136 throw new InvalidOperationException(
"Search table does not contain any " +
137 "reference to table being updated from");
140 rowSet = table.ResolveRows(firstColumn, rowSet, mutableTable).ToList();
146 limit = Int32.MaxValue;
149 int len =
System.Math.Min(rowSet.Count, limit);
152 for (
int i = 0; i < len; ++i) {
153 int toUpdate = rowSet[i];
157 var row = mutableTable.GetRow(toUpdate);
161 foreach (var assignment
in assignList) {
162 row.EvaluateAssignment(assignment, context);
166 mutableTable.UpdateRow(row);
173 mutableTable.AssertConstraints();
The documentation for this class was generated from the following file: