Statement

public class
loom.sqlite.Statement

Description

A compiled SQL statement. Parameters can be manipulated and result columns retrieved. step() advances the query to the next row of results. Synchronous and asynchronous query execution are supported.

API overview

Constructor

Statement ()

Attributes

Public attributes

onStatementComplete: StatementComplete native

Called when stepAsync() completes the query processing

onStatementProgress: StatementProgress native

Called at intervals during the stepAsync() query processing

statementProgressVMIWait: Number static native

Number of Virtual Machine Instructions to wait for between between each call to onStatementProgress

Functions

Public functions

bindBytes ( index: Number , value: ByteArray ): ResultCode native

Sets a ByteArray query parameter for the given index

bindDouble ( index: Number , value: Number ): ResultCode native

Sets a floating point query parameter for the given index

bindInt ( index: Number , value: Number ): ResultCode native

Sets an integeter query parameter for the given index

bindString ( index: Number , value: String ): ResultCode native

Sets a string query parameter for the given index

columnBytes ( index: Number ): ByteArray native

Retrieves a byte array from the specified column in the current row of the query

columnDouble ( index: Number ): Number native

Retrieves a floating point value from the specified column in the current row of the query

columnInt ( index: Number ): Number native

Retrieves an integer value from the specified column in the current row of the query

columnName ( index: Number ): String native

Retrieves the name of the specified column in the current row of the query

columnString ( index: Number ): String native

Retrieves a string from the specified column in the current row of the query

columnType ( index: Number ): DataType native

Retrieves the type of data that specified column is used to storein the current row of the query

finalize (): ResultCode native

Deletes and cleans up this statement

getParameterCount (): Number native

Returns the number of parameters in the current query

getParameterIndex ( name: String ): Number native

Returns the index of the specified parameter in the current query

getParameterName ( index: Number ): String native

Returns the name of the specified parameter in the current query

reset (): ResultCode native

Resets this statement back to its initial state so that it can be re-executed

step (): ResultCode native

Blocking function that advances the statement to the next result in the query

stepAsync (): Boolean native

Asynchronous function that advances the statement to the next result in the query

Constructor

Statement ()

Attributes

onStatementComplete: StatementComplete

native

Called when stepAsync() completes the query processing.

onStatementProgress: StatementProgress

native

Called at intervals during the stepAsync() query processing.

statementProgressVMIWait: Number

static native

Number of Virtual Machine Instructions to wait for between between each call to onStatementProgress. Setting this to < 1 will disable the progress handler. The default value is 1.

Functions

bindBytes ( index: Number , value: ByteArray ): ResultCode

native

Sets a ByteArray query parameter for the given index.

The left-most (first) paramater is index 1.

Parameters

index: Number Index of the parameter to bind the value to.
value: ByteArray ByteArray value to set

Returns

ResultCode ResultCode Result of the bind.

bindDouble ( index: Number , value: Number ): ResultCode

native

Sets a floating point query parameter for the given index.

The left-most (first) paramater is index 1.

Parameters

index: Number Index of the parameter to bind the value to.
value: Number Floating point value to set

Returns

ResultCode ResultCode Result of the bind.

bindInt ( index: Number , value: Number ): ResultCode

native

Sets an integeter query parameter for the given index.

The left-most (first) paramater is index 1.

Parameters

index: Number Index of the parameter to bind the value to.
value: Number Integer value to set

Returns

ResultCode ResultCode Result of the bind.

bindString ( index: Number , value: String ): ResultCode

native

Sets a string query parameter for the given index.

The left-most (first) paramater is index 1.

Parameters

index: Number Index of the parameter to bind the value to.
value: String String value to set

Returns

ResultCode ResultCode Result of the bind.

columnBytes ( index: Number ): ByteArray

native

Retrieves a byte array from the specified column in the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the data from.

Returns

ByteArray ByteArray Byte array stored in this column.

columnDouble ( index: Number ): Number

native

Retrieves a floating point value from the specified column in the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the data from.

Returns

Number float Floating point value stored in this column.

columnInt ( index: Number ): Number

native

Retrieves an integer value from the specified column in the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the data from.

Returns

Number int Integer value stored in this column.

columnName ( index: Number ): String

native

Retrieves the name of the specified column in the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the name from.

Returns

String String Name of the column.

columnString ( index: Number ): String

native

Retrieves a string from the specified column in the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the data from.

Returns

String String String stored in this column.

columnType ( index: Number ): DataType

native

Retrieves the type of data that specified column is used to storein the current row of the query.

The left-most (first) paramater is index 0.

Parameters

index: Number Index of the column to retrieve the type from.

Returns

DataType DataType Enumation value defining the type of data for the column.

finalize (): ResultCode

native

Deletes and cleans up this statement.


Returns

ResultCode ResultCode Result of the function call.

getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getParameterCount (): Number

native

Returns the number of parameters in the current query.


Returns

Number int Parameter count.

getParameterIndex ( name: String ): Number

native

Returns the index of the specified parameter in the current query.

Parameters

name: String Name of the parameter to search for.

Returns

Number int Parameter index.

getParameterName ( index: Number ): String

native

Returns the name of the specified parameter in the current query.

The left-most (first) paramater is index 1.

Parameters

index: Number Index of the parameter to search for.

Returns

String String Parameter name.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

reset (): ResultCode

native

Resets this statement back to its initial state so that it can be re-executed.


Returns

ResultCode ResultCode Result of the function call.

step (): ResultCode

native

Blocking function that advances the statement to the next result in the query.

ResultCode.SQLITE_ROW indicates that there is valid data. ResultCode.SQLITE_DONE indicates that the end of the statement has been reached. ResultCode.SQLITE_MISUSE indicates invalid data in the query.


Returns

ResultCode ResultCode Result of the step. Common values of this are:

stepAsync (): Boolean

native

Asynchronous function that advances the statement to the next result in the query.


Returns

Boolean Boolean Whether or not the step process was successfully kicked off.

toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: