b      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF G HIJKLMNOPQRSTUVWXYZ[\]^_`a @(c) 2012 Leon P Smith (c) 2012-2014 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>None JK Output YYYY-MM-DD HH:MM:SS with an optional .SSS fraction part. Explicit timezone attribute is not appended as per SQLite3's datetime conventions.b*p assumes its input is in the range [0..9]c.pad2 assumes its input is in the range [0..99]d"pad4 assumes its input is positiveefghijklm nopqrbcd   efghijklm nopqrbcde @(c) 2012 Leon P Smith (c) 2012-2014 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>None JK ?(c) 2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com> Safe-Inferred +-JK ;a way to reify a list of exceptions into a single exceptionTwo U cases are considered equal, regardless of what the list of exceptions looks like.      E(c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone +BJK4A Field represents metadata about a particular field$Connection 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 +-BJK)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 s<, 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.)*+,-./012tuvwx )*+,-./012 12+,-./0)* )*+,-./012tuvwx)*k(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone  +-24JKM3-A type that may be converted from a SQL type.4'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 6, but may be a UnicodeException.Implementations of 4* should not retain any references to the  nor the y^ arguments after the result has been evaluated to WHNF. Such a reference causes the entire LibPQ.   to be retained.For example, the instance for y uses zJ to avoid such a reference, and that using bytestring functions such as { and |* alone will also trigger this memory leak.6JException thrown if conversion from a SQL value to a Haskell value fails.7The 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).8A SQL NULL: was encountered when the Haskell type did not permit it.9-The SQL and Haskell types are not compatible.=LReturn the actual SQL data for a database field. This allows user-defined 3H instances to access the SQL data associated with a field being parsed.>#Given one of the constructors from 6, the field, and an <v, this fills in the other fields in the exception value and returns it in a 'Left . SomeException' constructor.!3456789:;<}~=> 3456789:;<=>3456987:;<:;<:;<=>3456 987:;<:;<:;<}~=>E(c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone JK?A 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 <$> B <*> B @The number of calls to B_ must match the number of fields returned in a single row of the query result. Otherwise, a 7 exception will be thrown.BNote the caveats associated with user-defined implementations of @.?@ABC?@ABC?@BAC?@ABCk(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone  +-24JKD=A type that may be used as a single parameter to a SQL query.E5Prepare a value for substitution into a query string.DEDEDEDE k(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone JKFFA collection type that can be turned into a list of SQLData elements.GToField a collection of values.FGFGFGFGk(c) 2011 MailRank, Inc. (c) 2011-2012 Leon P Smith (c) 2012-2013 Janne HellstenBSD3#Janne Hellsten <jjhellst@gmail.com>portableNone  +BJKMHException 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.L?Index of a column in a result set. Column indices start from 0.NAn SQLite prepared statement.O[Open a database connection to a given file. Will throw an exception if it cannot connect.Every O must be closed with a call to P.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.PClose a database connection.QOpens a database connection, executes an action using this connection, and closes the connection, even in the presence of exceptions.R (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!S/Binds parameters to a prepared statement. Once ` returns (, the statement must be reset with the T6 function before it can be executed again by calling `.TResets a statement. This does not reset bound parameters, if any, but allows the statement to be reexecuted again by invoking `.UAReturn the name of a a particular column in the result set of a N . Throws an & if the colum index is out of bounds. ,http://www.sqlite.org/c3ref/column_name.htmlV.Binds parameters to a prepared statement, and TQs the statement when the callback completes, even in the presence of exceptions.Use V+ to reuse prepared statements. Because it Ts 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 T or X.WeOpens a prepared statement. A prepared statement must always be closed with a corresponding call to X% before closing the connection. Use `) to iterate on the values returned. Once ` returns , you need to invoke T. before reexecuting the statement again with `.XCloses a prepared statement.YOpens a prepared statement, executes an action using this statement, and closes the statement, even in the presence of exceptions.Z Execute an INSERT, UPDATE=, or other SQL query that is not expected to return results.Throws H/ 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:H3: the query string mismatched with given arguments.6: result conversion failed.\ A version of [* that does not perform query substitution.] A version of Z* that does not perform query substitution.^ 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:H3: the query string mismatched with given arguments.6: result conversion failed._ A version of ^/ which does not perform parameter substitution.`2Extracts the next row from the prepared statement.aYReturns the rowid of the most recent successful INSERT on the given database connection. See also  2http://www.sqlite.org/c3ref/last_insert_rowid.html.$HIJKLMNOPQRSTUVWXYZ[\]^_`a4$%&)*+,-./06:;<?@BFGHIJKLMNOPQRSTUVWXYZ[\]^_`a:./0$%&FG?@+,-)*NLMOPQR[\a^_Z]BWXYSTUV`HIJK6:;<:;<:;<HIJKLMNOPQRSTUVWXYZ[\]^_`a       !"#$%&''())*+,,-../01223345567789:;<=>?@ABCDEFGHIJ K LMNOPQQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ wwMRsqlite-simple-0.4.5.2Database.SQLite.Simple*Database.SQLite.Simple.Time.ImplementationDatabase.SQLite.Simple.OkDatabase.SQLite.Simple.InternalDatabase.SQLite.Simple.Types Database.SQLite.Simple.FromFieldDatabase.SQLite.Simple.FromRowDatabase.SQLite.Simple.ToFieldDatabase.SQLite.Simple.ToRowDatabase.SQLite.Simple.TimePQResultdirect-sqlite-2.3.14Database.SQLite3 SQLIntegerSQLFloatSQLTextSQLBlobSQLNullSQLData parseUTCTimeparseDay dayToBuildertimeOfDayToBuildertimeZoneToBuilderutcTimeToBuilder ManyErrorsOkErrors$fExceptionManyErrors $fMonadOk $fMonadPlusOk$fAlternativeOk$fApplicativeOk$fEqOk RowParserRPunRP RowParseROnColumnsFieldresultcolumnColumnOutOfBoundserrorColumnIndex ConnectionconnectionHandle gettypename$fExceptionColumnOutOfBounds:.OnlyfromOnlyQuery fromQueryNull FromField fromField FieldParser ResultErrorConversionFailedUnexpectedNull Incompatible errSQLTypeerrHaskellType errMessage fieldData returnErrorFromRowfromRow fieldWithfieldnumFieldsRemainingToFieldtoFieldToRowtoRow FormatError fmtMessagefmtQuery fmtParams ColumnIndex StatementopenclosewithConnectionsetTracebindreset columnNamewithBind openStatementcloseStatement withStatementexecutequeryquery_execute_foldfold_nextRowlastInsertRowIdppad2pad4++getDaydecimal getTimeOfDay getTimeZone getUTCTimetoNumdigitdigits showSecondspad6showD6pad3showD3base Data.StringIsString $fMonoidQuery$fIsStringQuery $fReadQuery $fShowQuery$fEqNullbytestring-0.10.4.0Data.ByteString.Internal ByteStringData.ByteStringcopydropData.ByteString.Char8 takeWhilelefttakeInt fieldTypename$fFromFieldDay$fFromFieldUTCTime$fFromFieldByteString$fFromFieldByteString0 $fFromField[]$fFromFieldText$fFromFieldText0$fFromFieldBool$fFromFieldFloat$fFromFieldDouble$fFromFieldInteger$fFromFieldInt64$fFromFieldInt$fFromFieldInt32$fFromFieldInt16$fFromFieldNull$fFromFieldMaybe$fExceptionResultError $fFromRow:. $fFromRow[]$fFromRow(,,,,,,,,,)$fFromRow(,,,,,,,,)$fFromRow(,,,,,,,)$fFromRow(,,,,,,)$fFromRow(,,,,,)$fFromRow(,,,,)$fFromRow(,,,) $fFromRow(,,) $fFromRow(,) $fFromRowOnly $fToFieldDay$fToFieldUTCTime $fToFieldText $fToField[]$fToFieldText0$fToFieldByteString$fToFieldByteString0$fToFieldDouble$fToFieldFloat$fToFieldWord64 $fToFieldWord$fToFieldWord32$fToFieldWord16$fToFieldWord8$fToFieldInteger$fToFieldInt64 $fToFieldInt$fToFieldInt32$fToFieldInt16 $fToFieldInt8 $fToFieldBool $fToFieldNull$fToFieldMaybe$fToFieldSQLData $fToRow:. $fToRow[]$fToRow(,,,,,,,,,)$fToRow(,,,,,,,,)$fToRow(,,,,,,,)$fToRow(,,,,,,)$fToRow(,,,,,) $fToRow(,,,,) $fToRow(,,,) $fToRow(,,) $fToRow(,) $fToRowOnly $fToRow() Data.MaybeNothingGHC.IO.ExceptionArrayExceptionunUtf8withStatementP doFoldToListdoFold convertRowfmtErrorgetQuery$fExceptionFormatError