This commit is contained in:
Moshe Dicker 2024-04-17 16:09:36 -04:00
parent 3c39d8456b
commit 3bae9cf5eb
1 changed files with 6 additions and 1 deletions

View File

@ -18,10 +18,14 @@ make common queries much easier to write.
The examples on this page use the database from the [setup]({{ '../setup.md' | pageUrl }})
instructions.
When manager generation is enabled (default), drift will generate a manager for each table in the database.
A collection of these managers are accessed by a getter `managers` on the database class.
Each table will have a manager generated for it unless it uses a custom row class.
## Select
The manager simplifies the process of retrieving rows from a table. Use it to read rows from the table or watch
for changes to the table.
for changes.
{% include "blocks/snippet" snippets = snippets name = 'manager_select' %}
@ -49,6 +53,7 @@ Use the `@ReferenceName(...)` on the foreign key to specify a custom name for th
{% include "blocks/snippet" snippets = snippets name = 'reference_name_example' %}
### Ordering
You can also order the results of a query using the `orderBy` method. The syntax is similar to the `filter` method.