Foodolini.Database.Sql.SqlStrategy Class Reference

An abstract class for building Sql statements for a database. More...

Inherited by Foodolini.Database.Sql.Sqlite.

List of all members.

Public Member Functions

abstract string TableQuery ()
 Builds a query that lists all tables.
abstract string CreateTableQuery (string table, IDictionary< string, Type > columns, string primaryKey)
 Build an Sql statement for creating a table with specified colums.
abstract string InsertQuery (string table, ICollection< string > parameters)
 Builds an Sql statement to insert a row into table with parameters.
abstract string UpdateQuery (string table, ICollection< string > parameters, string identifier)
 Builds an Sql statement to update a row in a table with parameters.
abstract string WhereQuery (string table, string condition)
 Builds a query with a condition.
abstract string PagedWhereQuery (string table, string condition, int page, int pageSize)
 Builds a query with a condition and paging.
abstract string AllQuery (string table)
 Builds an Sql statement to query all rows in a table.
abstract string PagedQuery (string table, int page, int pageSize)
 Builds an Sql statement to query all rows in a table paged.
abstract string DeleteQuery (string table, string identifier)
 Builds an Sql statement to delete a row.
abstract string DeleteWhereQuery (string table, string condition)
 Creates an sql statement that deletes everything satisfying a condition.

Detailed Description

An abstract class for building Sql statements for a database.

Definition at line 13 of file SqlStrategy.cs.


Member Function Documentation

abstract string Foodolini.Database.Sql.SqlStrategy.AllQuery ( string  table  )  [pure virtual]

Builds an Sql statement to query all rows in a table.

Parameters:
table Table to query
Returns:
Sql statement

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.CreateTableQuery ( string  table,
IDictionary< string, Type >  columns,
string  primaryKey 
) [pure virtual]

Build an Sql statement for creating a table with specified colums.

This method may throw an SqlTypeException if the type is not supported

Parameters:
table Table to create
columns A IDictionary<System.String, Type> of column name and type
Returns:
An Sql statement to create the table

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.DeleteQuery ( string  table,
string  identifier 
) [pure virtual]

Builds an Sql statement to delete a row.

Parameters:
table Table to delete from
identifier Identifier key for the table
Returns:
An sql statement to delete a row

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.DeleteWhereQuery ( string  table,
string  condition 
) [pure virtual]

Creates an sql statement that deletes everything satisfying a condition.

Parameters:
table table to delete from
condition Condition that must be met
Returns:
An sql statement for deleting

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.InsertQuery ( string  table,
ICollection< string >  parameters 
) [pure virtual]

Builds an Sql statement to insert a row into table with parameters.

The parameters will be added to the query with the keyword @[parameter], where [parameter] is the name of the parameter. This query MUST also return the id of the row.

Parameters:
table A System.String table to insert into
parameters A ICollection<System.String> list of parameters to insert
Returns:
Sql statement to insert a row

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.PagedQuery ( string  table,
int  page,
int  pageSize 
) [pure virtual]

Builds an Sql statement to query all rows in a table paged.

Parameters:
table Table to query
page Page to return sql statement for
pageSize Number of entries per page
Returns:
Sql statement to query the table paged.

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.PagedWhereQuery ( string  table,
string  condition,
int  page,
int  pageSize 
) [pure virtual]

Builds a query with a condition and paging.

Parameters:
table A System.String table to execute the query on
condition The condition to query
page Page to return sql statement for
pageSize Number of entries per page
Returns:
An sql statement

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.TableQuery (  )  [pure virtual]

Builds a query that lists all tables.

Returns:
An sql statement for quering all tables

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.UpdateQuery ( string  table,
ICollection< string >  parameters,
string  identifier 
) [pure virtual]

Builds an Sql statement to update a row in a table with parameters.

The parameters will be added to the query with the keyword @[parameter], where [parameter] is the name of the parameter.

Parameters:
table A System.String Table to update
parameters A ICollection<System.String> parameters to update in the row
identifier Identifier in the table
Returns:
An Sql statement to update the row

Implemented in Foodolini.Database.Sql.Sqlite.

abstract string Foodolini.Database.Sql.SqlStrategy.WhereQuery ( string  table,
string  condition 
) [pure virtual]

Builds a query with a condition.

Parameters:
table A System.String table to execute the query on
condition The condition to query
Returns:
An sql statement

Implemented in Foodolini.Database.Sql.Sqlite.


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

Foodolini 1.0.0 Documentation, generated with DoxyGen.