Aɏ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None-The Database.SQLite3 and Database.SQLite3.Direct modules use C higher-level representations of some types than those used in the  FFI signatures (Database.SQLite3.Bindings). This typeclass  helps with the conversions.  'http://www.sqlite.org/c3ref/c_blob.html  (http://www.sqlite.org/c3ref/c_abort.html  )http://www.sqlite.org/c3ref/c_static.html Ptr CDestructor = sqlite3_destructor_type #Number of columns in a result set. AIndex of a column in a result set. Column indices start from 0. /Index of a parameter in a parameterized query. ! Parameter indices start from 1. When a query is d, SQLite allocates an D array indexed from 1 to the highest parameter index. For example:  3>Right stmt <- prepare conn "SELECT ?1, ?5, ?3, ?" >bindParameterCount stmt  ParamIndex 6 1This will allocate an array indexed from 1 to 6 (? takes the highest H preceding index plus one). The array is initialized with null values.  When you bind a parameter with , it assigns a $ new value to one of these indices. See  -http://www.sqlite.org/lang_expr.html#varparam for the syntax of A parameter placeholders, and how parameter indices are assigned.  %http://www.sqlite.org/c3ref/stmt.html  CStatement =  sqlite3_stmt  (http://www.sqlite.org/c3ref/sqlite3.html  CDatabase = sqlite3 sqlite3_step() has finished executing sqlite3_step() has another row ready (File opened that is not a database file +2nd parameter to sqlite3_bind out of range ! Auxiliary database format error "Authorization denied #'Uses OS features not supported on host $Library used incorrectly %Data type mismatch &"Abort due to constraint violation '"String or BLOB exceeds size limit (The database schema changed )Database is empty *Database lock protocol error +!Unable to open the database file ,*Insertion failed because database is full -Unknown opcode in sqlite3_file_control() .%The database disk image is malformed /Some kind of disk I/O error occurred 0Operation terminated by sqlite3_interrupt() 1%Attempt to write a readonly database 2A malloc() failed 3"A table in the database is locked 4The database file is locked 5$Callback routine requested an abort 6Access permission denied 7Internal logic error in SQLite 8SQL error or missing database 9Successful result :7Tells SQLite3 to make its own private copy of the data ;HNote that this is a partial function. If the error code is invalid, or J perhaps introduced in a newer version of SQLite but this library has not 6 been updated to support it, the result is undefined. To be clear, if ; fails, it is undefined behavior , not an  exception you can handle. LTherefore, do not use direct-sqlite with a different version of SQLite than > the one bundled (currently, 3.7.13). If you do, ensure that ;  and = are still exhaustive. =&Note that this is a partial function.  See ; for more information. FThis just shows the underlying integer, without the data constructor. FThis just shows the underlying integer, without the data constructor. FThis just shows the underlying integer, without the data constructor. FThis just shows the underlying integer, without the data constructor. G  !"#$%&'()*+,-./0123456789:;<=>?  !"#$%&'()*+,-./0123456789:;<=>?;<9876543210/.-,+*)('&%$#"! =>   :  9876543210/.-,+*)('&%$#"! :;<=>None@ !http://sqlite.org/c3ref/free.html A .http://www.sqlite.org/c3ref/total_changes.html B (http://www.sqlite.org/c3ref/changes.html C 2http://www.sqlite.org/c3ref/last_insert_rowid.html O -http://www.sqlite.org/c3ref/column_count.html P 4http://www.sqlite.org/c3ref/bind_parameter_name.html Q 5http://www.sqlite.org/c3ref/bind_parameter_count.html JThis returns the index of the largest (rightmost) parameter, which is not D necessarily the number of parameters. If numbered parameters like ?5 * are used, there may be gaps in the list. R /http://www.sqlite.org/c3ref/clear_bindings.html ?A look at the source reveals that this function always returns  SQLITE_OK. S )http://www.sqlite.org/c3ref/finalize.html Warning: If the most recent U call failed, 0 this will return the corresponding error code. T &http://www.sqlite.org/c3ref/reset.html Warning: If the most recent U call failed, 0 this will return the corresponding error code. U %http://www.sqlite.org/c3ref/step.html V *http://www.sqlite.org/c3ref/db_handle.html W (http://www.sqlite.org/c3ref/prepare.html 6If the query contains no SQL statements, this returns  SQLITE_OK and sets  the   to null. XEA couple important things to know about callbacks from Haskell code: 6 If the callback throws an exception, apparently, the  whole program is  terminated.  Remember to call % when you are done with the wrapper,  to avoid leaking memory. Z *http://www.sqlite.org/c3ref/interrupt.html [ (http://www.sqlite.org/c3ref/errcode.html \ &http://www.sqlite.org/c3ref/close.html ] %http://www.sqlite.org/c3ref/open.html This sets the ' Ptr CDatabase' even on failure. ?6Number of columns, which is the number of elements in  the following arrays. 'Array of column values, as returned by  F. Null values are represented  as null pointers. Array of column names 'If the callback returns non-zero, then  Y returns  SQLITE_ABORT  (5). @ABCDEFGHIJKLMWarning: If this pointer is NULL, this 6 will bind a null value, rather than an empty text. (Length, in bytes. If this is negative, 4 the value is treated as a NUL-terminated string. N%Index of the SQL parameter to be set  Value to bind to the parameter. Warning: If this pointer is NULL, this 6 will bind a null value, rather than an empty blob. .Length, in bytes. This must not be negative. OPQRSTUVWSQL statement, UTF-8 encoded %Maximum length of the SQL statement, , in bytes. If this is negative, then the ! SQL statement is treated as a  NUL-terminated string. /OUT: Statement handle. This must not be null. 'OUT: Pointer to unused portion of zSql XYSQL statement, UTF-8 encoded /Optional callback function called for each row Context passed to the callback OUT: Error message string Z[\]^  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]]\[ZY?XWVUTSRQPONMLKJIHGEDFCBA@?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]None_A 6 containing UTF8-encoded text with no NUL characters. Like unsafeUseAsCStringLen, but if the string is empty, ) never pass the callback a null pointer. h %http://www.sqlite.org/c3ref/open.html i &http://www.sqlite.org/c3ref/close.html j *http://www.sqlite.org/c3ref/interrupt.html #Cause any pending operation on the f handle to stop at its earliest M opportunity. This simply sets a flag and returns immediately. It does not + wait for the pending operation to finish. You'll need to compile with  -threaded for this to do any good.  Without  -threaded), FFI calls block the whole RTS, meaning j % would never run at the same time as p. k (http://www.sqlite.org/c3ref/errcode.html mLike l/, but invoke the callback for each result row. <If the callback throws an exception, it will be rethrown by  m. n (http://www.sqlite.org/c3ref/prepare.html 6If the query contains no SQL statements, this returns   . o *http://www.sqlite.org/c3ref/db_handle.html p %http://www.sqlite.org/c3ref/step.html q &http://www.sqlite.org/c3ref/reset.html  Warning:  If the most recent p call failed, . this will return the corresponding error. ; This does not reset the bindings on a prepared statement.  Use s to do that. r )http://www.sqlite.org/c3ref/finalize.html Warning: If the most recent p call failed, + this will return the corresponding error. s /http://www.sqlite.org/c3ref/clear_bindings.html 6Set all parameters in the prepared statement to null. t 5http://www.sqlite.org/c3ref/bind_parameter_count.html MThis returns the index of the largest (rightmost) parameter. Note that this K is not necessarily the number of parameters. If numbered parameters like  ?5* are used, there may be gaps in the list. See  for more information. u 4http://www.sqlite.org/c3ref/bind_parameter_name.html v -http://www.sqlite.org/c3ref/column_count.html  2http://www.sqlite.org/c3ref/last_insert_rowid.html  (http://www.sqlite.org/c3ref/changes.html BReturn 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.html 1Return the total number of row changes caused by INSERT, DELETE,  or UPDATE statements since the f was opened. fromString = Utf8 .  . 2^3Number of columns, which is the number of items in 3 the following lists. This will be the same for  every row. -List of column names. This will be the same  for every row. &List of column values, as returned by . _`abcdefghijklmnopqrstuvwxyz{|}~O !"#$%&'()*+,-./0123456789^_`abcdefghijklmnopqrstuvwxyz{|}~Ohiklm^nopqrstuvwxyz{|}~jfgdeacb9876543210/.-,+*)('&%$#"! _`-^_`acbdefghijklmnopqrstuvwxyz{|}~None0Exception thrown when SQLite3 reports an error. Idirect-sqlite may throw other types of exceptions if you misuse the API.  Error code returned by API call Text describing the error +Indicates what action produced this error,  e.g. exec "SELECT * FROM foo" Like  decodeUtf8+, but substitute a custom error message if  decoding fails.  %http://www.sqlite.org/c3ref/open.html  &http://www.sqlite.org/c3ref/close.html CMake it possible to interrupt the given database operation with an J asynchronous exception. This only works if the program is compiled with  base >= 4.3 and  -threaded. FIt works by running the callback in a forked thread. If interrupted,  it uses j to try to stop the operation. =Execute zero or more SQL statements delimited by semicolons. Like , but print result rows to . ;This is mainly for convenience when experimenting in GHCi. - The output format may change in the future. Like /, but invoke the callback for each result row.  (http://www.sqlite.org/c3ref/prepare.html Unlike , 0 only executes the first statement, and ignores  subsequent statements. 5If the query string contains no SQL statements, this s.  %http://www.sqlite.org/c3ref/step.html  &http://www.sqlite.org/c3ref/reset.html Note that in the C API,  sqlite3_reset# returns an error code if the most  recent  sqlite3_step8 indicated an error. We do not replicate that behavior  here.  never throws an exception.  )http://www.sqlite.org/c3ref/finalize.html Like ,  never throws an exception.  4http://www.sqlite.org/c3ref/bind_parameter_name.html $Return the N-th SQL parameter name. +Named parameters are returned as-is. E.g. ":v" is returned as  Just ":v"1. Unnamed parameters, however, are converted to  Nothing. 2Note that the parameter index starts at 1, not 0. "If the index is not between 1 and t inclusive, this  fails with  3. Otherwise, it succeeds, even if the query skips * this index by using numbered parameters.  Example: +> stmt <- prepare conn "SELECT ?1, ?3, ?5" $> bindSQLData stmt 1 (SQLInteger 1) $> bindSQLData stmt 2 (SQLInteger 2) $> bindSQLData stmt 6 (SQLInteger 6) S*** Exception: SQLite3 returned ErrorRange while attempting to perform bind int64. > step stmt >> columns stmt [SQLInteger 1,SQLNull,SQLNull] FConvenience function for binding values to all parameters. This will  1 if the list has the wrong number of parameters. This will throw a & if the datum contains invalid UTF-8. . If this behavior is undesirable, you can use  from  Database.SQLite3.Direct', which does not perform conversion to . 03Number of columns, which is the number of items in 3 the following lists. This will be the same for  every row. -List of column names. This will be the same  for every row. &List of column values, as returned by . Z !"#$%&'()*+,-./0123456789abcdfjstv|}~Zstv|}~jfdacb9876543210/.-,+*)('&%$#"! $        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aabcdeeffghijklmnopqrstuvwxyz{|}~`ghklnopsxvuyw}direct-sqlite-2.3.2Database.SQLite3.Bindings.TypesDatabase.SQLite3.BindingsDatabase.SQLite3.DirectDatabase.SQLite3prepare bindSQLData System.IOstdoutFFITypetoFFIfromFFI CColumnTypeCError CDestructor CNumBytes CColumnCount CColumnIndex CParamIndex ColumnCount ColumnIndex ParamIndex CStatement CDatabase ColumnType NullColumn BlobColumn TextColumn FloatColumn IntegerColumnError ErrorDoneErrorRowErrorNotADatabase ErrorRange ErrorFormatErrorAuthorizationErrorNoLargeFileSupport ErrorMisuse ErrorMismatchErrorConstraint ErrorTooBig ErrorSchema ErrorEmpty ErrorProtocolErrorCan'tOpen ErrorFull ErrorNotFound ErrorCorruptErrorIOErrorInterrupt ErrorReadOnly ErrorNoMemory ErrorLocked ErrorBusy ErrorAbortErrorPermission ErrorInternal ErrorErrorErrorOKc_SQLITE_TRANSIENT decodeError encodeErrordecodeColumnTypeencodeColumnType CExecCallbackc_sqlite3_freec_sqlite3_total_changesc_sqlite3_changesc_sqlite3_last_insert_rowidc_sqlite3_column_doublec_sqlite3_column_int64c_sqlite3_column_textc_sqlite3_column_blobc_sqlite3_column_bytesc_sqlite3_column_typec_sqlite3_bind_nullc_sqlite3_bind_int64c_sqlite3_bind_doublec_sqlite3_bind_textc_sqlite3_bind_blobc_sqlite3_column_countc_sqlite3_bind_parameter_namec_sqlite3_bind_parameter_countc_sqlite3_clear_bindingsc_sqlite3_finalizec_sqlite3_resetc_sqlite3_stepc_sqlite3_db_handlec_sqlite3_prepare_v2mkCExecCallbackc_sqlite3_execc_sqlite3_interruptc_sqlite3_errmsgc_sqlite3_closec_sqlite3_open ExecCallbackUtf8 StepResultDoneRow StatementDatabaseopenclose interrupterrmsgexecexecWithCallbackgetStatementDatabasestepresetfinalize clearBindingsbindParameterCountbindParameterName columnCount bindInt64 bindDoublebindTextbindBlobbindNull columnType columnInt64 columnDouble columnText columnBloblastInsertRowIdchanges totalChangesSQLErrorsqlErrorsqlErrorDetailssqlErrorContextSQLDataSQLNullSQLBlobSQLTextSQLFloat SQLInteger interruptibly execPrintbindIntbindcolumncolumns$fShowCColumnIndex$fShowCParamIndex$fShowColumnIndex$fShowParamIndex$fFFITypeColumnTypeCColumnType$fFFITypeErrorCError $fFFITypeColumnIndexCColumnIndex$fFFITypeParamIndexCParamIndexbaseGHC.PtrPtr Foreign.PtrfreeHaskellFunPtrbytestring-0.10.0.0Data.ByteString.Internal ByteStringunsafeUseAsCStringLenNoNull Data.EitherRight Data.MaybeNothing$fIsStringUtf8 text-0.11.2.3Data.Text.Encoding encodeUtf8 Data.TextpackResultpackUtf8packCStringLen packUtf8ArraywrapNullablePtrtoResult toResultM toStepResult $fMonoidUtf8 $fShowUtf8fromUtf8GHC.BasefailData.Text.Encoding.Error DecodeErrorData.Text.InternalText DetailSource DetailMessageDetailStatementDetailDatabase fromUtf8'toUtf8renderDetailSource throwSQLError checkError checkErrorMsg appendShow$fExceptionSQLError$fShowSQLError