Module

Yoga.SQLite.SQLite

Package
purescript-yoga-sqlite
Repository
rowtype-yoga/purescript-yoga-sqlite

#DBConnection Source

#Transaction Source

#Statement Source

data Statement t0 t1

#RowId Source

newtype RowId

Constructors

Instances

#open Source

open :: DatabasePath -> Effect DBConnection

Open a database connection

#close Source

close :: DBConnection -> Effect Unit

Close a database connection

#exec Source

exec :: String -> Array SQLParameter -> DBConnection -> Effect Unit

Execute a statement (INSERT/UPDATE/DELETE)

#query Source

query :: String -> Array SQLParameter -> DBConnection -> Effect (Array (Array SQLResult))

Query for multiple rows

#queryOne Source

queryOne :: String -> Array SQLParameter -> DBConnection -> Effect (Maybe (Array SQLResult))

Query for a single row

#lastInsertRowId Source

lastInsertRowId :: DBConnection -> Effect Int

Get last inserted row ID

#beginTransaction Source

#commit Source

commit :: Transaction -> Effect Unit

Commit a transaction

#rollback Source

rollback :: Transaction -> Effect Unit

Rollback a transaction

#PreparedStatement Source

newtype PreparedStatement :: forall k1 k2. k1 -> k2 -> Typenewtype PreparedStatement i o

Constructors

#prepare Source

prepare :: forall @i @o. String -> DBConnection -> Effect (Statement i o)

Prepare a statement

#InfoImpl Source

type InfoImpl = { changes :: Int, lastInsertRowid :: Nullable Int }

#Info Source

type Info = { changes :: NumberOfChanges, lastInsertRowid :: Maybe RowId }

#fromRowInfoImpl Source

#run Source

run :: forall i. Array SQLParameter -> Statement i Void -> Effect Info

Run a statement (INSERT/UPDATE/DELETE)

#run_ Source

run_ :: Statement Void Void -> Effect Info

Run a statement with no parameters

#allRaw Source

allRaw :: forall i o. Array SQLParameter -> Statement i o -> Effect (Array (Array SQLResult))

Query all rows (raw results)

#all Source

all :: forall i @o. Array SQLParameter -> (Array SQLResult -> Either String o) -> Statement i o -> Effect (Either String (Array o))

Query all rows with result parsing

#all1 Source

all1 :: forall i o. Array SQLParameter -> (Array SQLResult -> Either String o) -> Statement i o -> Effect (Either String o)

Query exactly one row

#all_ Source

all_ :: forall o. Array SQLParameter -> Statement Void o -> Effect (Array (Array SQLResult))

Query all rows with no parameters

#StatementSource Source

#statementSource Source