-
Notifications
You must be signed in to change notification settings - Fork 0
SQLiteManager v1.0: Selecting data
Raphael Winkler edited this page May 29, 2022
·
1 revision
Returning data from our database is pretty easy! If we have a TableStructure named "table" we can do:
ResultSet result = table.Select();
This will return all rows from the selected table, but we can limit our results by adding conditions.
We're using our DatabaseStructure class from before in this example. With the "Condition" object we can limit the results of our SELECT:
ResultSet result = structure.songs.Select(new Condition(new KeyValuePair<IColumn, dynamic>(structure.users["name"], "John Doe")));
By adding a list of columns you can select which columns shall be returned in your result set
List<IColumn> columns = new List<IColumn>()
{
structure.songs["email"],
structure.songs["information"]
}
ResultSet result = structure.songs.Select(columns, new Condition(new KeyValuePair<IColumn, dynamic>(structure.users["name"], "John Doe")));
Or you can tell the database manager to exclude the tables you provide:
List<IColumn> columns = new List<IColumn>()
{
structure.songs["id"],
structure.songs["name"]
}
ResultSet result = structure.songs.Select(columns, true, new Condition(new KeyValuePair<IColumn, dynamic>(structure.users["name"], "John Doe")));
Next up: Add/Update/Delete
-
Home
- Tasty.Logging
-
Tasty.SQLiteManager
- SQLiteManager 2.0 and up:
- SQLiteManager 1.0.3 and below:
- Tasty.ViewModel