Skip to content

Instantly share code, notes, and snippets.

@joncloud
Created August 20, 2020 18:11
Show Gist options
  • Save joncloud/e2408605ee6d4c884077ffbfbe08caa4 to your computer and use it in GitHub Desktop.
Save joncloud/e2408605ee6d4c884077ffbfbe08caa4 to your computer and use it in GitHub Desktop.
@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