HDBC-sqlite3-2.3.3.1: Sqlite v3 driver for HDBC

Copyright | Copyright (C) 2005-2011 John Goerzen
License | BSD3
Maintainer | John Goerzen <jgoerzen@complete.org>
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell98

Database.HDBC.Sqlite3

Contents

- Sqlite3 Basics
- Sqlite3 Error Consts

Description

HDBC driver interface for Sqlite 3.x.

Written by John Goerzen, jgoerzen@complete.org

Synopsis

- connectSqlite3 :: FilePath -> IO Connection
- connectSqlite3Raw :: FilePath -> IO Connection
- data Connection
- setBusyTimeout :: Connection -> CInt -> IO ()
- sqlite_OK :: Int
- sqlite_ERROR :: Int
- sqlite_INTERNAL :: Int
- sqlite_PERM :: Int
- sqlite_ABORT :: Int
- sqlite_BUSY :: Int
- sqlite_LOCKED :: Int
- sqlite_NOMEM :: Int
- sqlite_READONLY :: Int
- sqlite_INTERRUPT :: Int
- sqlite_IOERR :: Int
- sqlite_CORRUPT :: Int
- sqlite_NOTFOUND :: Int
- sqlite_FULL :: Int
- sqlite_CANTOPEN :: Int
- sqlite_PROTOCOL :: Int
- sqlite_EMPTY :: Int
- sqlite_SCHEMA :: Int
- sqlite_TOOBIG :: Int
- sqlite_CONSTRAINT :: Int
- sqlite_MISMATCH :: Int
- sqlite_MISUSE :: Int
- sqlite_NOLFS :: Int
- sqlite_AUTH :: Int
- sqlite_ROW :: Int
- sqlite_DONE :: Int

# Sqlite3 Basics

connectSqlite3 :: FilePath -> IO Connection Source #

Connect to an Sqlite version 3 database. The only parameter needed is the filename of the database to connect to.

All database accessor functions are provided in the main HDBC module.

connectSqlite3Raw :: FilePath -> IO Connection Source #

Connects to a Sqlite v3 database as with `connectSqlite3`, but instead of converting the supplied `FilePath` to a C String by performing a conversion to Unicode, instead converts it by simply dropping all bits past the eighth. This may be useful in rare situations if your application or filesystemare not running in Unicode space.

data Connection Source #

#### Instances

Instances details

IConnection Connection Source # |

Instance details

Defined in Database.HDBC.Sqlite3.ConnectionImpl

Methods

disconnect :: Connection -> IO () Source #

commit :: Connection -> IO () Source #

rollback :: Connection -> IO () Source #

runRaw :: Connection -> String -> IO () Source #

run :: Connection -> String -> [SqlValue] -> IO Integer Source #

prepare :: Connection -> String -> IO Statement Source #

clone :: Connection -> IO Connection Source #

hdbcDriverName :: Connection -> String Source #

hdbcClientVer :: Connection -> String Source #

proxiedClientName :: Connection -> String Source #

proxiedClientVer :: Connection -> String Source #

dbServerVer :: Connection -> String Source #

dbTransactionSupport :: Connection -> Bool Source #

getTables :: Connection -> IO [String] Source #

describeTable :: Connection -> String -> IO [(String, SqlColDesc)] Source #

setBusyTimeout :: Connection -> CInt -> IO () Source #

Sets the timeout for a lock before returning a busy error. Give the time in milliseconds.

# Sqlite3 Error Consts

sqlite_OK :: Int Source #

Successful result

sqlite_ERROR :: Int Source #

SQL error or missing database

sqlite_INTERNAL :: Int Source #

An internal logic error in SQLite

sqlite_PERM :: Int Source #

Access permission denied

sqlite_ABORT :: Int Source #

Callback routine requested an abort

sqlite_BUSY :: Int Source #

The database file is locked

sqlite_LOCKED :: Int Source #

A table in the database is locked

sqlite_NOMEM :: Int Source #

A malloc() failed

sqlite_READONLY :: Int Source #

Attempt to write a readonly database

sqlite_INTERRUPT :: Int Source #

Operation terminated by sqlite_interrupt()

sqlite_IOERR :: Int Source #

Some kind of disk I/O error occurred

sqlite_CORRUPT :: Int Source #

The database disk image is malformed

sqlite_NOTFOUND :: Int Source #

(Internal Only) Table or record not found

sqlite_FULL :: Int Source #

Insertion failed because database is full

sqlite_CANTOPEN :: Int Source #

Unable to open the database file

sqlite_PROTOCOL :: Int Source #

Database lock protocol error

sqlite_EMPTY :: Int Source #

(Internal Only) Database table is empty

sqlite_SCHEMA :: Int Source #

The database schema changed

sqlite_TOOBIG :: Int Source #

Too much data for one row of a table

sqlite_CONSTRAINT :: Int Source #

Abort due to constraint violation

sqlite_MISMATCH :: Int Source #

Data type mismatch

sqlite_MISUSE :: Int Source #

Library used incorrectly

sqlite_NOLFS :: Int Source #

Uses OS features not supported on host

sqlite_AUTH :: Int Source #

Authorization denied

sqlite_ROW :: Int Source #

sqlite_step() has another row ready

sqlite_DONE :: Int Source #

sqlite_step() has finished executing