mozIStorageStatementWrapper

  • Revision slug: mozIStorageStatementWrapper
  • Revision title: mozIStorageStatementWrapper
  • Revision id: 136683
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

{{ Fx_minversion_header("2") }} The mozIStorageStatementWrapper interface is a storage statement wrapper. When you call the {{ Interface("mozIStorageConnection") }} interface's createStatement() method, you get a {{ Interface("mozIStorageStatement") }} which has just direct bindings to SQLITE. You can then wrap that statement with a wrapper, which implements {{ Interface("nsIXPCScriptable") }} and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.

{{ fx_minversion_note("3") }}

{{ InterfaceStatus("mozIStorageStatementWrapper", "storage/public/mozIStorageStatementWrapper.idl", "unfrozen", "Mozilla 1.8", "yes") }}

Inherits from: nsISupports

Method overview

void initialize(in mozIStorageStatement aStatement);
void reset();
boolean step();
void execute();

Attributes

Attribute Type Description
statement mozIStorageStatement The statement that is wrapped.
row mozIStorageStatementRow The current row. Throws an exception if no row is currently available. Useful only from script. The value of this is only valid while the statement is still executing, and is still on the appropriate row.
params mozIStorageStatementParams The parameters; these can be set in lieu of using the call notation on this.

Methods

initialize()

This method initializes this wrapper with aStatement.

 void initialize(
   in mozIStorageStatement aStatement
 );
Parameters
aStatement
The statement to be initialized.

reset()

This method resets the wrapped statement.

 void reset();
Parameters

None.

step()

This method steps the wrapped statement.

 boolean step();
Parameters

None.

Return value

Returns true if the stepping the wrapped statement was successful, otherwise returns false.

execute()

This method executes the wrapped statement.

 void execute();
Parameters

None.

See also

Revision Source

<p>{{ Fx_minversion_header("2") }} The <code>mozIStorageStatementWrapper</code> interface is a storage statement wrapper. When you call the {{ Interface("mozIStorageConnection") }} interface's <code><a href="/en/mozIStorageConnection#createStatement" title="en/mozIStorageConnection#createStatement">createStatement()</a></code> method, you get a {{ Interface("mozIStorageStatement") }} which has just direct bindings to SQLITE. You can then wrap that statement with a wrapper, which implements {{ Interface("nsIXPCScriptable") }} and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.</p>
<p>{{ fx_minversion_note("3") }}</p>
<p>{{ InterfaceStatus("mozIStorageStatementWrapper", "storage/public/mozIStorageStatementWrapper.idl", "unfrozen", "Mozilla 1.8", "yes") }}</p>
<p>Inherits from: <a href="/en/nsISupports" title="en/nsISupports">nsISupports</a></p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#initialize.28.29">initialize</a>(in <a href="/en/mozIStorageStatement" title="en/mozIStorageStatement">mozIStorageStatement</a> aStatement);</code></td> </tr> <tr> <td><code>void <a href="#reset.28.29">reset</a>();</code></td> </tr> <tr> <td><code>boolean <a href="#step.28.29">step</a>();</code></td> </tr> <tr> <td><code>void <a href="#execute.28.29">execute</a>();</code></td> </tr> </tbody>
</table>
<h2 name="Attributes">Attributes</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Attribute</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>statement</code></td> <td><code><a href="/en/mozIStorageStatement" title="en/mozIStorageStatement">mozIStorageStatement</a></code></td> <td>The statement that is wrapped.</td> </tr> <tr> <td><code>row</code></td> <td><code><a href="/en/mozIStorageStatementRow" title="en/mozIStorageStatementRow">mozIStorageStatementRow</a></code></td> <td>The current row. Throws an exception if no row is currently available. Useful only from script. The value of this is only valid while the statement is still executing, and is still on the appropriate row.</td> </tr> <tr> <td><code>params</code></td> <td><code><a href="/en/mozIStorageStatementParams" title="en/mozIStorageStatementParams">mozIStorageStatementParams</a></code></td> <td>The parameters; these can be set in lieu of using the call notation on this.</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="initialize.28.29">initialize()</h3>
<p>This method initializes this wrapper with <code>aStatement</code>.</p>
<pre class="eval"> void initialize(
   in mozIStorageStatement aStatement
 );
</pre>
<h6 name="Parameters">Parameters</h6>
<dl><dt><code>aStatement</code> </dt><dd>The statement to be initialized. </dd></dl>
<h3 name="reset.28.29">reset()</h3>
<p>This method resets the wrapped statement.</p>
<pre class="eval"> void reset();
</pre>
<h6 name="Parameters_2">Parameters</h6>
<p>None.</p>
<h3 name="step.28.29">step()</h3>
<p>This method steps the wrapped statement.</p>
<pre class="eval"> boolean step();
</pre>
<h6 name="Parameters_3">Parameters</h6>
<p>None.</p>
<h6 name="Return_value">Return value</h6>
<p>Returns <code>true</code> if the stepping the wrapped statement was successful, otherwise returns <code>false</code>.</p>
<h3 name="execute.28.29">execute()</h3>
<p>This method executes the wrapped statement.</p>
<pre class="eval"> void execute();
</pre>
<h6 name="Parameters_4">Parameters</h6>
<p>None.</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/Storage" title="en/Storage">Storage</a></li> <li><a href="/en/mozIStorageStatement" title="en/mozIStorageStatement">mozIStorageStatement</a></li> <li><a href="/en/mozIStorageStatementRow" title="en/mozIStorageStatementRow">mozIStorageStatementRow</a></li> <li><a href="/en/mozIStorageStatementParams" title="en/mozIStorageStatementParams">mozIStorageStatementParams</a></li>
</ul>
Revert to this revision