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]

[src]

Cast this mozIStorageStatement to one of its base interfaces.

impl mozIStorageStatement
[src]

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.
   */

VALUE_TYPE_INTEGER: i64 = 1

VALUE_TYPE_FLOAT: i64 = 2

VALUE_TYPE_TEXT: i64 = 3

VALUE_TYPE_BLOB: i64 = 4

[src]

/**
   * 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 ();

[src]

readonly attribute unsigned long parameterCount;

[src]

/**
   * Name of nth parameter, if given
   */

AUTF8String getParameterName (in unsigned long aParamIndex);

[src]

/**
   * 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);

[src]

/**
   * Number of columns returned
   */

readonly attribute unsigned long columnCount;

[src]

/**
   * Name of nth column
   */

AUTF8String getColumnName (in unsigned long aColumnIndex);

[src]

/**
   * 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);

[src]

/**
   * Reset parameters/statement execution
   */

void reset ();

[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 ();

[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 ();

[src]

/**
   * The number of entries in the array (each corresponding to a column in the
   * database row)
   */

readonly attribute unsigned long numEntries;

[src]

/**
   * 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);

[src]

/**
   * 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);

[src]

long long getInt64 (in unsigned long aIndex);

[src]

/** @} */
/**
   * 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);

[src]

/**
   * 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);

[src]

AString getString (in unsigned long aIndex);

[src]

/** @} */
/**
   * 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);

[src]

/**
   * 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);

[src]

/**
   * 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);

[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>

[src]

Cast this mozIStorageBaseStatement to one of its base interfaces.

[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 ();

[src]

/**
   * 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);

[src]

/**
   * 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 ();

[src]

/**
   * 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);

[src]

/**
   * Find out whether the statement is usable (has not been finalized).
   */

readonly attribute long state;

[src]

/**
   * 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]

IID: nsIID = nsID(1599503413, 27698, 16704, [130, 140, 104, 62, 164, 156, 253, 58])

[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]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for mozIStorageStatement
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.