{-# LINE 1 "src/Squeather/Internal/Bindings.hsc" #-}
module Squeather.Internal.Bindings where

import Data.Bits ((.|.))
import Data.ByteString (ByteString)
import Data.Int (Int64)
import Data.Text (Text)
import Foreign.C.Types (CInt)

import Squeather.Internal.Types



data ParseErrorResult
  = ParseErrorOk
  -- ^ There was no error
  | ParseErrorStep StepResult
  -- ^ A StepResult was found.
  | ParseErrorError ErrorFlag
  -- ^ An error code was found.
  | ParseErrorNotFound
  -- ^ The error code was not found.
  deriving (ParseErrorResult -> ParseErrorResult -> Bool
(ParseErrorResult -> ParseErrorResult -> Bool)
-> (ParseErrorResult -> ParseErrorResult -> Bool)
-> Eq ParseErrorResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParseErrorResult -> ParseErrorResult -> Bool
$c/= :: ParseErrorResult -> ParseErrorResult -> Bool
== :: ParseErrorResult -> ParseErrorResult -> Bool
$c== :: ParseErrorResult -> ParseErrorResult -> Bool
Eq, Eq ParseErrorResult
Eq ParseErrorResult
-> (ParseErrorResult -> ParseErrorResult -> Ordering)
-> (ParseErrorResult -> ParseErrorResult -> Bool)
-> (ParseErrorResult -> ParseErrorResult -> Bool)
-> (ParseErrorResult -> ParseErrorResult -> Bool)
-> (ParseErrorResult -> ParseErrorResult -> Bool)
-> (ParseErrorResult -> ParseErrorResult -> ParseErrorResult)
-> (ParseErrorResult -> ParseErrorResult -> ParseErrorResult)
-> Ord ParseErrorResult
ParseErrorResult -> ParseErrorResult -> Bool
ParseErrorResult -> ParseErrorResult -> Ordering
ParseErrorResult -> ParseErrorResult -> ParseErrorResult
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ParseErrorResult -> ParseErrorResult -> ParseErrorResult
$cmin :: ParseErrorResult -> ParseErrorResult -> ParseErrorResult
max :: ParseErrorResult -> ParseErrorResult -> ParseErrorResult
$cmax :: ParseErrorResult -> ParseErrorResult -> ParseErrorResult
>= :: ParseErrorResult -> ParseErrorResult -> Bool
$c>= :: ParseErrorResult -> ParseErrorResult -> Bool
> :: ParseErrorResult -> ParseErrorResult -> Bool
$c> :: ParseErrorResult -> ParseErrorResult -> Bool
<= :: ParseErrorResult -> ParseErrorResult -> Bool
$c<= :: ParseErrorResult -> ParseErrorResult -> Bool
< :: ParseErrorResult -> ParseErrorResult -> Bool
$c< :: ParseErrorResult -> ParseErrorResult -> Bool
compare :: ParseErrorResult -> ParseErrorResult -> Ordering
$ccompare :: ParseErrorResult -> ParseErrorResult -> Ordering
$cp1Ord :: Eq ParseErrorResult
Ord, Int -> ParseErrorResult -> ShowS
[ParseErrorResult] -> ShowS
ParseErrorResult -> String
(Int -> ParseErrorResult -> ShowS)
-> (ParseErrorResult -> String)
-> ([ParseErrorResult] -> ShowS)
-> Show ParseErrorResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParseErrorResult] -> ShowS
$cshowList :: [ParseErrorResult] -> ShowS
show :: ParseErrorResult -> String
$cshow :: ParseErrorResult -> String
showsPrec :: Int -> ParseErrorResult -> ShowS
$cshowsPrec :: Int -> ParseErrorResult -> ShowS
Show)

parseError :: (Integral a, Show a) => a -> ParseErrorResult
parseError :: a -> ParseErrorResult
parseError a
n = case a
n of
  a
0 -> ParseErrorResult
ParseErrorOk
{-# LINE 27 "src/Squeather/Internal/Bindings.hsc" #-}
  100 -> ParseErrorStep Row
{-# LINE 28 "src/Squeather/Internal/Bindings.hsc" #-}
  101 -> ParseErrorStep Done
{-# LINE 29 "src/Squeather/Internal/Bindings.hsc" #-}
  1 -> ParseErrorError SQLITE_ERROR
{-# LINE 30 "src/Squeather/Internal/Bindings.hsc" #-}
  2 -> ParseErrorError SQLITE_INTERNAL
{-# LINE 31 "src/Squeather/Internal/Bindings.hsc" #-}
  3 -> ParseErrorError SQLITE_PERM
{-# LINE 32 "src/Squeather/Internal/Bindings.hsc" #-}
  4 -> ParseErrorError SQLITE_ABORT
{-# LINE 33 "src/Squeather/Internal/Bindings.hsc" #-}
  5 -> ParseErrorError SQLITE_BUSY
{-# LINE 34 "src/Squeather/Internal/Bindings.hsc" #-}
  6 -> ParseErrorError SQLITE_LOCKED
{-# LINE 35 "src/Squeather/Internal/Bindings.hsc" #-}
  7 -> ParseErrorError SQLITE_NOMEM
{-# LINE 36 "src/Squeather/Internal/Bindings.hsc" #-}
  8 -> ParseErrorError SQLITE_READONLY
{-# LINE 37 "src/Squeather/Internal/Bindings.hsc" #-}
  9 -> ParseErrorError SQLITE_INTERRUPT
{-# LINE 38 "src/Squeather/Internal/Bindings.hsc" #-}
  10 -> ParseErrorError SQLITE_IOERR
{-# LINE 39 "src/Squeather/Internal/Bindings.hsc" #-}
  11 -> ParseErrorError SQLITE_CORRUPT
{-# LINE 40 "src/Squeather/Internal/Bindings.hsc" #-}
  12 -> ParseErrorError SQLITE_NOTFOUND
{-# LINE 41 "src/Squeather/Internal/Bindings.hsc" #-}
  13 -> ParseErrorError SQLITE_FULL
{-# LINE 42 "src/Squeather/Internal/Bindings.hsc" #-}
  14 -> ParseErrorError SQLITE_CANTOPEN
{-# LINE 43 "src/Squeather/Internal/Bindings.hsc" #-}
  15 -> ParseErrorError SQLITE_PROTOCOL
{-# LINE 44 "src/Squeather/Internal/Bindings.hsc" #-}
  16 -> ParseErrorError SQLITE_EMPTY
{-# LINE 45 "src/Squeather/Internal/Bindings.hsc" #-}
  17 -> ParseErrorError SQLITE_SCHEMA
{-# LINE 46 "src/Squeather/Internal/Bindings.hsc" #-}
  18 -> ParseErrorError SQLITE_TOOBIG
{-# LINE 47 "src/Squeather/Internal/Bindings.hsc" #-}
  19 -> ParseErrorError SQLITE_CONSTRAINT
{-# LINE 48 "src/Squeather/Internal/Bindings.hsc" #-}
  20 -> ParseErrorError SQLITE_MISMATCH
{-# LINE 49 "src/Squeather/Internal/Bindings.hsc" #-}
  21 -> ParseErrorError SQLITE_MISUSE
{-# LINE 50 "src/Squeather/Internal/Bindings.hsc" #-}
  22 -> ParseErrorError SQLITE_NOLFS
{-# LINE 51 "src/Squeather/Internal/Bindings.hsc" #-}
  23 -> ParseErrorError SQLITE_AUTH
{-# LINE 52 "src/Squeather/Internal/Bindings.hsc" #-}
  24 -> ParseErrorError SQLITE_FORMAT
{-# LINE 53 "src/Squeather/Internal/Bindings.hsc" #-}
  25 -> ParseErrorError SQLITE_RANGE
{-# LINE 54 "src/Squeather/Internal/Bindings.hsc" #-}
  26 -> ParseErrorError SQLITE_NOTADB
{-# LINE 55 "src/Squeather/Internal/Bindings.hsc" #-}
  27 -> ParseErrorError SQLITE_NOTICE
{-# LINE 56 "src/Squeather/Internal/Bindings.hsc" #-}
  28 -> ParseErrorError SQLITE_WARNING
{-# LINE 57 "src/Squeather/Internal/Bindings.hsc" #-}
  257 -> ParseErrorError SQLITE_ERROR_MISSING_COLLSEQ
{-# LINE 58 "src/Squeather/Internal/Bindings.hsc" #-}
  513 -> ParseErrorError SQLITE_ERROR_RETRY
{-# LINE 59 "src/Squeather/Internal/Bindings.hsc" #-}
  769 -> ParseErrorError SQLITE_ERROR_SNAPSHOT
{-# LINE 60 "src/Squeather/Internal/Bindings.hsc" #-}
  266 -> ParseErrorError SQLITE_IOERR_READ
{-# LINE 61 "src/Squeather/Internal/Bindings.hsc" #-}
  522 -> ParseErrorError SQLITE_IOERR_SHORT_READ
{-# LINE 62 "src/Squeather/Internal/Bindings.hsc" #-}
  778 -> ParseErrorError SQLITE_IOERR_WRITE
{-# LINE 63 "src/Squeather/Internal/Bindings.hsc" #-}
  1034 -> ParseErrorError SQLITE_IOERR_FSYNC
{-# LINE 64 "src/Squeather/Internal/Bindings.hsc" #-}
  1290 -> ParseErrorError SQLITE_IOERR_DIR_FSYNC
{-# LINE 65 "src/Squeather/Internal/Bindings.hsc" #-}
  1546 -> ParseErrorError SQLITE_IOERR_TRUNCATE
{-# LINE 66 "src/Squeather/Internal/Bindings.hsc" #-}
  1802 -> ParseErrorError SQLITE_IOERR_FSTAT
{-# LINE 67 "src/Squeather/Internal/Bindings.hsc" #-}
  2058 -> ParseErrorError SQLITE_IOERR_UNLOCK
{-# LINE 68 "src/Squeather/Internal/Bindings.hsc" #-}
  2314 -> ParseErrorError SQLITE_IOERR_RDLOCK
{-# LINE 69 "src/Squeather/Internal/Bindings.hsc" #-}
  2570 -> ParseErrorError SQLITE_IOERR_DELETE
{-# LINE 70 "src/Squeather/Internal/Bindings.hsc" #-}
  2826 -> ParseErrorError SQLITE_IOERR_BLOCKED
{-# LINE 71 "src/Squeather/Internal/Bindings.hsc" #-}
  3082 -> ParseErrorError SQLITE_IOERR_NOMEM
{-# LINE 72 "src/Squeather/Internal/Bindings.hsc" #-}
  3338 -> ParseErrorError SQLITE_IOERR_ACCESS
{-# LINE 73 "src/Squeather/Internal/Bindings.hsc" #-}
  3594 -> ParseErrorError SQLITE_IOERR_CHECKRESERVEDLOCK
{-# LINE 74 "src/Squeather/Internal/Bindings.hsc" #-}
  3850 -> ParseErrorError SQLITE_IOERR_LOCK
{-# LINE 75 "src/Squeather/Internal/Bindings.hsc" #-}
  4106 -> ParseErrorError SQLITE_IOERR_CLOSE
{-# LINE 76 "src/Squeather/Internal/Bindings.hsc" #-}
  4362 -> ParseErrorError SQLITE_IOERR_DIR_CLOSE
{-# LINE 77 "src/Squeather/Internal/Bindings.hsc" #-}
  4618 -> ParseErrorError SQLITE_IOERR_SHMOPEN
{-# LINE 78 "src/Squeather/Internal/Bindings.hsc" #-}
  4874 -> ParseErrorError SQLITE_IOERR_SHMSIZE
{-# LINE 79 "src/Squeather/Internal/Bindings.hsc" #-}
  5130 -> ParseErrorError SQLITE_IOERR_SHMLOCK
{-# LINE 80 "src/Squeather/Internal/Bindings.hsc" #-}
  5386 -> ParseErrorError SQLITE_IOERR_SHMMAP
{-# LINE 81 "src/Squeather/Internal/Bindings.hsc" #-}
  5642 -> ParseErrorError SQLITE_IOERR_SEEK
{-# LINE 82 "src/Squeather/Internal/Bindings.hsc" #-}
  5898 -> ParseErrorError SQLITE_IOERR_DELETE_NOENT
{-# LINE 83 "src/Squeather/Internal/Bindings.hsc" #-}
  6154 -> ParseErrorError SQLITE_IOERR_MMAP
{-# LINE 84 "src/Squeather/Internal/Bindings.hsc" #-}
  6410 -> ParseErrorError SQLITE_IOERR_GETTEMPPATH
{-# LINE 85 "src/Squeather/Internal/Bindings.hsc" #-}
  6666 -> ParseErrorError SQLITE_IOERR_CONVPATH
{-# LINE 86 "src/Squeather/Internal/Bindings.hsc" #-}
  6922 -> ParseErrorError SQLITE_IOERR_VNODE
{-# LINE 87 "src/Squeather/Internal/Bindings.hsc" #-}
  7178 -> ParseErrorError SQLITE_IOERR_AUTH
{-# LINE 88 "src/Squeather/Internal/Bindings.hsc" #-}
  7434 -> ParseErrorError SQLITE_IOERR_BEGIN_ATOMIC
{-# LINE 89 "src/Squeather/Internal/Bindings.hsc" #-}
  7690 -> ParseErrorError SQLITE_IOERR_COMMIT_ATOMIC
{-# LINE 90 "src/Squeather/Internal/Bindings.hsc" #-}
  7946 -> ParseErrorError SQLITE_IOERR_ROLLBACK_ATOMIC
{-# LINE 91 "src/Squeather/Internal/Bindings.hsc" #-}
  262 -> ParseErrorError SQLITE_LOCKED_SHAREDCACHE
{-# LINE 92 "src/Squeather/Internal/Bindings.hsc" #-}
  518 -> ParseErrorError SQLITE_LOCKED_VTAB
{-# LINE 93 "src/Squeather/Internal/Bindings.hsc" #-}
  261 -> ParseErrorError SQLITE_BUSY_RECOVERY
{-# LINE 94 "src/Squeather/Internal/Bindings.hsc" #-}
  517 -> ParseErrorError SQLITE_BUSY_SNAPSHOT
{-# LINE 95 "src/Squeather/Internal/Bindings.hsc" #-}
  270 -> ParseErrorError SQLITE_CANTOPEN_NOTEMPDIR
{-# LINE 96 "src/Squeather/Internal/Bindings.hsc" #-}
  526 -> ParseErrorError SQLITE_CANTOPEN_ISDIR
{-# LINE 97 "src/Squeather/Internal/Bindings.hsc" #-}
  782 -> ParseErrorError SQLITE_CANTOPEN_FULLPATH
{-# LINE 98 "src/Squeather/Internal/Bindings.hsc" #-}
  1038 -> ParseErrorError SQLITE_CANTOPEN_CONVPATH
{-# LINE 99 "src/Squeather/Internal/Bindings.hsc" #-}
  1294 -> ParseErrorError SQLITE_CANTOPEN_DIRTYWAL
{-# LINE 100 "src/Squeather/Internal/Bindings.hsc" #-}
  1550 -> ParseErrorError SQLITE_CANTOPEN_SYMLINK
{-# LINE 101 "src/Squeather/Internal/Bindings.hsc" #-}
  267 -> ParseErrorError SQLITE_CORRUPT_VTAB
{-# LINE 102 "src/Squeather/Internal/Bindings.hsc" #-}
  523 -> ParseErrorError SQLITE_CORRUPT_SEQUENCE
{-# LINE 103 "src/Squeather/Internal/Bindings.hsc" #-}
  264 -> ParseErrorError SQLITE_READONLY_RECOVERY
{-# LINE 104 "src/Squeather/Internal/Bindings.hsc" #-}
  520 -> ParseErrorError SQLITE_READONLY_CANTLOCK
{-# LINE 105 "src/Squeather/Internal/Bindings.hsc" #-}
  776 -> ParseErrorError SQLITE_READONLY_ROLLBACK
{-# LINE 106 "src/Squeather/Internal/Bindings.hsc" #-}
  1032 -> ParseErrorError SQLITE_READONLY_DBMOVED
{-# LINE 107 "src/Squeather/Internal/Bindings.hsc" #-}
  1288 -> ParseErrorError SQLITE_READONLY_CANTINIT
{-# LINE 108 "src/Squeather/Internal/Bindings.hsc" #-}
  1544 -> ParseErrorError SQLITE_READONLY_DIRECTORY
{-# LINE 109 "src/Squeather/Internal/Bindings.hsc" #-}
  516 -> ParseErrorError SQLITE_ABORT_ROLLBACK
{-# LINE 110 "src/Squeather/Internal/Bindings.hsc" #-}
  275 -> ParseErrorError SQLITE_CONSTRAINT_CHECK
{-# LINE 111 "src/Squeather/Internal/Bindings.hsc" #-}
  531 -> ParseErrorError SQLITE_CONSTRAINT_COMMITHOOK
{-# LINE 112 "src/Squeather/Internal/Bindings.hsc" #-}
  787 -> ParseErrorError SQLITE_CONSTRAINT_FOREIGNKEY
{-# LINE 113 "src/Squeather/Internal/Bindings.hsc" #-}
  1043 -> ParseErrorError SQLITE_CONSTRAINT_FUNCTION
{-# LINE 114 "src/Squeather/Internal/Bindings.hsc" #-}
  1299 -> ParseErrorError SQLITE_CONSTRAINT_NOTNULL
{-# LINE 115 "src/Squeather/Internal/Bindings.hsc" #-}
  1555 -> ParseErrorError SQLITE_CONSTRAINT_PRIMARYKEY
{-# LINE 116 "src/Squeather/Internal/Bindings.hsc" #-}
  1811 -> ParseErrorError SQLITE_CONSTRAINT_TRIGGER
{-# LINE 117 "src/Squeather/Internal/Bindings.hsc" #-}
  2067 -> ParseErrorError SQLITE_CONSTRAINT_UNIQUE
{-# LINE 118 "src/Squeather/Internal/Bindings.hsc" #-}
  2323 -> ParseErrorError SQLITE_CONSTRAINT_VTAB
{-# LINE 119 "src/Squeather/Internal/Bindings.hsc" #-}
  2579 -> ParseErrorError SQLITE_CONSTRAINT_ROWID
{-# LINE 120 "src/Squeather/Internal/Bindings.hsc" #-}
  2835 -> ParseErrorError SQLITE_CONSTRAINT_PINNED
{-# LINE 121 "src/Squeather/Internal/Bindings.hsc" #-}
  283 -> ParseErrorError SQLITE_NOTICE_RECOVER_WAL
{-# LINE 122 "src/Squeather/Internal/Bindings.hsc" #-}
  539 -> ParseErrorError SQLITE_NOTICE_RECOVER_ROLLBACK
{-# LINE 123 "src/Squeather/Internal/Bindings.hsc" #-}
  284 -> ParseErrorError SQLITE_WARNING_AUTOINDEX
{-# LINE 124 "src/Squeather/Internal/Bindings.hsc" #-}
  279 -> ParseErrorError SQLITE_AUTH_USER
{-# LINE 125 "src/Squeather/Internal/Bindings.hsc" #-}

  -- The next two are strange because they are not really errors.
  -- For the time being I'll just leave them in this case statement
  -- because they shouldn't arise when using this library.
  a
256 -> ErrorFlag -> ParseErrorResult
ParseErrorError ErrorFlag
SQLITE_OK_LOAD_PERMANENTLY
{-# LINE 130 "src/Squeather/Internal/Bindings.hsc" #-}
  512 -> ParseErrorError SQLITE_OK_SYMLINK
{-# LINE 131 "src/Squeather/Internal/Bindings.hsc" #-}
  _ -> ParseErrorNotFound

c'SQLITE_VERSION :: String
c'SQLITE_VERSION :: String
c'SQLITE_VERSION = String
"3.35.5"
{-# LINE 135 "src/Squeather/Internal/Bindings.hsc" #-}

c'SQLITE_VERSION_NUMBER :: Integral a => a
c'SQLITE_VERSION_NUMBER :: a
c'SQLITE_VERSION_NUMBER = a
3035005
{-# LINE 138 "src/Squeather/Internal/Bindings.hsc" #-}

c'SQLITE_SOURCE_ID :: String
c'SQLITE_SOURCE_ID :: String
c'SQLITE_SOURCE_ID = String
"2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98fae886"
{-# LINE 141 "src/Squeather/Internal/Bindings.hsc" #-}

c'SQLITE_STATIC :: Integral a => a
c'SQLITE_STATIC :: a
c'SQLITE_STATIC = a
0
{-# LINE 144 "src/Squeather/Internal/Bindings.hsc" #-}

c'SQLITE_TRANSIENT :: Integral a => a
c'SQLITE_TRANSIENT :: a
c'SQLITE_TRANSIENT = a
18446744073709551615
{-# LINE 147 "src/Squeather/Internal/Bindings.hsc" #-}

-- | Various types of SQL data; used both when obtaining
-- query results and when providing named parameters.
data SQLData
  = SQLNull
  | SQLText Text
  | SQLFloat Double
  | SQLInteger Int64
  | SQLBlob ByteString
  deriving (SQLData -> SQLData -> Bool
(SQLData -> SQLData -> Bool)
-> (SQLData -> SQLData -> Bool) -> Eq SQLData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SQLData -> SQLData -> Bool
$c/= :: SQLData -> SQLData -> Bool
== :: SQLData -> SQLData -> Bool
$c== :: SQLData -> SQLData -> Bool
Eq, Eq SQLData
Eq SQLData
-> (SQLData -> SQLData -> Ordering)
-> (SQLData -> SQLData -> Bool)
-> (SQLData -> SQLData -> Bool)
-> (SQLData -> SQLData -> Bool)
-> (SQLData -> SQLData -> Bool)
-> (SQLData -> SQLData -> SQLData)
-> (SQLData -> SQLData -> SQLData)
-> Ord SQLData
SQLData -> SQLData -> Bool
SQLData -> SQLData -> Ordering
SQLData -> SQLData -> SQLData
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SQLData -> SQLData -> SQLData
$cmin :: SQLData -> SQLData -> SQLData
max :: SQLData -> SQLData -> SQLData
$cmax :: SQLData -> SQLData -> SQLData
>= :: SQLData -> SQLData -> Bool
$c>= :: SQLData -> SQLData -> Bool
> :: SQLData -> SQLData -> Bool
$c> :: SQLData -> SQLData -> Bool
<= :: SQLData -> SQLData -> Bool
$c<= :: SQLData -> SQLData -> Bool
< :: SQLData -> SQLData -> Bool
$c< :: SQLData -> SQLData -> Bool
compare :: SQLData -> SQLData -> Ordering
$ccompare :: SQLData -> SQLData -> Ordering
$cp1Ord :: Eq SQLData
Ord, Int -> SQLData -> ShowS
[SQLData] -> ShowS
SQLData -> String
(Int -> SQLData -> ShowS)
-> (SQLData -> String) -> ([SQLData] -> ShowS) -> Show SQLData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SQLData] -> ShowS
$cshowList :: [SQLData] -> ShowS
show :: SQLData -> String
$cshow :: SQLData -> String
showsPrec :: Int -> SQLData -> ShowS
$cshowsPrec :: Int -> SQLData -> ShowS
Show)

flagsToInt :: OpenFlags -> CInt
flagsToInt :: OpenFlags -> CInt
flagsToInt (OpenFlags WriteMode
fWrite Bool
furi Bool
fmemory ThreadMode
fthread CacheMode
fcache Bool
fnoFollow)
  = CInt
0
  CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.|. WriteMode -> CInt
writeModeToInt WriteMode
fWrite
  CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.|. Bool -> CInt -> CInt
forall p. Num p => Bool -> p -> p
iff Bool
furi CInt
64
{-# LINE 163 "src/Squeather/Internal/Bindings.hsc" #-}
  .|. iff fmemory 128
{-# LINE 164 "src/Squeather/Internal/Bindings.hsc" #-}
  .|. threadModeToInt fthread
  CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.|. CacheMode -> CInt
cacheModeToInt CacheMode
fcache
  CInt -> CInt -> CInt
forall a. Bits a => a -> a -> a
.|. Bool -> CInt -> CInt
forall p. Num p => Bool -> p -> p
iff Bool
fnoFollow CInt
16777216
{-# LINE 167 "src/Squeather/Internal/Bindings.hsc" #-}
  where
    iff :: Bool -> p -> p
iff Bool
b p
n = if Bool
b then p
n else p
0

cacheModeToInt :: CacheMode -> CInt
cacheModeToInt :: CacheMode -> CInt
cacheModeToInt CacheMode
c = case CacheMode
c of
  CacheMode
Shared -> CInt
131072
{-# LINE 173 "src/Squeather/Internal/Bindings.hsc" #-}
  Private -> 262144
{-# LINE 174 "src/Squeather/Internal/Bindings.hsc" #-}

threadModeToInt :: ThreadMode -> CInt
threadModeToInt :: ThreadMode -> CInt
threadModeToInt ThreadMode
t = case ThreadMode
t of
  ThreadMode
MultiThread -> CInt
32768
{-# LINE 178 "src/Squeather/Internal/Bindings.hsc" #-}
  Serialized -> 65536
{-# LINE 179 "src/Squeather/Internal/Bindings.hsc" #-}

writeModeToInt :: WriteMode -> CInt
writeModeToInt :: WriteMode -> CInt
writeModeToInt WriteMode
w = case WriteMode
w of
  WriteMode
ReadOnly -> CInt
1
{-# LINE 183 "src/Squeather/Internal/Bindings.hsc" #-}
  ReadWrite c -> 2 .|. case c of
{-# LINE 184 "src/Squeather/Internal/Bindings.hsc" #-}
    Create -> 4
{-# LINE 185 "src/Squeather/Internal/Bindings.hsc" #-}
    NoCreate -> 0

-- | Returns a 'SQLData' that indicates only the data type
-- corresponding to the given constant.  Any fields in the 'SQLData' will
-- be 'undefined'.
convertCColumnType :: Integral a => a -> Maybe SQLData
convertCColumnType :: a -> Maybe SQLData
convertCColumnType a
x = case a
x of
  a
1 -> SQLData -> Maybe SQLData
forall a. a -> Maybe a
Just (SQLData -> Maybe SQLData) -> SQLData -> Maybe SQLData
forall a b. (a -> b) -> a -> b
$ Int64 -> SQLData
SQLInteger Int64
forall a. HasCallStack => a
undefined
{-# LINE 193 "src/Squeather/Internal/Bindings.hsc" #-}
  2 -> Just $ SQLFloat undefined
{-# LINE 194 "src/Squeather/Internal/Bindings.hsc" #-}
  4 -> Just $ SQLBlob undefined
{-# LINE 195 "src/Squeather/Internal/Bindings.hsc" #-}
  5 -> Just SQLNull
{-# LINE 196 "src/Squeather/Internal/Bindings.hsc" #-}
  3 -> Just $ SQLText undefined
{-# LINE 197 "src/Squeather/Internal/Bindings.hsc" #-}
  _ -> Nothing