-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,15 @@ nbCode: | |
echo customer.user[] | ||
|
||
nbText: """ | ||
You can pass a `Model` subtype to `select` proc instead of the object instance. Norm will instantiate the container object implicitly: | ||
""" | ||
|
||
nbCode: | ||
let userFoo2 = dbConn.select(User, "email = ?", "[email protected]") | ||
echo() | ||
|
||
nbText: """ | ||
Note that this will only work with types that can be instantiated by calling `new <Type>`, i.e. types that don't require explicit instantiation. | ||
If you query relationships that are nested, such as when customers can have pets and you want to query all pets of all customers of users with a specific email address, you will need to concatenate the foreign-key fields, separeted by a `_` in your query. | ||
""" | ||
|
@@ -245,4 +254,4 @@ If you need to check if a row selected by a given condition exists, use `exists` | |
nbCode: | ||
echo dbConn.exists(Customer, "name = ?", "Alice") | ||
|
||
nbSave | ||
nbSave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters