-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(db): implement db.convert() (#368)
This commit implements `db.convert()` to convert hexadecimal strings on objects into binary representation for insertion into the database. It is demonstrated on both the patient groups controller and enterprises controller. It is used as described here: #321 (comment) ```js let data = req.body; // do some logic // convert the 'uuid' and 'debtor_uuid' properties to binary using // db.bid() data = db.convert(data, ['uuid', 'debtor_uuid']); // now I can db.exec('INSERT...') or db.exec('UPDATE ...') easily. It might help clean up the code a bit. ```
- Loading branch information
Showing
4 changed files
with
75 additions
and
82 deletions.
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
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
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