Struct xpcom::interfaces::mozIStorageStatement
[−]
[src]
#[repr(C)]pub struct mozIStorageStatement { /* fields omitted */ }
interface mozIStorageStatement : mozIStorageBaseStatement
/**
* A SQL statement that can be used for both synchronous and asynchronous
* purposes.
*/
Methods
impl mozIStorageStatement
[src]
pub fn coerce<T: mozIStorageStatementCoerce>(&self) -> &T
[src]
Cast this mozIStorageStatement
to one of its base interfaces.
impl mozIStorageStatement
[src]
pub const VALUE_TYPE_NULL: i64
VALUE_TYPE_NULL: i64 = 0
/**
* Execute a query, using any currently-bound parameters. Reset is called
* when no more data is returned. This method is only available to JavaScript
* consumers.
*
* @deprecated As of Mozilla 1.9.2 in favor of executeStep().
*
* @return a boolean indicating whether there are more rows or not.
*
* [deprecated] boolean step();
*/
/**
* Obtains the current list of named parameters, which are settable. This
* property is only available to JavaScript consumers.
*
* readonly attribute mozIStorageStatementParams params;
*/
/**
* Obtains the current row, with access to all the data members by name. This
* property is only available to JavaScript consumers.
*
* readonly attribute mozIStorageStatementRow row;
*/
/**
* These type values are returned by getTypeOfIndex
* to indicate what type of value is present at
* a given column.
*/
pub const VALUE_TYPE_INTEGER: i64
VALUE_TYPE_INTEGER: i64 = 1
pub const VALUE_TYPE_FLOAT: i64
VALUE_TYPE_FLOAT: i64 = 2
pub const VALUE_TYPE_TEXT: i64
VALUE_TYPE_TEXT: i64 = 3
pub const VALUE_TYPE_BLOB: i64
VALUE_TYPE_BLOB: i64 = 4
pub unsafe fn Clone(
&self,
_retval: *mut *const mozIStorageStatement
) -> nsresult
[src]
&self,
_retval: *mut *const mozIStorageStatement
) -> nsresult
/**
* Create a clone of this statement, by initializing a new statement
* with the same connection and same SQL statement as this one. It
* does not preserve statement state; that is, if a statement is
* being executed when it is cloned, the new statement will not be
* executing.
*/
mozIStorageStatement clone ();
pub unsafe fn GetParameterCount(
&self,
aParameterCount: *mut uint32_t
) -> nsresult
[src]
&self,
aParameterCount: *mut uint32_t
) -> nsresult
readonly attribute unsigned long parameterCount;
pub unsafe fn GetParameterName(
&self,
aParamIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aParamIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
/**
* Name of nth parameter, if given
*/
AUTF8String getParameterName (in unsigned long aParamIndex);
pub unsafe fn GetParameterIndex(
&self,
aName: &nsACString,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aName: &nsACString,
_retval: *mut uint32_t
) -> nsresult
/**
* Returns the index of the named parameter.
*
* @param aName
* The name of the parameter you want the index for. This does not
* include the leading ':'.
* @return the index of the named parameter.
*/
unsigned long getParameterIndex (in AUTF8String aName);
pub unsafe fn GetColumnCount(&self, aColumnCount: *mut uint32_t) -> nsresult
[src]
/**
* Number of columns returned
*/
readonly attribute unsigned long columnCount;
pub unsafe fn GetColumnName(
&self,
aColumnIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aColumnIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
/**
* Name of nth column
*/
AUTF8String getColumnName (in unsigned long aColumnIndex);
pub unsafe fn GetColumnIndex(
&self,
aName: &nsACString,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aName: &nsACString,
_retval: *mut uint32_t
) -> nsresult
/**
* Obtains the index of the column with the specified name.
*
* @param aName
* The name of the column.
* @return The index of the column with the specified name.
*/
unsigned long getColumnIndex (in AUTF8String aName);
pub unsafe fn Reset(&self) -> nsresult
[src]
/**
* Reset parameters/statement execution
*/
void reset ();
pub unsafe fn Execute(&self) -> nsresult
[src]
/**
* Execute the query, ignoring any results. This is accomplished by
* calling executeStep() once, and then calling reset().
*
* Error and last insert info, etc. are available from
* the mozStorageConnection.
*/
void execute ();
pub unsafe fn ExecuteStep(&self, _retval: *mut bool) -> nsresult
[src]
/**
* Execute a query, using any currently-bound parameters. Reset
* must be called on the statement after the last call of
* executeStep.
*
* @return a boolean indicating whether there are more rows or not;
* row data may be accessed using mozIStorageValueArray methods on
* the statement.
*/
boolean executeStep ();
pub unsafe fn GetNumEntries(&self, aNumEntries: *mut uint32_t) -> nsresult
[src]
/**
* The number of entries in the array (each corresponding to a column in the
* database row)
*/
readonly attribute unsigned long numEntries;
pub unsafe fn GetTypeOfIndex(
&self,
aIndex: uint32_t,
_retval: *mut int32_t
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: *mut int32_t
) -> nsresult
/**
* Indicate the data type of the current result row for the the given column.
* SQLite will perform type conversion if you ask for a value as a different
* type than it is stored as.
*
* @param aIndex
* 0-based column index.
* @return The type of the value at the given column index; one of
* VALUE_TYPE_NULL, VALUE_TYPE_INTEGER, VALUE_TYPE_FLOAT,
* VALUE_TYPE_TEXT, VALUE_TYPE_BLOB.
*/
long getTypeOfIndex (in unsigned long aIndex);
pub unsafe fn GetInt32(
&self,
aIndex: uint32_t,
_retval: *mut int32_t
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: *mut int32_t
) -> nsresult
/**
* Retrieve the contents of a column from the current result row as an
* integer.
*
* @param aIndex
* 0-based colummn index.
* @return Column value interpreted as an integer per type conversion rules.
* @{
*/
long getInt32 (in unsigned long aIndex);
pub unsafe fn GetInt64(
&self,
aIndex: uint32_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: *mut int64_t
) -> nsresult
long long getInt64 (in unsigned long aIndex);
pub unsafe fn GetDouble(
&self,
aIndex: uint32_t,
_retval: *mut c_double
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: *mut c_double
) -> nsresult
/** @} */
/**
* Retrieve the contents of a column from the current result row as a
* floating point double.
*
* @param aIndex
* 0-based colummn index.
* @return Column value interpreted as a double per type conversion rules.
*/
double getDouble (in unsigned long aIndex);
pub unsafe fn GetUTF8String(
&self,
aIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
/**
* Retrieve the contents of a column from the current result row as a
* string.
*
* @param aIndex
* 0-based colummn index.
* @return The value for the result column interpreted as a string. If the
* stored value was NULL, you will get an empty string with IsVoid set
* to distinguish it from an explicitly set empty string.
* @{
*/
AUTF8String getUTF8String (in unsigned long aIndex);
pub unsafe fn GetString(
&self,
aIndex: uint32_t,
_retval: &mut nsAString
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: &mut nsAString
) -> nsresult
AString getString (in unsigned long aIndex);
pub unsafe fn GetBlob(
&self,
aIndex: uint32_t,
aDataSize: *mut uint32_t,
aData: *mut *mut uint8_t
) -> nsresult
[src]
&self,
aIndex: uint32_t,
aDataSize: *mut uint32_t,
aData: *mut *mut uint8_t
) -> nsresult
/** @} */
/**
* Retrieve the contents of a column from the current result row as a
* blob.
*
* @param aIndex
* 0-based colummn index.
* @param[out] aDataSize
* The number of bytes in the blob.
* @param[out] aData
* The contents of the BLOB. This will be NULL if aDataSize == 0.
*/
void getBlob (in unsigned long aIndex, out unsigned long aDataSize, [array, size_is (aDataSize)] out octet aData);
pub unsafe fn GetBlobAsString(
&self,
aIndex: uint32_t,
_retval: &mut nsAString
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: &mut nsAString
) -> nsresult
/**
* Retrieve the contents of a Blob column from the current result row as a
* string.
*
* @param aIndex
* 0-based colummn index.
* @return The value for the result Blob column interpreted as a String.
* No encoding conversion is performed.
*/
AString getBlobAsString (in unsigned long aIndex);
pub unsafe fn GetBlobAsUTF8String(
&self,
aIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aIndex: uint32_t,
_retval: &mut nsACString
) -> nsresult
/**
* Retrieve the contents of a Blob column from the current result row as a
* UTF8 string.
*
* @param aIndex
* 0-based colummn index.
* @return The value for the result Blob column interpreted as a UTF8 String.
* No encoding conversion is performed.
*/
AUTF8String getBlobAsUTF8String (in unsigned long aIndex);
pub unsafe fn GetIsNull(&self, aIndex: uint32_t, _retval: *mut bool) -> nsresult
[src]
/**
* Check whether the given column in the current result row is NULL.
*
* @param aIndex
* 0-based colummn index.
* @return true if the value for the result column is null.
*/
boolean getIsNull (in unsigned long aIndex);
[src]
/**
* Returns a shared string pointer
*/
[noscript] void getSharedUTF8String (in unsigned long aIndex, out unsigned long aLength, [shared, retval] out string aResult);
[src]
[noscript] void getSharedString (in unsigned long aIndex, out unsigned long aLength, [shared, retval] out wstring aResult);
Methods from Deref<Target = mozIStorageBaseStatement>
pub fn coerce<T: mozIStorageBaseStatementCoerce>(&self) -> &T
[src]
Cast this mozIStorageBaseStatement
to one of its base interfaces.
pub const MOZ_STORAGE_STATEMENT_INVALID: i64
pub const MOZ_STORAGE_STATEMENT_READY: i64
pub const MOZ_STORAGE_STATEMENT_EXECUTING: i64
pub unsafe fn Finalize(&self) -> nsresult
[src]
/**
* Finalizes a statement so you can successfully close a database connection.
* Once a statement has been finalized it can no longer be used for any
* purpose.
*
* Statements are implicitly finalized when their reference counts hits zero.
* If you are a native (C++) caller this is accomplished by setting all of
* your nsCOMPtr instances to be NULL. If you are operating from JavaScript
* code then you cannot rely on this behavior because of the involvement of
* garbage collection.
*
* When finalizing an asynchronous statement you do not need to worry about
* whether the statement has actually been executed by the asynchronous
* thread; you just need to call finalize after your last call to executeAsync
* involving the statement. However, you do need to use asyncClose instead of
* close on the connection if any statements have been used asynchronously.
*/
void finalize ();
pub unsafe fn BindParameters(
&self,
aParameters: *const mozIStorageBindingParamsArray
) -> nsresult
[src]
&self,
aParameters: *const mozIStorageBindingParamsArray
) -> nsresult
/**
* Binds the array of parameters to the statement. When executeAsync is
* called, all the parameters in aParameters are bound and then executed.
*
* @param aParameters
* The array of parameters to bind to the statement upon execution.
*
* @note This is only works on statements being used asynchronously.
*/
void bindParameters (in mozIStorageBindingParamsArray aParameters);
pub unsafe fn NewBindingParamsArray(
&self,
_retval: *mut *const mozIStorageBindingParamsArray
) -> nsresult
[src]
&self,
_retval: *mut *const mozIStorageBindingParamsArray
) -> nsresult
/**
* Creates a new mozIStorageBindingParamsArray that can be used to bind
* multiple sets of data to a statement with bindParameters.
*
* @return a mozIStorageBindingParamsArray that multiple sets of parameters
* can be bound to.
*
* @note This is only useful for statements being used asynchronously.
*/
mozIStorageBindingParamsArray newBindingParamsArray ();
pub unsafe fn ExecuteAsync(
&self,
aCallback: *const mozIStorageStatementCallback,
_retval: *mut *const mozIStoragePendingStatement
) -> nsresult
[src]
&self,
aCallback: *const mozIStorageStatementCallback,
_retval: *mut *const mozIStoragePendingStatement
) -> nsresult
/**
* Execute a query asynchronously using any currently bound parameters. This
* statement can be reused immediately, and reset does not need to be called.
*
* @note If you have any custom defined functions, they must be re-entrant
* since they can be called on multiple threads.
*
* @param aCallback [optional]
* The callback object that will be notified of progress, errors, and
* completion.
* @return an object that can be used to cancel the statements execution.
*/
mozIStoragePendingStatement executeAsync ([optional] in mozIStorageStatementCallback aCallback);
pub unsafe fn GetState(&self, aState: *mut int32_t) -> nsresult
[src]
/**
* Find out whether the statement is usable (has not been finalized).
*/
readonly attribute long state;
pub unsafe fn EscapeStringForLIKE(
&self,
aValue: &nsAString,
aEscapeChar: int16_t,
_retval: &mut nsAString
) -> nsresult
[src]
&self,
aValue: &nsAString,
aEscapeChar: int16_t,
_retval: &mut nsAString
) -> nsresult
/**
* Escape a string for SQL LIKE search.
*
* @note Consumers will have to use same escape char when doing statements
* such as: ...LIKE '?1' ESCAPE '/'...
*
* @param aValue
* The string to escape for SQL LIKE.
* @param aEscapeChar
* The escape character.
* @return an AString of an escaped version of aValue
* (%, _ and the escape char are escaped with the escape char)
* For example, we will convert "foo/bar_baz%20cheese"
* into "foo//bar/_baz/%20cheese" (if the escape char is '/').
*/
AString escapeStringForLIKE (in AString aValue, in wchar aEscapeChar);
Trait Implementations
impl XpCom for mozIStorageStatement
[src]
const IID: nsIID
IID: nsIID = nsID(1599503413, 27698, 16704, [130, 140, 104, 62, 164, 156, 253, 58])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for mozIStorageStatement
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for mozIStorageStatement
[src]
type Target = mozIStorageBaseStatement
The resulting type after dereferencing.
fn deref(&self) -> &mozIStorageBaseStatement
[src]
Dereferences the value.