An abstract class for building Sql statements for a database. More...
Inherited by Foodolini.Database.Sql.Sqlite.
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. |
An abstract class for building Sql statements for a database.
Definition at line 13 of file SqlStrategy.cs.
abstract string Foodolini.Database.Sql.SqlStrategy.AllQuery | ( | string | table | ) | [pure virtual] |
Builds an Sql statement to query all rows in a table.
table | Table to query |
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
table | Table to create | |
columns | A IDictionary<System.String, Type> of column name and type |
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.
table | Table to delete from | |
identifier | Identifier key for the table |
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.
table | table to delete from | |
condition | Condition that must be met |
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.
table | A System.String table to insert into | |
parameters | A ICollection<System.String> list of parameters to insert |
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.
table | Table to query | |
page | Page to return sql statement for | |
pageSize | Number of entries per page |
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.
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 |
Implemented in Foodolini.Database.Sql.Sqlite.
abstract string Foodolini.Database.Sql.SqlStrategy.TableQuery | ( | ) | [pure virtual] |
Builds a query that lists 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.
table | A System.String Table to update | |
parameters | A ICollection<System.String> parameters to update in the row | |
identifier | Identifier in the table |
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.
table | A System.String table to execute the query on | |
condition | The condition to query |
Implemented in Foodolini.Database.Sql.Sqlite.