Copyright | Flipstone Technology Partners 2023 |
---|---|
License | MIT |
Stability | Stable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Since: 1.0.0.0
Synopsis
- data DeclareExpr
- declare :: CursorName -> Maybe ScrollExpr -> Maybe HoldExpr -> QueryExpr -> DeclareExpr
- data ScrollExpr
- scroll :: ScrollExpr
- noScroll :: ScrollExpr
- data HoldExpr
- withHold :: HoldExpr
- withoutHold :: HoldExpr
- data CloseExpr
- close :: Either AllCursors CursorName -> CloseExpr
- data AllCursors
- allCursors :: AllCursors
- data FetchExpr
- fetch :: Maybe CursorDirection -> CursorName -> FetchExpr
- data MoveExpr
- move :: Maybe CursorDirection -> CursorName -> MoveExpr
- data CursorDirection
- next :: CursorDirection
- prior :: CursorDirection
- first :: CursorDirection
- last :: CursorDirection
- absolute :: Int -> CursorDirection
- relative :: Int -> CursorDirection
- rowCount :: Int -> CursorDirection
- fetchAll :: CursorDirection
- forward :: CursorDirection
- forwardCount :: Int -> CursorDirection
- forwardAll :: CursorDirection
- backward :: CursorDirection
- backwardCount :: Int -> CursorDirection
- backwardAll :: CursorDirection
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
SqlExpression DeclareExpr Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Cursor toRawSql :: DeclareExpr -> RawSql Source # unsafeFromRawSql :: RawSql -> DeclareExpr Source # |
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
SqlExpression ScrollExpr Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Cursor toRawSql :: ScrollExpr -> RawSql Source # unsafeFromRawSql :: RawSql -> ScrollExpr Source # |
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
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
SqlExpression HoldExpr Source # | Since: 1.0.0.0 |
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
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
SqlExpression CloseExpr Source # | Since: 1.0.0.0 |
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
SqlExpression AllCursors Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Cursor toRawSql :: AllCursors -> RawSql Source # unsafeFromRawSql :: RawSql -> AllCursors Source # |
allCursors :: AllCursors Source #
Specify closing all open cursors, for use with a CloseExpr
.
Since: 1.0.0.0
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
SqlExpression FetchExpr Source # | Since: 1.0.0.0 |
fetch :: Maybe CursorDirection -> CursorName -> FetchExpr Source #
Construct a FetchExpr
, for a given cursor and optionally a direction to fetch.
Since: 1.0.0.0
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
SqlExpression MoveExpr Source # | Since: 1.0.0.0 |
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
SqlExpression CursorDirection Source # | Since: 1.0.0.0 |
Defined in Orville.PostgreSQL.Expr.Cursor toRawSql :: CursorDirection -> RawSql Source # |
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