DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Package Functions | List of all members
Deveel.Data.Sql.Tables.TableInternalExtensions Class Reference

Static Package Functions

static int FindColumn (this ITable table, ObjectName columnName)
 
static int ColumnCount (this ITable table)
 
static ObjectName GetResolvedColumnName (this ITable table, int columnOffset)
 
static IEnumerable< int > ResolveRows (this ITable table, int columnOffset, IEnumerable< int > rows, ITable ancestor)
 
static ColumnIndex GetIndex (this ITable thisTable, int column, int originalColumn, ITable table)
 
static ITableVariableResolver GetVariableResolver (this ITable table)
 
static ObjectName ResolveColumnName (this ITable table, string columnName)
 
static RawTableInfo GetRawTableInfo (this ITable table)
 
static RawTableInfo GetRawTableInfo (this ITable table, RawTableInfo info)
 
static void Lock (this ITable table)
 
static void Release (this ITable table)
 

Detailed Description

Definition at line 24 of file TableInternalExtensions.cs.

Member Function Documentation

static int Deveel.Data.Sql.Tables.TableInternalExtensions.ColumnCount ( this ITable  table)
inlinestaticpackage

Definition at line 36 of file TableInternalExtensions.cs.

36  {
37  if (table is IQueryTable)
38  return ((IQueryTable)table).ColumnCount;
39 
40  return table.TableInfo.ColumnCount;
41  }
static int Deveel.Data.Sql.Tables.TableInternalExtensions.FindColumn ( this ITable  table,
ObjectName  columnName 
)
inlinestaticpackage

Definition at line 25 of file TableInternalExtensions.cs.

25  {
26  if (table is IQueryTable)
27  return ((IQueryTable)table).FindColumn(columnName);
28 
29  var parent = columnName.Parent;
30  if (!parent.Equals(table.TableInfo.TableName))
31  return -1;
32 
33  return table.TableInfo.IndexOfColumn(columnName.Name);
34  }
static ColumnIndex Deveel.Data.Sql.Tables.TableInternalExtensions.GetIndex ( this ITable  thisTable,
int  column,
int  originalColumn,
ITable  table 
)
inlinestaticpackage

Definition at line 63 of file TableInternalExtensions.cs.

63  {
64  if (thisTable is IQueryTable)
65  return ((IQueryTable)thisTable).GetIndex(column, originalColumn, table);
66 
67  var index = thisTable.GetIndex(column);
68  if (table == thisTable)
69  return index;
70 
71  // Otherwise, get the scheme to calculate a subset of the given scheme.
72  return index.GetSubset(table, originalColumn);
73  }
static RawTableInfo Deveel.Data.Sql.Tables.TableInternalExtensions.GetRawTableInfo ( this ITable  table)
inlinestaticpackage

Definition at line 87 of file TableInternalExtensions.cs.

87  {
88  return GetRawTableInfo(table, new RawTableInfo());
89  }
static RawTableInfo GetRawTableInfo(this ITable table)
static RawTableInfo Deveel.Data.Sql.Tables.TableInternalExtensions.GetRawTableInfo ( this ITable  table,
RawTableInfo  info 
)
inlinestaticpackage

Definition at line 91 of file TableInternalExtensions.cs.

91  {
92  if (table is IQueryTable)
93  return ((IQueryTable)table).GetRawTableInfo(info);
94 
95  throw new NotSupportedException();
96  }
static ObjectName Deveel.Data.Sql.Tables.TableInternalExtensions.GetResolvedColumnName ( this ITable  table,
int  columnOffset 
)
inlinestaticpackage

Definition at line 43 of file TableInternalExtensions.cs.

43  {
44  if (table is IQueryTable)
45  return ((IQueryTable)table).GetResolvedColumnName(columnOffset);
46 
47  var tableName = table.TableInfo.TableName;
48  var columnName = table.TableInfo[columnOffset].ColumnName;
49  return new ObjectName(tableName, columnName);
50  }
static ITableVariableResolver Deveel.Data.Sql.Tables.TableInternalExtensions.GetVariableResolver ( this ITable  table)
inlinestaticpackage

Definition at line 75 of file TableInternalExtensions.cs.

75  {
76  if (table is IQueryTable)
77  return ((IQueryTable)table).GetVariableResolver();
78 
79  // TODO: implement a default table resolver
80  throw new NotImplementedException();
81  }
static void Deveel.Data.Sql.Tables.TableInternalExtensions.Lock ( this ITable  table)
inlinestaticpackage

Definition at line 98 of file TableInternalExtensions.cs.

98  {
99  if (table is IQueryTable)
100  ((IQueryTable)table).Lock();
101  }
static void Deveel.Data.Sql.Tables.TableInternalExtensions.Release ( this ITable  table)
inlinestaticpackage

Definition at line 103 of file TableInternalExtensions.cs.

103  {
104  if (table is IQueryTable)
105  ((IQueryTable)table).Release();
106  }
static ObjectName Deveel.Data.Sql.Tables.TableInternalExtensions.ResolveColumnName ( this ITable  table,
string  columnName 
)
inlinestaticpackage

Definition at line 83 of file TableInternalExtensions.cs.

83  {
84  return new ObjectName(table.TableInfo.TableName, columnName);
85  }
static IEnumerable<int> Deveel.Data.Sql.Tables.TableInternalExtensions.ResolveRows ( this ITable  table,
int  columnOffset,
IEnumerable< int >  rows,
ITable  ancestor 
)
inlinestaticpackage

Definition at line 52 of file TableInternalExtensions.cs.

53  {
54  if (table is IQueryTable)
55  return ((IQueryTable)table).ResolveRows(columnOffset, rows, ancestor);
56 
57  if (table != ancestor)
58  throw new ArgumentException();
59 
60  return rows.ToList();
61  }

The documentation for this class was generated from the following file: