ӐĀ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  n(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None$02IQR)rA composite type to parse your custom data structures without having to define dummy newtype wrappers every time. !instance FromRow MyData where ... "instance FromRow MyData2 where ...%then I can do the following for free: Kres <- query' c "..." forM res $ \(MyData{..} :. MyData2{..}) -> do .... +A single-value "collection".vThis is useful if you need to supply a single parameter to a SQL query, or extract a single column from a SQL result.Parameter example: ,query c "select x from scores where x > ?" (+ (42::Int))Result example: 3xs <- query_ c "select id from users" forM_ xs $ \(+ id) -> {- ... -}.A query string. This type is intended to make it difficult to construct a SQL query by concatenating string fragments, as that is 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 OverloadedStringsF language extension and then simply write the query in double quotes. \{-# LANGUAGE OverloadedStrings #-} import Database.SQLite.Simple q :: Query q = "select ?"The underlying type is a Textf, and literal Haskell strings that contain Unicode characters will be correctly transformed to UTF-8.1A placeholder for the SQL NULL value.)*+,-./01234567 )*+,-./012 12+,-./0)* )*+,-./01234567)3*3B(c) 2012 Leon P Smith (c) 2012-2014 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com> None$QRJOutput YYYY-MM-DD HH:MM:SS with an optional .SSS fraction part. Explicit timezone attribute is not appended as per SQLite3's datetime conventions.*p assumes its input is in the range [0..9].pad2 assumes its input is in the range [0..99]"pad4 assumes its input is positiveEF     GHIJEFGHIJEFJGHIEF     GHIJ5 B(c) 2012 Leon P Smith (c) 2012-2014 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com> None$QREFGHIJn(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None $029;QRK=A type that may be used as a single parameter to a SQL query.L5Prepare a value for substitution into a query string.KLMNOPQRSTUVWXYZ[\]^_`abcdKLKLKLMNOPQRSTUVWXYZ[\]^_`abcdn(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None$QRe4A collection type that can be turned into a list of  elements.fK a collection of values.efghijklmnopqrsefefefghijklmnopqrsA(c) 2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com> Safe$02QRt;a way to reify a list of exceptions into a single exception~Two wU cases are considered equal, regardless of what the list of exceptions looks like. tuvwxyz{|}~tuvwx vwx~}|{ztuytuvwxyz{|}~G(c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None$0IQR4A Field represents metadata about a particular fieldConnection to an open database. You can use # to gain access to the underlying  0http://hackage.haskell.org/package/direct-sqlite connection. This may be useful if you need to access some direct-sqlite functionality that's not exposed in the sqlite-simple API. This should be a safe thing to do although mixing both APIs is discouraged.k(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone $029;QRT-A type that may be converted from a SQL type.'Convert a SQL value to a Haskell value.yReturns a list of exceptions if the conversion fails. In the case of library instances, this will usually be a single , but may be a UnicodeException.Implementations of * should not retain any references to the  nor the ^ arguments after the result has been evaluated to WHNF. Such a reference causes the entire LibPQ.   to be retained.For example, the instance for  uses J to avoid such a reference, and that using bytestring functions such as  and * alone will also trigger this memory leak.JException thrown if conversion from a SQL value to a Haskell value fails.-The SQL and Haskell types are not compatible.A SQL NULL: was encountered when the Haskell type did not permit it.The SQL value could not be parsed, or could not be represented as a valid Haskell value, or an unexpected low-level error occurred (e.g. mismatch between metadata and actual data in a row).LReturn the actual SQL data for a database field. This allows user-defined H instances to access the SQL data associated with a field being parsed.#Given one of the constructors from , the field, and an v, this fills in the other fields in the exception value and returns it in a 'Left . SomeException' constructor.'    G(c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None!"$QRA collection type that can be converted from a sequence of fields. Instances are provided for tuples up to 10 elements and lists of any length.Note that instances can defined outside of sqlite-simple, which is often useful. For example, here's an instance for a user-defined pair:6@data User = User { name :: String, fileQuota :: Int } instance $ User where fromRow = User <$>  <*>  @The number of calls to _ must match the number of fields returned in a single row of the query result. Otherwise, a  exception will be thrown.BNote the caveats associated with user-defined implementations of .n(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne Hellsten BSD3 $Janne Hellsten <jjhellst@gmail.com>  portable None $%&0IQRT Exception thrown if a .2 was malformed. This may occur if the number of '?S' characters in the query string does not match the number of parameters provided.?Index of a column in a result set. Column indices start from 0.An SQLite prepared statement.[Open a database connection to a given file. Will throw an exception if it cannot connect.Every  must be closed with a call to .If you specify ":memory:" or an empty string as the input filename, then a private, temporary in-memory database is created for the connection. This database will vanish when you close the connection.Close a database connection.Opens a database connection, executes an action using this connection, and closes the connection, even in the presence of exceptions. (http://www.sqlite.org/c3ref/profile.htmlNEnable/disable tracing of SQL execution. Tracing can be disabled by setting  as the logger callback.oWarning: If the logger callback throws an exception, your whole program may crash. Enable only for debugging!/Binds parameters to a prepared statement. Once  returns (, the statement must be reset with the 6 function before it can be executed again by calling ./Binds named parameters to a prepared statement.Resets a statement. This does not reset bound parameters, if any, but allows the statement to be reexecuted again by invoking .AReturn the name of a a particular column in the result set of a  . Throws an & if the colum index is out of bounds. ,http://www.sqlite.org/c3ref/column_name.html.Binds parameters to a prepared statement, and Qs the statement when the callback completes, even in the presence of exceptions.Use + to reuse prepared statements. Because it s the statement after} each usage, it avoids a pitfall involving implicit transactions. SQLite creates an implicit transaction if you don't say BEGINZ explicitly, and does not commit it until all active statements are finished with either  or .eOpens a prepared statement. A prepared statement must always be closed with a corresponding call to % before closing the connection. Use ) to iterate on the values returned. Once  returns , you need to invoke . before reexecuting the statement again with .Closes a prepared statement.Opens a prepared statement, executes an action using this statement, and closes the statement, even in the presence of exceptions. Execute an INSERT, UPDATE=, or other SQL query that is not expected to return results.Throws / if the query could not be formatted correctly.Execute a multi-row INSERT, UPDATE=, or other SQL query that is not expected to return results.Throws / 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.hWhen processing large results, this function will consume a lot of client-side memory. Consider using  instead.Exceptions that may be thrown:3: the query string mismatched with given arguments.: result conversion failed. A version of * that does not perform query substitution. A version of  that takes an explicit . A version of A that does not perform query substitution and takes an explicit . A version of 6 where the query parameters (placeholders) are named.Example: r <- = c "SELECT * FROM posts WHERE id=:id AND date>=:date" [":id"  postId, ":date"  afterDate]  A version of * that does not perform query substitution. A version of 6 where the query parameters (placeholders) are named. Perform a SELECT` or other SQL query that is expected to return results. Results are converted and fed into the action9 callback as they are being retrieved from the database.oThis allows gives the possibility of processing results in constant space (for instance writing them to disk).Exceptions that may be thrown:3: the query string mismatched with given arguments.: result conversion failed. A version of / which does not perform parameter substitution. A version of 6 where the query parameters (placeholders) are named.2Extracts the next row from the prepared statement.YReturns the rowid of the most recent successful INSERT on the given database connection. See also  2http://www.sqlite.org/c3ref/last_insert_rowid.html. (http://www.sqlite.org/c3ref/changes.htmlVReturn the number of rows that were changed, inserted, or deleted by the most recent INSERT, DELETE, or UPDATE statement. .http://www.sqlite.org/c3ref/total_changes.html1Return the total number of row changes caused by INSERT, DELETE, or UPDATE statements since the Database was opened.7Run an IO action inside a SQL transaction started with BEGIN TRANSACTION\. If the action throws any kind of an exception, the transaction will be rolled back with ROLLBACK TRANSACTION,. Otherwise the results are committed with COMMIT TRANSACTION.3 !"#$%&'g ('&%$#"!  )*+,-./0efm./0ef+,-)* ('&%$#"!  , !"#$%&'3(                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 78899:;;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./012-sqlite-simple-0.4.12.0-7Q20i5LY35F2qfWNDNzN25Database.SQLite.SimpleDatabase.SQLite.Simple.Types*Database.SQLite.Simple.Time.ImplementationDatabase.SQLite.Simple.ToFieldDatabase.SQLite.Simple.ToRowDatabase.SQLite.Simple.OkDatabase.SQLite.Simple.Internal Database.SQLite.Simple.FromFieldDatabase.SQLite.Simple.FromRowDatabase.SQLite.Simple.TimePQResult+direct-sqlite-2.3.18-CImwFirJ6UHD2QIb95HH6JDatabase.SQLite3SQLNullSQLBlobSQLTextSQLFloat SQLIntegerSQLDatasqlErrorContextsqlErrorDetailssqlErrorSQLErrorDatabase.SQLite3.Bindings.Types ErrorDoneErrorRowErrorNotADatabase ErrorRange ErrorFormatErrorAuthorizationErrorNoLargeFileSupport ErrorMisuse ErrorMismatchErrorConstraint ErrorTooBig ErrorSchema ErrorEmpty ErrorProtocolErrorCan'tOpen ErrorFull ErrorNotFound ErrorCorruptErrorIOErrorInterrupt ErrorReadOnly ErrorNoMemory ErrorLocked ErrorBusy ErrorAbortErrorPermission ErrorInternal ErrorErrorErrorOKError:.OnlyfromOnlyQuery fromQueryNull $fMonoidQuery$fIsStringQuery $fReadQuery $fShowQuery$fEqNull $fReadNull $fShowNull $fEqQuery $fOrdQuery$fEqOnly $fOrdOnly $fReadOnly $fShowOnly $fFunctorOnly$fEq:.$fOrd:.$fShow:.$fRead:. parseUTCTimeparseDay dayToBuildertimeOfDayToBuildertimeZoneToBuilderutcTimeToBuilderToFieldtoField $fToFieldDay$fToFieldUTCTime $fToFieldText $fToField[]$fToFieldText0$fToFieldByteString$fToFieldByteString0$fToFieldDouble$fToFieldFloat$fToFieldWord64 $fToFieldWord$fToFieldWord32$fToFieldWord16$fToFieldWord8$fToFieldInteger$fToFieldInt64 $fToFieldInt$fToFieldInt32$fToFieldInt16 $fToFieldInt8 $fToFieldBool $fToFieldNull$fToFieldMaybe$fToFieldSQLDataToRowtoRow $fToRow:. $fToRow[]$fToRow(,,,,,,,,,)$fToRow(,,,,,,,,)$fToRow(,,,,,,,)$fToRow(,,,,,,)$fToRow(,,,,,) $fToRow(,,,,) $fToRow(,,,) $fToRow(,,) $fToRow(,) $fToRowOnly $fToRow() ManyErrorsOkErrors$fExceptionManyErrors $fMonadOk $fMonadPlusOk$fAlternativeOk$fApplicativeOk$fEqOk$fShowOk $fFunctorOk$fShowManyErrors RowParserRPunRP RowParseROnColumnsFieldresultcolumnColumnOutOfBoundserrorColumnIndex ConnectionconnectionHandle gettypename$fExceptionColumnOutOfBounds$fEqColumnOutOfBounds$fShowColumnOutOfBounds$fFunctorRowParser$fApplicativeRowParser$fAlternativeRowParser$fMonadRowParser$fMonadPlusRowParser FromField fromField FieldParser ResultError IncompatibleUnexpectedNullConversionFailed errSQLTypeerrHaskellType errMessage fieldData returnError$fFromFieldDay$fFromFieldUTCTime$fFromFieldByteString$fFromFieldByteString0 $fFromField[]$fFromFieldText$fFromFieldText0$fFromFieldBool$fFromFieldFloat$fFromFieldDouble$fFromFieldWord$fFromFieldWord64$fFromFieldWord32$fFromFieldWord16$fFromFieldWord8$fFromFieldInteger$fFromFieldInt64$fFromFieldInt$fFromFieldInt32$fFromFieldInt16$fFromFieldInt8$fFromFieldNull$fFromFieldMaybe$fExceptionResultError$fEqResultError$fShowResultErrorFromRowfromRow fieldWithfieldnumFieldsRemaining $fFromRow:. $fFromRow[]$fFromRow(,,,,,,,,,)$fFromRow(,,,,,,,,)$fFromRow(,,,,,,,)$fFromRow(,,,,,,)$fFromRow(,,,,,)$fFromRow(,,,,)$fFromRow(,,,) $fFromRow(,,) $fFromRow(,) $fFromRowOnly FormatError fmtMessagefmtQuery fmtParams NamedParam:= ColumnIndex StatementopenclosewithConnectionsetTracebind bindNamedreset columnNamewithBind openStatementcloseStatement withStatementexecute executeManyqueryquery_ queryWith queryWith_ queryNamedexecute_ executeNamedfoldfold_ foldNamednextRowlastInsertRowIdchanges totalChangeswithTransaction$fExceptionFormatError$fShowNamedParam$fEqColumnIndex$fOrdColumnIndex$fEnumColumnIndex$fNumColumnIndex$fRealColumnIndex$fIntegralColumnIndex$fEqFormatError$fShowFormatErrorbase Data.StringIsStringppad2pad4++getDaydecimal getTimeOfDay getTimeZone getUTCTimetoNumdigitdigits showSecondspad6showD6pad3showD3bytestring-0.10.8.1Data.ByteString.Internal ByteStringData.ByteStringcopydropData.ByteString.Char8 takeWhilelefttakeInt fieldTypenameGHC.BaseNothingGHC.IO.ExceptionArrayExceptionunUtf8withStatementParamswithStatementNamedParams doFoldToListdoFold nextRowWith convertRowfmtErrorgetQuery