SSQLE  1.0
Simple SQL Editor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SSQLE.QueryResult Class Reference

Class, used to represent results from executed query by the database. More...

Classes

class  QueryResultBuilder
 Class used to visualise results of the query. More...
 

Public Member Functions

void SaveToCsv (TextWriter writer)
 Saves the result of the query to CSV format More...
 
void SaveToInsertStatement (TextWriter writer)
 Saves the result of the query to SQL INSERT statement format. More...
 
override string ToString ()
 Returns textual representation of query result. More...
 

Static Public Member Functions

static QueryResult FromOracleDataReader (OracleAccess.OracleDataReader reader, TimeSpan elapsed)
 Factory method used to create instance of QueryResult from underlaying ODP.NET OracleDataReader. More...
 

Public Attributes

string ElapsedTime => elapsed.TotalSeconds.ToString(CultureInfo.CurrentUICulture)
 Time, that took the query to execute, in seconds. More...
 

Private Member Functions

 QueryResult (TimeSpan elapsed, int recordsAffected, IList< string > columns, int[] columnSizes, IList< Type > columnTypes, IList< IList< object >> data)
 Constructs new instance of QueryResult with given arguments. More...
 

Static Private Member Functions

static void UpdateMaximum (ref int number, int newValue)
 Method used to update maximum of number passed by reference. More...
 

Private Attributes

readonly int recordsAffected
 Number of records affected by the query. More...
 
readonly TimeSpan elapsed
 Time, that took the query to execute. More...
 
readonly IList< string > columns
 Column names from the SELECT statement. More...
 
readonly int[] columnSizes
 Maximum column widths. More...
 
readonly IList< Type > columnTypes
 Types of the columns from the SELECT statement. More...
 
readonly IList< IList< object > > data
 Table representing data of the SELECT statement. More...
 
const string CsvDelimiter = ","
 Item delimiter in CSV format. (,) More...
 
const string SqlExpressionDelimiter = ", "
 Item delimiter in SQL expressions. (, ) More...
 
const string QuotationMark = "'"
 Quotation mark used in SQL statements to ensure string literal. (') More...
 

Detailed Description

Class, used to represent results from executed query by the database.

Constructor & Destructor Documentation

SSQLE.QueryResult.QueryResult ( TimeSpan  elapsed,
int  recordsAffected,
IList< string >  columns,
int[]  columnSizes,
IList< Type >  columnTypes,
IList< IList< object >>  data 
)
private

Constructs new instance of QueryResult with given arguments.

Parameters
elapsedTime, that took the query to execute.
recordsAffectedRecords affected by the query.
columnsColumn names from the SELECT statement.
columnSizesMaximum column widths.
columnTypesTypes of the columns from the SELECT statement.
dataTable representing data of the SELECT statement.

Member Function Documentation

static QueryResult SSQLE.QueryResult.FromOracleDataReader ( OracleAccess.OracleDataReader  reader,
TimeSpan  elapsed 
)
static

Factory method used to create instance of QueryResult from underlaying ODP.NET OracleDataReader.

Parameters
readerReader, from which result shall be taken.
elapsedTime, that took the query to execute.
Returns
Newly constructed QueryResult with coresponding data.
void SSQLE.QueryResult.SaveToCsv ( TextWriter  writer)

Saves the result of the query to CSV format

Parameters
writerTextWriter to write CSV to.
void SSQLE.QueryResult.SaveToInsertStatement ( TextWriter  writer)

Saves the result of the query to SQL INSERT statement format.

Parameters
writerTextWriter to write to.
override string SSQLE.QueryResult.ToString ( )

Returns textual representation of query result.

Returns
Textual representation of query result.

Shows either columns with selected values if used to visualise SELECT statement or number of affected records by the statement in other cases.

static void SSQLE.QueryResult.UpdateMaximum ( ref int  number,
int  newValue 
)
staticprivate

Method used to update maximum of number passed by reference.

Parameters
numberNumber to potentionaly update.
newValueValue to update number with.

Member Data Documentation

readonly IList<string> SSQLE.QueryResult.columns
private

Column names from the SELECT statement.

readonly int [] SSQLE.QueryResult.columnSizes
private

Maximum column widths.

readonly IList<Type> SSQLE.QueryResult.columnTypes
private

Types of the columns from the SELECT statement.

const string SSQLE.QueryResult.CsvDelimiter = ","
private

Item delimiter in CSV format. (,)

readonly IList<IList<object> > SSQLE.QueryResult.data
private

Table representing data of the SELECT statement.

readonly TimeSpan SSQLE.QueryResult.elapsed
private

Time, that took the query to execute.

string SSQLE.QueryResult.ElapsedTime => elapsed.TotalSeconds.ToString(CultureInfo.CurrentUICulture)

Time, that took the query to execute, in seconds.

const string SSQLE.QueryResult.QuotationMark = "'"
private

Quotation mark used in SQL statements to ensure string literal. (')

readonly int SSQLE.QueryResult.recordsAffected
private

Number of records affected by the query.

const string SSQLE.QueryResult.SqlExpressionDelimiter = ", "
private

Item delimiter in SQL expressions. (, )


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