-- | Bindings to the [SQLite3 C library](https://www.sqlite.org). -- This is a very simple library that puts a minimal number of -- abstractions between the user and the underlying C library. -- Some notable abstractions that do appear: -- -- * use of 'Data.Text.Text' and 'Data.ByteString.ByteString' -- in the user-facing API rather than the underlying C types -- -- * use of the [SQLite3 extended error -- codes](https://www.sqlite.org/c3ref/errcode.html) -- -- * all errors indicated with exceptions (embraces the philosophy -- that [exceptions are inevitable in -- IO](https://www.fpcomplete.com/blog/2016/11/exceptions-best-practices-haskell)) -- -- * extensive contextual information given in exceptions, to help -- you figure out where the problem arose -- -- * 'Database' and 'Statement' handles are cleaned up for you, so -- there is no need to manually de-allocate them -- -- The SQLite library is built along with Squeather, so there is no -- dependency on a system-wide library and there is nothing else to -- build. The following [run-time loadable -- extensions](https://www.sqlite.org/loadext.html) are enabled in -- the build: -- -- * [FTS3](https://www.sqlite.org/fts3.html) -- * [FTS4](https://www.sqlite.org/fts3.html) -- * [FTS5](https://www.sqlite.org/fts5.html) -- * [JSON1](https://www.sqlite.org/json1.html) -- -- However, at this point none of the run-time loadable extensions -- have been tested. -- -- In addition, the SQLite C library is compiled with the -- @-DSQLITE_DQS=0@ compile-time option, so that double-quoted -- string literals in SQL are NOT accepted. Be sure to -- single-quote your string literals and double-quote your -- identifiers in SQL. For details on what this is about, see -- -- https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted -- -- The name comes from @SQL@ and the feather which is used in the -- SQLite logo. module Squeather ( -- * Database handles, opening databases Database , open -- ** Opening with flags , Create(..) , WriteMode(..) , ThreadMode(..) , CacheMode(..) , OpenFlags(..) , openFlags , openWithFlags -- * Easy execution of statements -- | Often this is all you will need to execute statements. , exec , SQLData(..) , execute , executeNamed , executeNamedWithColumns -- * Statistics , lastInsertRowId , changes -- * Backups , Source(..) , Destination(..) , backup -- * Statements -- | For more control over statement execution. , Statement , prepare , allRows , reset -- ** Steps and Columns -- | When retrieving columns, the leftmost column of the result -- set has the index 0. (Contrast bound parameters, where the -- leftmost parameter has the index 1.) , StepResult(..) , step , column , columns , columnInt64 , columnDouble , columnText , columnBlob , columnCount , columnName , columnNames -- ** Bindings -- | When binding parameters, the leftmost parameter has the index -- 1. (Contrast the indexes of columns in result sets, where the -- leftmost column has the index 0.) , bindSqlData , bindParameters , bindNull , bindText , bindDouble , bindInt64 , bindBlob , parameterCount , parameterName , getParameterIndex , clearBindings -- * Custom SQL functions , DirectOnly(..) , createPureScalarFunction , C'sqlite3 , C'sqlite3_api_routines , loadExtension -- * Errors , ErrorFlag(..) , SqueatherErrorFlag(..) , Error(..) -- * Version , sqliteVersion ) where import Squeather.Internal import Squeather.Internal.Bindings import Squeather.Internal.Types