C# Class Deveel.Data.Sql.Tables.TableQueryExtensions

Provides a set of extension methods to ITable and IMutableTable objects.
Show file Open project: deveel/deveeldb

Public Methods

Method Description
AllRowsMatchColumnValue ( this table, int columnOffset, SqlExpressionType op, Field value ) : bool
AnyRowMatchesColumnValue ( this table, int columnOffset, SqlExpressionType op, Field value ) : bool
Composite ( this table, ITable other, CompositeFunction function, bool all ) : ITable
DistinctBy ( this table, ObjectName columnNames ) : ITable
DistinctBy ( this table, int columns ) : ITable
EmptySelect ( this table ) : ITable
Execept ( this table, ITable other, bool all ) : ITable
ExhaustiveSelect ( this table, IRequest context, SqlExpression expression ) : ITable
Exists ( this table, int columnOffset, Field value ) : bool
Exists ( this table, int columnOffset1, Field value1, int columnOffset2, Field value2 ) : bool
FindKeys ( this table, int columnOffsets, Field keyValue ) : IEnumerable
GetColumn ( this table, int columnOffset ) : Column
GetColumn ( this table, string columnName ) : Column
GetFirstValue ( this table, int columnOffset ) : Field
GetFirstValue ( this table, string columnName ) : Field
GetFirstValues ( this table, int columnOffsets ) : Field[]
GetLastValue ( this table, int columnOffset ) : Field
GetLastValue ( this table, string columnName ) : Field
GetLastValues ( this table, int columnOffsets ) : Field[]
GetRow ( this table, int rowNumber ) : Deveel.Data.Sql.Tables.Row
GetSingleValue ( this table, int columnOffset ) : Field
GetSingleValue ( this table, string columnName ) : Field
GetSingleValues ( this table, int columnOffsets ) : Field[]
GetValue ( this table, int rowIndex, ObjectName columnName ) : Field
GetValue ( this table, int rowIndex, string columnName ) : Field
IndexOfColumn ( this table, ObjectName columnName ) : int
IndexOfColumn ( this table, string columnName ) : int
Intersect ( this table, ITable other, bool all ) : ITable
Join ( this table, IRequest context, ITable other, ObjectName columnName, SqlExpressionType operatorType, SqlExpression expression ) : ITable
Join ( this table, ITable otherTable, bool quick ) : ITable
NaturalJoin ( this table, ITable otherTable ) : ITable
NotIn ( this table, ITable otherTable, int tableColumns, int otherColumns ) : ITable
OrderBy ( this table, ObjectName columnName, bool ascending ) : ITable
OrderBy ( this table, int columns ) : ITable
OrderBy ( this table, int columnIndex, bool ascending ) : ITable
OrderBy ( this table, string columnName, bool ascending ) : ITable
OrderRowsByColumns ( this table, int columns ) : IEnumerable
OuterJoin ( this table, ITable rightTable ) : ITable
Search ( this table, int column, string pattern ) : IEnumerable
Search ( this table, int column, string pattern, char escapeChar ) : IEnumerable
SelecRowsLess ( this table, int columnOffset, Field value ) : IEnumerable
SelecRowsLess ( this table, int columnOffset, System.Objects value ) : IEnumerable
Select ( this table, IRequest context, SqlExpression expression ) : ITable
SelectAll ( this table, int columnOffset ) : ITable
SelectAllRows ( this table ) : IEnumerable
SelectAllRows ( this table, int columnOffset ) : IEnumerable
SelectAnyAllNonCorrelated ( this table, ObjectName leftColumns, SqlExpressionType op, bool all, ITable rightTable ) : ITable
SelectEqual ( this table, int columnIndex, Field value ) : ITable
SelectEqual ( this table, string columnName, Field value ) : ITable
SelectFirst ( this table, int columnOffset ) : IEnumerable
SelectFromPattern ( this table, int column, SqlExpressionType op, Field ob ) : IEnumerable
SelectLast ( this table, int columnOffset ) : IEnumerable
SelectNotEqual ( this table, int columnOffset, Field value ) : IEnumerable
SelectNotEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
SelectRange ( this thisTable, ObjectName columnName, IndexRange ranges ) : ITable
SelectRows ( this table, IVariableResolver resolver, IRequest context, SqlBinaryExpression expression ) : IEnumerable
SelectRows ( this table, int columnOffsets, SqlExpressionType op, Field values ) : IEnumerable
SelectRowsBetween ( this table, int column, Field minCell, Field maxCell ) : IEnumerable
SelectRowsEqual ( this table, int columnIndex, Field value ) : IEnumerable
SelectRowsEqual ( this table, int columnIndex1, Field value1, int columnIndex2, Field value2 ) : IEnumerable
SelectRowsEqual ( this table, string columnName, Field value ) : IEnumerable
SelectRowsGreater ( this table, int columnOffset, Field value ) : IEnumerable
SelectRowsGreater ( this table, int columnOffset, System.Objects value ) : IEnumerable
SelectRowsGreaterOrEqual ( this table, int columnOffset, Field value ) : IEnumerable
SelectRowsGreaterOrEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
SelectRowsIn ( this table, ITable other, int column1, int column2 ) : IEnumerable

This implements the in command.

SelectRowsLessOrEqual ( this table, int columnOffset, Field value ) : IEnumerable
SelectRowsLessOrEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
SelectRowsNotIn ( this table, ITable other, int col1, int col2 ) : IEnumerable

This implements the not in command.

Issue: This will be less efficient than in if table has many rows and other has few rows.

SelectRowsRange ( this table, int column, IndexRange ranges ) : IEnumerable
SimpleJoin ( this thisTable, IRequest context, ITable other, SqlBinaryExpression binary ) : ITable
SimpleSelect ( this table, IRequest context, ObjectName columnName, SqlExpressionType op, SqlExpression exp ) : ITable
Subset ( this table, ObjectName columnNames, ObjectName aliases ) : ITable
ToDictionary ( this table ) : Objects.ISqlObject>.Dictionary
Union ( this thisTable, ITable otherTable ) : ITable

Private Methods

Method Description
AsVirtual ( this table, Func selector ) : ITable
MakeObject ( this table, int columnOffset, System.Objects value ) : Field

Method Details

AllRowsMatchColumnValue() public static method

public static AllRowsMatchColumnValue ( this table, int columnOffset, SqlExpressionType op, Field value ) : bool
table this
columnOffset int
op SqlExpressionType
value Field
return bool

AnyRowMatchesColumnValue() public static method

public static AnyRowMatchesColumnValue ( this table, int columnOffset, SqlExpressionType op, Field value ) : bool
table this
columnOffset int
op SqlExpressionType
value Field
return bool

Composite() public static method

public static Composite ( this table, ITable other, CompositeFunction function, bool all ) : ITable
table this
other ITable
function CompositeFunction
all bool
return ITable

DistinctBy() public static method

public static DistinctBy ( this table, ObjectName columnNames ) : ITable
table this
columnNames ObjectName
return ITable

DistinctBy() public static method

public static DistinctBy ( this table, int columns ) : ITable
table this
columns int
return ITable

EmptySelect() public static method

public static EmptySelect ( this table ) : ITable
table this
return ITable

Execept() public static method

public static Execept ( this table, ITable other, bool all ) : ITable
table this
other ITable
all bool
return ITable

ExhaustiveSelect() public static method

public static ExhaustiveSelect ( this table, IRequest context, SqlExpression expression ) : ITable
table this
context IRequest
expression Deveel.Data.Sql.Expressions.SqlExpression
return ITable

Exists() public static method

public static Exists ( this table, int columnOffset, Field value ) : bool
table this
columnOffset int
value Field
return bool

Exists() public static method

public static Exists ( this table, int columnOffset1, Field value1, int columnOffset2, Field value2 ) : bool
table this
columnOffset1 int
value1 Field
columnOffset2 int
value2 Field
return bool

FindKeys() public static method

public static FindKeys ( this table, int columnOffsets, Field keyValue ) : IEnumerable
table this
columnOffsets int
keyValue Field
return IEnumerable

GetColumn() public static method

public static GetColumn ( this table, int columnOffset ) : Column
table this
columnOffset int
return Column

GetColumn() public static method

public static GetColumn ( this table, string columnName ) : Column
table this
columnName string
return Column

GetFirstValue() public static method

public static GetFirstValue ( this table, int columnOffset ) : Field
table this
columnOffset int
return Field

GetFirstValue() public static method

public static GetFirstValue ( this table, string columnName ) : Field
table this
columnName string
return Field

GetFirstValues() public static method

public static GetFirstValues ( this table, int columnOffsets ) : Field[]
table this
columnOffsets int
return Field[]

GetLastValue() public static method

public static GetLastValue ( this table, int columnOffset ) : Field
table this
columnOffset int
return Field

GetLastValue() public static method

public static GetLastValue ( this table, string columnName ) : Field
table this
columnName string
return Field

GetLastValues() public static method

public static GetLastValues ( this table, int columnOffsets ) : Field[]
table this
columnOffsets int
return Field[]

GetRow() public static method

public static GetRow ( this table, int rowNumber ) : Deveel.Data.Sql.Tables.Row
table this
rowNumber int
return Deveel.Data.Sql.Tables.Row

GetSingleValue() public static method

public static GetSingleValue ( this table, int columnOffset ) : Field
table this
columnOffset int
return Field

GetSingleValue() public static method

public static GetSingleValue ( this table, string columnName ) : Field
table this
columnName string
return Field

GetSingleValues() public static method

public static GetSingleValues ( this table, int columnOffsets ) : Field[]
table this
columnOffsets int
return Field[]

GetValue() public static method

public static GetValue ( this table, int rowIndex, ObjectName columnName ) : Field
table this
rowIndex int
columnName ObjectName
return Field

GetValue() public static method

public static GetValue ( this table, int rowIndex, string columnName ) : Field
table this
rowIndex int
columnName string
return Field

IndexOfColumn() public static method

public static IndexOfColumn ( this table, ObjectName columnName ) : int
table this
columnName ObjectName
return int

IndexOfColumn() public static method

public static IndexOfColumn ( this table, string columnName ) : int
table this
columnName string
return int

Intersect() public static method

public static Intersect ( this table, ITable other, bool all ) : ITable
table this
other ITable
all bool
return ITable

Join() public static method

public static Join ( this table, IRequest context, ITable other, ObjectName columnName, SqlExpressionType operatorType, SqlExpression expression ) : ITable
table this
context IRequest
other ITable
columnName ObjectName
operatorType SqlExpressionType
expression Deveel.Data.Sql.Expressions.SqlExpression
return ITable

Join() public static method

public static Join ( this table, ITable otherTable, bool quick ) : ITable
table this
otherTable ITable
quick bool
return ITable

NaturalJoin() public static method

public static NaturalJoin ( this table, ITable otherTable ) : ITable
table this
otherTable ITable
return ITable

NotIn() public static method

public static NotIn ( this table, ITable otherTable, int tableColumns, int otherColumns ) : ITable
table this
otherTable ITable
tableColumns int
otherColumns int
return ITable

OrderBy() public static method

public static OrderBy ( this table, ObjectName columnName, bool ascending ) : ITable
table this
columnName ObjectName
ascending bool
return ITable

OrderBy() public static method

public static OrderBy ( this table, int columns ) : ITable
table this
columns int
return ITable

OrderBy() public static method

public static OrderBy ( this table, int columnIndex, bool ascending ) : ITable
table this
columnIndex int
ascending bool
return ITable

OrderBy() public static method

public static OrderBy ( this table, string columnName, bool ascending ) : ITable
table this
columnName string
ascending bool
return ITable

OrderRowsByColumns() public static method

public static OrderRowsByColumns ( this table, int columns ) : IEnumerable
table this
columns int
return IEnumerable

OuterJoin() public static method

public static OuterJoin ( this table, ITable rightTable ) : ITable
table this
rightTable ITable
return ITable

Search() public static method

public static Search ( this table, int column, string pattern ) : IEnumerable
table this
column int
pattern string
return IEnumerable

Search() public static method

public static Search ( this table, int column, string pattern, char escapeChar ) : IEnumerable
table this
column int
pattern string
escapeChar char
return IEnumerable

SelecRowsLess() public static method

public static SelecRowsLess ( this table, int columnOffset, Field value ) : IEnumerable
table this
columnOffset int
value Field
return IEnumerable

SelecRowsLess() public static method

public static SelecRowsLess ( this table, int columnOffset, System.Objects value ) : IEnumerable
table this
columnOffset int
value System.Objects
return IEnumerable

Select() public static method

public static Select ( this table, IRequest context, SqlExpression expression ) : ITable
table this
context IRequest
expression Deveel.Data.Sql.Expressions.SqlExpression
return ITable

SelectAll() public static method

public static SelectAll ( this table, int columnOffset ) : ITable
table this
columnOffset int
return ITable

SelectAllRows() public static method

public static SelectAllRows ( this table ) : IEnumerable
table this
return IEnumerable

SelectAllRows() public static method

public static SelectAllRows ( this table, int columnOffset ) : IEnumerable
table this
columnOffset int
return IEnumerable

SelectAnyAllNonCorrelated() public static method

public static SelectAnyAllNonCorrelated ( this table, ObjectName leftColumns, SqlExpressionType op, bool all, ITable rightTable ) : ITable
table this
leftColumns ObjectName
op SqlExpressionType
all bool
rightTable ITable
return ITable

SelectEqual() public static method

public static SelectEqual ( this table, int columnIndex, Field value ) : ITable
table this
columnIndex int
value Field
return ITable

SelectEqual() public static method

public static SelectEqual ( this table, string columnName, Field value ) : ITable
table this
columnName string
value Field
return ITable

SelectFirst() public static method

public static SelectFirst ( this table, int columnOffset ) : IEnumerable
table this
columnOffset int
return IEnumerable

SelectFromPattern() public static method

public static SelectFromPattern ( this table, int column, SqlExpressionType op, Field ob ) : IEnumerable
table this
column int
op SqlExpressionType
ob Field
return IEnumerable

SelectLast() public static method

public static SelectLast ( this table, int columnOffset ) : IEnumerable
table this
columnOffset int
return IEnumerable

SelectNotEqual() public static method

public static SelectNotEqual ( this table, int columnOffset, Field value ) : IEnumerable
table this
columnOffset int
value Field
return IEnumerable

SelectNotEqual() public static method

public static SelectNotEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
table this
columnOffset int
value System.Objects
return IEnumerable

SelectRange() public static method

public static SelectRange ( this thisTable, ObjectName columnName, IndexRange ranges ) : ITable
thisTable this
columnName ObjectName
ranges Deveel.Data.Index.IndexRange
return ITable

SelectRows() public static method

public static SelectRows ( this table, IVariableResolver resolver, IRequest context, SqlBinaryExpression expression ) : IEnumerable
table this
resolver IVariableResolver
context IRequest
expression Deveel.Data.Sql.Expressions.SqlBinaryExpression
return IEnumerable

SelectRows() public static method

public static SelectRows ( this table, int columnOffsets, SqlExpressionType op, Field values ) : IEnumerable
table this
columnOffsets int
op SqlExpressionType
values Field
return IEnumerable

SelectRowsBetween() public static method

public static SelectRowsBetween ( this table, int column, Field minCell, Field maxCell ) : IEnumerable
table this
column int
minCell Field
maxCell Field
return IEnumerable

SelectRowsEqual() public static method

public static SelectRowsEqual ( this table, int columnIndex, Field value ) : IEnumerable
table this
columnIndex int
value Field
return IEnumerable

SelectRowsEqual() public static method

public static SelectRowsEqual ( this table, int columnIndex1, Field value1, int columnIndex2, Field value2 ) : IEnumerable
table this
columnIndex1 int
value1 Field
columnIndex2 int
value2 Field
return IEnumerable

SelectRowsEqual() public static method

public static SelectRowsEqual ( this table, string columnName, Field value ) : IEnumerable
table this
columnName string
value Field
return IEnumerable

SelectRowsGreater() public static method

public static SelectRowsGreater ( this table, int columnOffset, Field value ) : IEnumerable
table this
columnOffset int
value Field
return IEnumerable

SelectRowsGreater() public static method

public static SelectRowsGreater ( this table, int columnOffset, System.Objects value ) : IEnumerable
table this
columnOffset int
value System.Objects
return IEnumerable

SelectRowsGreaterOrEqual() public static method

public static SelectRowsGreaterOrEqual ( this table, int columnOffset, Field value ) : IEnumerable
table this
columnOffset int
value Field
return IEnumerable

SelectRowsGreaterOrEqual() public static method

public static SelectRowsGreaterOrEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
table this
columnOffset int
value System.Objects
return IEnumerable

SelectRowsIn() public static method

This implements the in command.
public static SelectRowsIn ( this table, ITable other, int column1, int column2 ) : IEnumerable
table this
other ITable
column1 int
column2 int
return IEnumerable

SelectRowsLessOrEqual() public static method

public static SelectRowsLessOrEqual ( this table, int columnOffset, Field value ) : IEnumerable
table this
columnOffset int
value Field
return IEnumerable

SelectRowsLessOrEqual() public static method

public static SelectRowsLessOrEqual ( this table, int columnOffset, System.Objects value ) : IEnumerable
table this
columnOffset int
value System.Objects
return IEnumerable

SelectRowsNotIn() public static method

This implements the not in command.
Issue: This will be less efficient than in if table has many rows and other has few rows.
public static SelectRowsNotIn ( this table, ITable other, int col1, int col2 ) : IEnumerable
table this
other ITable
col1 int
col2 int
return IEnumerable

SelectRowsRange() public static method

public static SelectRowsRange ( this table, int column, IndexRange ranges ) : IEnumerable
table this
column int
ranges Deveel.Data.Index.IndexRange
return IEnumerable

SimpleJoin() public static method

public static SimpleJoin ( this thisTable, IRequest context, ITable other, SqlBinaryExpression binary ) : ITable
thisTable this
context IRequest
other ITable
binary Deveel.Data.Sql.Expressions.SqlBinaryExpression
return ITable

SimpleSelect() public static method

public static SimpleSelect ( this table, IRequest context, ObjectName columnName, SqlExpressionType op, SqlExpression exp ) : ITable
table this
context IRequest
columnName ObjectName
op SqlExpressionType
exp Deveel.Data.Sql.Expressions.SqlExpression
return ITable

Subset() public static method

public static Subset ( this table, ObjectName columnNames, ObjectName aliases ) : ITable
table this
columnNames ObjectName
aliases ObjectName
return ITable

ToDictionary() public static method

public static ToDictionary ( this table ) : Objects.ISqlObject>.Dictionary
table this
return Objects.ISqlObject>.Dictionary

Union() public static method

public static Union ( this thisTable, ITable otherTable ) : ITable
thisTable this
otherTable ITable
return ITable