orville-postgresql-1.0.0.0: A Haskell library for PostgreSQL
CopyrightFlipstone Technology Partners 2023
LicenseMIT
StabilityStable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Orville.PostgreSQL.Expr.Cursor

Description

Since: 1.0.0.0

Synopsis

Documentation

data DeclareExpr Source #

DeclareExpr corresponds to the SQL DECLARE statement, for declaring and opening cursors. E.G.

DECLARE FOO CURSOR FOR SELECT * FROM BAR

See PostgreSQL cursor declare documentation for more information.

DeclareExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression DeclareExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

declare :: CursorName -> Maybe ScrollExpr -> Maybe HoldExpr -> QueryExpr -> DeclareExpr Source #

A smart constructor for setting up a DeclareExpr. This, along with other functions provided, allows users to more safely declare a cursor.

Since: 1.0.0.0

data ScrollExpr Source #

ScrollExpr is used to determine if a cursor should be able to fetch nonsequentially. E.G.

NO SCROLL

Note that the default in at least PostgreSQL versions 11-15 is to allow nonsequential fetches under some, but not all, circumstances.

See PostgreSQL cursor declare documentation for more information.

ScrollExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression ScrollExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

scroll :: ScrollExpr Source #

Allow a cursor to be used to fetch rows nonsequentially.

Since: 1.0.0.0

noScroll :: ScrollExpr Source #

Only allow a cursor to be used to fetch rows sequentially.

Since: 1.0.0.0

data HoldExpr Source #

HoldExpr is used to determine if a cursor should be available for use after the transaction that created it has been committed. E.G.

WITH HOLD

See PostgreSQL cursor documentation for more information.

HoldExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression HoldExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

withHold :: HoldExpr Source #

Allow a cursor to be used after the transaction creating it is committed.

Since: 1.0.0.0

withoutHold :: HoldExpr Source #

Do not allow a cursor to be used after the transaction creating it is committed.

Since: 1.0.0.0

data CloseExpr Source #

CloseExpr corresponds to the SQL CLOSE statement. E.G.

CLOSE ALL

See PostgreSQL close documentation for more information.

HoldExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression CloseExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

close :: Either AllCursors CursorName -> CloseExpr Source #

A smart constructor for setting up a CloseExpr, either closing all cursors or the given named cursor.

Since: 1.0.0.0

data AllCursors Source #

AllCursors corresponds to the ALL keyword in a CLOSE statement. E.G.

ALL

AllCursors provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression AllCursors Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

allCursors :: AllCursors Source #

Specify closing all open cursors, for use with a CloseExpr.

Since: 1.0.0.0

data FetchExpr Source #

FetchExpr corresponds to the SQL FETCH statement, for retrieving rows from a previously-created cursor. E.G.

FETCH NEXT FOO

See PostgreSQL fetch documentation for more information.

FetchExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression FetchExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

fetch :: Maybe CursorDirection -> CursorName -> FetchExpr Source #

Construct a FetchExpr, for a given cursor and optionally a direction to fetch.

Since: 1.0.0.0

data MoveExpr Source #

MoveExpr corresponds to the SQL MOVE statement, for positioning a previously created cursor, without retrieving any rows. E.G.

MOVE NEXT FOO

MoveExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression MoveExpr Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

move :: Maybe CursorDirection -> CursorName -> MoveExpr Source #

Construct a MoveExpr, for a given cursor and optionally a direction to move.

Since: 1.0.0.0

data CursorDirection Source #

CursorDirection corresponds to the direction argument to the SQL FETCH and MOVE statements. E.G.

BACKWARD

See PostgreSQL fetch documentation for more information.

CursorDirection provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

Instances

Instances details
SqlExpression CursorDirection Source #

Since: 1.0.0.0

Instance details

Defined in Orville.PostgreSQL.Expr.Cursor

next :: CursorDirection Source #

Specify the direction of the next single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

prior :: CursorDirection Source #

Specify the direction of the prior single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

first :: CursorDirection Source #

Specify the direction of the first single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

last :: CursorDirection Source #

Specify the direction of the last single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

absolute :: Int -> CursorDirection Source #

Specify the direction of the single row at an absolute position within the cursor. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

relative :: Int -> CursorDirection Source #

Specify the direction of the single row relative to the cursor's current position. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

rowCount :: Int -> CursorDirection Source #

Specify the direction of the next n rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

fetchAll :: CursorDirection Source #

Specify the direction of all the next rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

forward :: CursorDirection Source #

Specify the direction of the next single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

forwardCount :: Int -> CursorDirection Source #

Specify the direction of the next n rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

forwardAll :: CursorDirection Source #

Specify the direction of all the next rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

backward :: CursorDirection Source #

Specify the direction of the prior single row. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

backwardCount :: Int -> CursorDirection Source #

Specify the direction of the prior n rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0

backwardAll :: CursorDirection Source #

Specify the direction of all the prior rows. Primarily for use with fetch or move.

See PostgreSQL fetch documentation for more information.

Since: 1.0.0.0