From bc4753c5028e29de1bf5afbbb91e5f89f5ea83cf Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 16 Mar 2016 08:31:40 -0400 Subject: [PATCH] [icfp] clean up SQL/sql --- icfp-2016/fig-stxclass.tex | 2 +- icfp-2016/implementation.scrbl | 5 +++-- icfp-2016/paper.scrbl | 6 ++++-- icfp-2016/usage.scrbl | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/icfp-2016/fig-stxclass.tex b/icfp-2016/fig-stxclass.tex index 0d47aab..f81b460 100644 --- a/icfp-2016/fig-stxclass.tex +++ b/icfp-2016/fig-stxclass.tex @@ -4,7 +4,7 @@ \mod{fun/domain} & Infer function domain types \\ \mod{num/value} & Evaluate a numeric expression \\ \mod{pattern/groups} & Count regexp groups \\ - \mod{query/constr} & Parse \mod{SQL} queries \\ + \mod{query/constr} & Parse {\tt sql} queries \\ \mod{schema/spec} & Lift a schema value from syntax \\ \mod{string/format} & Parse format directives \\ \mod{vector/length} & Infer length from a vector spec. \\ diff --git a/icfp-2016/implementation.scrbl b/icfp-2016/implementation.scrbl index 947538f..94064d9 100644 --- a/icfp-2016/implementation.scrbl +++ b/icfp-2016/implementation.scrbl @@ -26,7 +26,7 @@ Another 145 lines implement common functionality, putting the grand total Except for @exact|{\mod{db}}| and @exact|{\mod{regexp}}|, each of the core modules defines a single interpretation function (in @exact|{$\interp$}|). -In @exact|{\mod{db}}|, the two functions are the schema predicate and @tt{SQL} +In @exact|{\mod{db}}|, the two functions are the schema predicate and @tt{sql} query parser. In @exact|{\mod{regexp}}|, we have six group-parsing functions to match the six string-like input types @@ -423,7 +423,8 @@ By tagging calls to @racket[vector-map] with a syntax property, our system @centered[ @codeblock{ (vector-length (vector-map f v)) - == (vector-length v) + == + (vector-length v) } ] diff --git a/icfp-2016/paper.scrbl b/icfp-2016/paper.scrbl index ebdb9cb..6df0115 100644 --- a/icfp-2016/paper.scrbl +++ b/icfp-2016/paper.scrbl @@ -38,8 +38,10 @@ @include-section{implementation.scrbl} @include-section{conclusion.scrbl} -@;@section[#:style 'unnumbered]{Acknowledgments} -@; +@section[#:style 'unnumbered]{Acknowledgments} + +To appear + @;We thank @;Sam Tobin-Hochstadt for reminding us that Typed Racket is macro-extensible, @;Ryan Culpepper for divulging secrets of the Racket macro system, diff --git a/icfp-2016/usage.scrbl b/icfp-2016/usage.scrbl index 6bac839..78f64bc 100644 --- a/icfp-2016/usage.scrbl +++ b/icfp-2016/usage.scrbl @@ -384,13 +384,13 @@ We do, however, optimize vector references to unsafe primitives and @; ============================================================================= @section[#:tag "sec:sql"]{Database Schema} -Racket's @racket[db] library provides a string-based API for executing SQL +Racket's @racket[db] library provides a string-based API for executing @tt{sql} queries.@note{In this section, we use @tt{sql} as an abbreviation for @tt{postgresql}.} -After connecting to a database, SQL queries embedded in strings can be run +After connecting to a database, @tt{sql} queries embedded in strings can be run to retrieve row values, represented as Racket vectors. Queries may optionally contain @emph{query parameters}---natural numbers prefixed by a dollar sign (@tt{$}). -Arguments substituted for query parameters are guarded against SQL injection. +Arguments substituted for query parameters are guarded against @tt{sql} injection. @exact|{ \begin{SCodeFlow}\begin{RktBlk}\begin{SingleColumn}\RktSym{{\Stttextmore}}\mbox{\hphantom{\Scribtexttt{x}}}\RktPn{(}\RktSym{define}\mbox{\hphantom{\Scribtexttt{x}}}\RktSym{C}\mbox{\hphantom{\Scribtexttt{x}}}\RktPn{(}\RktSym{sql{-}connect}\mbox{\hphantom{\Scribtexttt{x}}}\RktPn{\#{\hbox{\texttt{:}}}user}\mbox{\hphantom{\Scribtexttt{x}}}\RktVal{"admin"}