{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}-------------------------------------------------------------------------------- |-- Module: Database.SQLite.Simple.Internal-- Copyright: (c) 2011-2012 Leon P Smith-- (c) 2012 Janne Hellsten-- License: BSD3-- Maintainer: Janne Hellsten <jjhellst@gmail.com>-- Stability: experimental-- Portability: portable---- Internal bits. This interface is less stable and can change at any time.-- In particular this means that while the rest of the sqlite-simple-- package endeavors to follow the package versioning policy, this module-- does not. Also, at the moment there are things in here that aren't-- particularly internal and are exported elsewhere; these will eventually-- disappear from this module.--------------------------------------------------------------------------------moduleDatabase.SQLite.Simple.InternalwhereimportPreludehiding(catch)importControl.ApplicativeimportData.ByteString(ByteString)importData.ByteString.Char8()importControl.Monad.Trans.State.StrictimportControl.Monad.Trans.ReaderimportDatabase.SQLite.Simple.OkimportqualifiedDatabase.SQLite3asBase-- | Connection to an open database.dataConnection=ConnectionBase.Database-- | A Field represents metadata about a particular fielddataField=Field{result::Base.SQLData,column::{-# UNPACK #-}!Int}newtypeRow=Row{rowresult::[Base.SQLData]}newtypeRowParsera=RP{unRP::ReaderTRow(StateTIntOk)a}deriving(Functor,Applicative,Alternative,Monad)gettypename::Base.SQLData->ByteStringgettypename(Base.SQLInteger_)="INTEGER"gettypename(Base.SQLFloat_)="FLOAT"gettypename(Base.SQLText_)="TEXT"gettypename(Base.SQLBlob_)="BLOB"gettypenameBase.SQLNull="NULL"