Last active
January 5, 2018 16:02
-
-
Save jbaxleyiii/2dc84dff19f6068f074429c19638c592 to your computer and use it in GitHub Desktop.
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
open Sql; | |
let model = | |
define( | |
~table="users", | |
~fields=[("id", UUID), ("firstName", String), ("lastName", String), ("email", String)] | |
); | |
Sql.findById(model, 123) | |
|> Js.Promise.then_( | |
(user) => | |
switch user { | |
| Some(usr) => Js.log(usr.firstName) | |
| None => Js.log("you don't exist") | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment