!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable experimental Chris Done <chrisdone@gmail.com>None:Wrap a mostly-binary string to be escaped in hexadecimal. $Wrap a list of values for use in an IN clause. Replaces a  single "?"1 character with a parenthesized list of rendered  values.  Example: = query c "select * from whatever where id in ?" (In [3,4,5]) A single-value " collection". AThis is useful if you need to supply a single parameter to a SQL 6 query, or extract a single column from a SQL result. Parameter example:  query c " select x from scores where x > ?" ( (42::Int))Result example: xs < - query_ c "select id from users"  forM_ xs $ \( id) -> {- ... -}>A query string. This type is intended to make it difficult to E construct a SQL query by concatenating string fragments, as that is A an extremely common way to accidentally introduce SQL injection & vulnerabilities into an application. This type is an instance of , so the easiest way to $ construct a query is to enable the OverloadedStrings language = extension and then simply write the query in double quotes.  $ {-# LANGUAGE OverloadedStrings #-}   import Database.MySQL.Simple   q :: Query  q = "select ?" The underlying type is a , and literal Haskell strings B that contain Unicode characters will be correctly transformed to  UTF-8. A placeholder for the SQL NULL value.      portable experimental Chris Done <chrisdone@gmail.com>None >A type that may be used as a single parameter to a SQL query. 6Prepare a value for substitution into a query string. <How to render an element when substituting it into a query. +Concatenate a series of rendering actions. >Escape and enclose in quotes before substituting. Use for all < text-like types, and anything else that may contain unsafe  characters when rendered. ;Render without escaping or quoting. Use for non-text types  such as numbers, when you are certain that they will not A introduce formatting vulnerabilities via use of characters such  as spaces or "'". 0Surround a string with single-quote characters: "'" This function does not perform any other escaping. %   !  portable experimental Chris Done <chrisdone@gmail.com>None>A collection type that can be turned into a list of rendering  s. Instances should use the   method of the   class : to perform conversion of each element of the collection. Render a collection of values.   Safe-InferredA connection pool. A PostgreSQL object ID. A type-specific modifier. BA text format code. Will always be TextCode for DESCRIBE queries. "A field size. &8 bytes, time of day (no date) 'date, 4 bytes julian day ( timestamp with time zone ) timestamp without time zone 0More information about PostgreSQL s dates here:   Dhttp://www.postgresql.org/docs/current/static/datatype-datetime.html *(boolean, 1 byte, state of true or false + text, variable unlimited length 7Lazy. Decoded from UTF-8 into Haskell native encoding. ,$character(n), char(n), fixed-length -2character varying(n), varchar(n), variable-length .%8 bytes, variable-precision, inexact /%4 bytes, variable-precision, inexact 04variable, user-specified precision, exact, no limit 14variable, user-specified precision, exact, no limit 28 bytes large-range integer 3"4 bytes, usual choice for integer 42 bytes, small-range integer 5A field description. 9An internal message type. EResult of a database query. MA database connection. QConnection configuration. Z1Unsupported method of authentication (e.g. md5). [/Connection was lost when using withConnection. \1Initialization (e.g. getting data types) failed. ]1Connecting failed due to authentication problem. ^The query was empty. _Query returned an error. L !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_K !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_KQRSTUVWMNOP5678EFGHIJKL%43210/.-,+*)('&9DCBA@?>=<;:"$#! X_^]\[ZY! "$#%43210/.-,+*)('&56789 DCBA@?>=<;:EFGHIJKLMNOPQRSTUVWX_^]\[ZYportable experimental Chris Done <chrisdone@gmail.com>None`.A type that may be converted from a SQL type. a(Convert a SQL value to a Haskell value.  Throws a b if conversion fails. b=Exception thrown if conversion from a SQL value to a Haskell  value fails. c0The SQL value could not be parsed, or could not 0 be represented as a valid Haskell value, or an 4 unexpected low-level error occurred (e.g. mismatch - between metadata and actual data in a row). dA SQL NULL" was encountered when the Haskell  type did not permit it. e.The SQL and Haskell types are not compatible. 3`abcdefgh `abcdefgh`abedcfghfghfgh+`ab edcfghfghfghportable experimental Chris Done <chrisdone@gmail.com>Nonej5Convert values from a row into a Haskell collection. This function will throw a b if conversion of the  collection fails. kThrow a c" exception, indicating a mismatch & between the number of columns in the 5 and row, and the . number in the collection to be converted to. ijkijkijk ijkNone&l1Default information for setting up a connection. Defaults are as follows:  Server on  localhost  User postgres  No password  Database test  Character set utf8 !Use as in the following example: ? connect defaultConnectInfo { connectHost = "db.example.com" } mCreate a new connection pool. n#Connect using the connection pool. "Restore a connection to the pool. oUse the connection pool. pBConnect with the given username to the given database. Will throw & an exception if it cannot connect. q;Run a an action with a connection and close the connection - afterwards (protects against exceptions). rBWith a transaction, do some action (protects against exceptions). sRollback a transaction. tCommit a transaction. uBegin a transaction. v>Close a connection. Can safely be called any number of times. w$Run a simple query on a connection. $Run a simple query on a connection. xExec a command. ;PostgreSQL protocol version supported by this library.  Escape a string for PostgreSQL. y Escape a string for PostgreSQL. )Run the connectInfoentication procedure. Send the start-up message. IWait for and process the connectInfoentication response from the server. ;Send the pass as clear text and wait for connect response. Send a simple query. CCommandComplete returns a tag  which indicates how many rows were 4 affected, or returned, as a result of the command.  See http:developer.postgresql.orgpgdocspostgres/protocol-message-formats.html *Update the row description of the result. Parse a row description. "Parts of the row description are: String: The field name. @Int32: If the field can be identified as a column of a specific 4 table, the object ID of the table; otherwise zero. @Int16: If the field can be identified as a column of a specific < table, the attribute number of the column; otherwise zero. Parse a number into a type.  Parse a type's size.  parseSize :: Int16 -> Size  parseSize (-1) = Varying  parseSize n = Size n &Parse a format code (text or binary).  Add a data row to the response. %Blocks until receives ReadyForQuery. HAtomically perform an action with the database handle, if there is one. ?Send a block of bytes on a handle, prepending the message type  and complete length. CSend a block of bytes on a handle, prepending the complete length. 'Get a message (block) from the stream. EPut a Haskell string, encoding it to UTF-8, and null-terminating it. Put a Haskell 32-bit integer.  Put zero-byte terminator.  ;To avoid magic numbers, size of a 32-bit integer in bytes. 0lmConnect info. noThe connection pool. Use the connection. pThe datase connection. qrstuvThe connection. wThe connection.  The query. The connection.  The query. xy     lmnopqrstuvwxyustwxyplvqrmno0lmnopqrstuvwxy     portable experimental Chris Done <chrisdone@gmail.com>None zA processed, appendable. query {Exception thrown if  is used to perform an INSERT-like  operation, or  is used to perform a SELECT-like operation. ~Exception thrown if a # could not be formatted correctly. ! This may occur if the number of '?' characters in the query : string does not match the number of parameters provided. Format a query string. 6Format a query string with a variable number of rows. DThis function is exposed to help with debugging and logging. Do not * use it to prepare queries for execution. >The query string must contain exactly one substitution group,  identified by the SQL keyword "VALUES" (case insensitive)  followed by an "("$ character, a series of one or more "?" ' characters separated by commas, and a ")" character. White - space in a substitution group is permitted. Throws ~, if the query string could not be formatted  correctly.  Execute an INSERT, UPDATE!, or other SQL query that is not  expected to return results. %Returns the number of rows affected. Throws ~0 if the query could not be formatted correctly.  A version of + that does not perform query substitution. Execute a multi-row INSERT, UPDATE!, or other SQL query that is not  expected to return results. %Returns the number of rows affected. Throws ~0 if the query could not be formatted correctly.  Perform a SELECT/ or other SQL query that is expected to return > results. All results are retrieved and converted before this  function returns. CWhen processing large results, this function will consume a lot of % client-side memory. Consider using fold instead. Exceptions that may be thrown:  ~5: the query string could not be formatted correctly.  {5: the result contains no columns (i.e. you should be  using  instead of ).  b: result conversion failed.  A version of + that does not perform query substitution. Process a query for later use.  A version of + that does not perform query substitution. ,Execute an action inside a SQL transaction. -This function initiates a transaction with a "begin  transaction"3 statement, then executes the supplied action. If = the action succeeds, the transaction will be completed with  t before this function returns. If the action throws any kind of exception (not just a E MySQL-related exception), the transaction will be rolled back using  s', then the exception will be rethrown. z{|}~.MQRSTUVWbfghlmopstvz{|}~4QRSTUVWMz~{|}bfghfghfghplvtsomz{|}~          !"##$%&'()*+,-./01234556789: ;<=>?@ABCCDEFGHIJJKLMMNOPQRSTUVWXYZC[\]^_`abcdefghijklmnopqrstZuvwxyz{|}~ql     tZwpgsql-simple-0.1.2 Database.PostgreSQL.Simple.Types Database.PostgreSQL.Simple.Param&Database.PostgreSQL.Simple.QueryParamsDatabase.PostgreSQL.Base.Types!Database.PostgreSQL.Simple.Result'Database.PostgreSQL.Simple.QueryResultsDatabase.PostgreSQL.BaseDatabase.PostgreSQL.SimpleBinaryInOnlyfromOnlyQuery fromQueryNullParamrenderActionManyEscapePlaininQuotes QueryParams renderParamsPoolunPool PoolStatepoolConnectionspoolConnectInfoObjectIdModifier FormatCode BinaryCodeTextCodeSizeVaryingTypeTimeDateTimestampWithZone TimestampBooleanText Characters CharVaryingDoublePrecisionRealNumericDecimalLongLongLongShortField fieldTypefieldFormatCode MessageTypeUnknownMessageTypePasswordMessageAuthenticationOkNoticeResponse ReadyForQuery ErrorResponseEmptyQueryResponseDataRowRowDescriptionCommandCompleteResult resultRows resultDesc resultError resultNotices resultType resultTagRows ConnectionconnectionHandleconnectionObjects ConnectInfo connectHost connectPort connectUserconnectPasswordconnectDatabaseConnectionError GeneralErrorUnsupportedAuthenticationMethodConnectionLostInitializationErrorAuthenticationFailed QueryEmpty QueryErrorconvert ResultErrorConversionFailedUnexpectedNull Incompatible errSQLTypeerrHaskellType errMessage QueryResultsconvertResults convertErrordefaultConnectInfonewPoolpconnectwithPoolConnectionconnectwithDBwithTransactionrollbackcommitbeginclosequeryexecescapeBSProcessedQuery qeMessageqeQuery FormatError fmtMessagefmtQuery fmtParams formatQuery formatManyexecuteexecute_ executeManyquery_ processQueryqueryProcessedbase Data.StringIsStringbytestring-0.10.0.2Data.ByteString.Internal ByteString $fMonoidQuery$fIsStringQuery $fReadQuery $fShowQuery$fEqNull renderNull$fParamTimeOfDay $fParamDay$fParamUTCTime $fParamText $fParam[] $fParamText0$fParamByteString$fParamByteString0 $fParamDouble $fParamFloat $fParamWord64 $fParamWord $fParamWord32 $fParamWord16 $fParamWord8$fParamInteger $fParamInt64 $fParamInt $fParamInt32 $fParamInt16 $fParamInt8 $fParamBool $fParamNull $fParamBinary$fParamBinary0 $fParamIn $fParamMaybe $fParamAction $fShowAction$fQueryParams[]$fQueryParams(,,,,,,,,,)$fQueryParams(,,,,,,,,)$fQueryParams(,,,,,,,)$fQueryParams(,,,,,,)$fQueryParams(,,,,,)$fQueryParams(,,,,)$fQueryParams(,,,)$fQueryParams(,,)$fQueryParams(,)$fQueryParamsOnly$fQueryParams()$fExceptionConnectionErrorCompatparseLocalTimeparseZonedTimeisText mkCompatsmkCompatcompatokTextok16ok32ok64okWord doConvert incompatibleconversionFailedatto$fResultTimeOfDay $fResultDay$fResultUTCTime$fResultZonedTime$fResultLocalTime $fResult[] $fResultText $fResultText0$fResultByteString$fResultByteString0 $fResultRatio$fResultDouble $fResultFloat$fResultWord64 $fResultWord$fResultWord32$fResultWord16$fResultInteger $fResultInt64 $fResultInt $fResultInt32 $fResultInt16 $fResultBool $fResultMaybe$fExceptionResultErrorellipsis$fQueryResults(,,,,,,,,,)$fQueryResults(,,,,,,,,)$fQueryResults(,,,,,,,)$fQueryResults(,,,,,,)$fQueryResults(,,,,,)$fQueryResults(,,,,)$fQueryResults(,,,)$fQueryResults(,,)$fQueryResults(,)$fQueryResultsOnlyrestore execQueryprotocolVersionescape authenticate sendStartUpgetConnectInfoResponsesendPassClearText sendQuery setCommandTag getRowDesc parseFields parseTypeparseFormatCode getDataRow waitForReadywithConnection sendMessage sendBlock getMessagestringint32zero int32Size objectIds typeFromName fieldTypes typeFromChar charFromTypetypesgetInt16getInt32 getStringreadMay buildQueryfmtError$fExceptionQueryError$fExceptionFormatError