Connection

postgres.ql

Constructor Overview

Constructor Description
Connection(_connection)

Function Overview

Function Description
native fun isConnected() Check if the connection is connected.
native fun prepareStatement(statementString) Prepare a statement for execution without any parameters given yet.
native fun prepareStatement(statementString, paramList) Prepare a statement for execution with pre populated parameters.
native fun query(query) Query the database.
native fun fetchOne(query) Fetch one row from the database.
native fun fetchAll(query) Fetch all rows from the database.
native fun update(query) Update entries in the database.
native fun execute(query) Executes a query that does not return any data.
native fun beginTransaction() Begins a transaction for executing multiple queries.
native fun commit() Commits a transaction.
native fun rollback() Rolls back a transaction.
native fun disconnect() Disconnect from the database.

Constructors

Connection(_connection) link

Functions

native fun isConnected() link

Check if the connection is connected.

Returns boolean

If the connection is connected

postgres:postgres.ql
native fun prepareStatement(statementString) link

Prepare a statement for execution without any parameters given yet.

Params
statementString ( string )

The statement to prepare

Returns PreparedStatement

The prepared statement

postgres:postgres.ql
native fun prepareStatement(statementString, paramList) link

Prepare a statement for execution with pre populated parameters.

Params
statementString ( string )

The statement to prepare

paramList ( list )

The list of parameters to prepare

Returns PreparedStatement

The prepared statement

postgres:postgres.ql
native fun query(query) link

Query the database.

Params
query

The query string to execute. Either a string or a PreparedStatement

Returns Result

The result of the query, containing a ResultSet

postgres:postgres.ql
native fun fetchOne(query) link

Fetch one row from the database.

Params
query ( string )

The query string to execute. Either a string or a PreparedStatement

Returns Result

The result of the query, containing a list of the resulting row

postgres:postgres.ql
native fun fetchAll(query) link

Fetch all rows from the database.

Params
query

The query string to execute. Either a string or a PreparedStatement

Returns Result

The result of the query, containing a 2D list of the resulting rows

postgres:postgres.ql
native fun update(query) link

Update entries in the database.

Params
query

The query string to execute. Either a string or a PreparedStatement

Returns Result

How many rows were updated

postgres:postgres.ql
native fun execute(query) link

Executes a query that does not return any data.

Params
query

The query string to execute. Either a string or a PreparedStatement

Returns boolean

true if the query returned any ResultSets, false otherwise

postgres:postgres.ql
native fun beginTransaction() link

Begins a transaction for executing multiple queries.

postgres:postgres.ql
native fun commit() link

Commits a transaction.

postgres:postgres.ql
native fun rollback() link

Rolls back a transaction.

postgres:postgres.ql
native fun disconnect() link

Disconnect from the database.

postgres:postgres.ql