Created
August 20, 2020 18:11
-
-
Save joncloud/e2408605ee6d4c884077ffbfbe08caa4 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
@db<sql_server "Data Source=.;Initial Catalog=db;Integrated Security=true;" | |
@db:list_people " | |
SELECT | |
TOP (@count) | |
p.id, p.first_name, p.last_name | |
FROM people p | |
ORDER BY p.last_name, p.first_name | |
" | |
@db:insert_person " | |
INSERT INTO people | |
(first_name, last_name) | |
VALUES(@first_name, @last_name) | |
" | |
$query_form <#form { | |
count: int32 optional(200) | |
} | |
!http:get "/" $query_form | |
<db.list_people model.query_form | |
$person_json <#json { | |
first_name: string required | |
last_name: string required | |
} | |
!http:post "/" $person_json | |
<db.insert_person model.person_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment