Skip to content

Commit

Permalink
update changelog & nimibook
Browse files Browse the repository at this point in the history
  • Loading branch information
Clonkk authored and Regis Caillaud committed Sep 12, 2022
1 parent bf33325 commit d5dbc22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions book/tutorial/rows.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ When Norm attempts to insert `alice`, it detects that `userFoo` that it referenc
With `bob`, there's no need to do that since `userFoo` is already in the database.
When inserting norm Model, it is possible to force the id to a given value by setting the id attribute of the Model. In order for the insertion to proceed, it is necessary to specify ``force=true`` when inserting:
"""

nbCode:
var userBaz = newUser("baz@baz.baz")
userBaz.id = 156
with dbConn:
insert(userBaz, force = true)
echo "userBaz.id == 156 ?", (userBaz.id == 156)

echo()

nbText: &"""
## Select Row
### Select in general
To select a rows with Norm, you instantiate a model that serves as a container for the selected data and call `select`.
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [r] Logging: refactored `log` module to not trigger warnings when `normDebug` is not defined.
- [r] Slightly changed how objects are being parsed, leading to a small performance increase
- [+] Added `rawSelect` proc, which allows you execute raw SQL and have the output be parsed into a custom object-type
- [r] `insert` with obj.id != 0 and `force=true` now uses the id provided

## 2.5.1 (July 20, 2022)
- [+] Added `uniqueGroup` pragma to provide UNIQUE constraint on multiple columns (see [#136](https://github.com/moigagoo/norm/issues/136)).
Expand Down

0 comments on commit d5dbc22

Please sign in to comment.