sbIDatabaseQuery.idl
Go to the documentation of this file.
1 /*
2  //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
33 #include "nsISupports.idl"
34 
35 interface nsIURI;
36 interface sbIDatabaseResult;
38 
53 [scriptable, uuid(918745AE-0F40-4d08-BA4E-27A739459952)]
55 {
66  void onQueryEnd(in sbIDatabaseResult dbResultObject, in AString dbGUID, in AString strQuery);
67 };
68 
69 
83 [scriptable, uuid(A901158A-3735-44fd-9AD2-1753F1407284)]
85 {
96  void onQueryError(in long dbError, in AString dbGUID, in AString strQuery);
97 
107  void onQueryStart(in AString dbGUID, in AString strQuery);
108 
119  void onQueryRow(in sbIDatabaseResult dbResultObject, in unsigned long dbRowResult, in unsigned long dbRowTotal);
120 
131  void onQueryEnd(in sbIDatabaseResult dbResultObject, in AString dbGUID, in AString strQuery);
132 };
133 
168 [scriptable, uuid(192FE564-1D86-49c8-A31A-5798D62B2525)]
170 {
181  attribute nsIURI databaseLocation;
182 
190  void setAsyncQuery(in PRBool bAsyncQuery);
191 
198  PRBool isAyncQuery();
199 
206 
213 
227  void setDatabaseGUID(in AString dbGUID);
228 
234  AString getDatabaseGUID();
235 
245  void addQuery(in AString strQuery);
246 
259  sbIDatabasePreparedStatement prepareQuery(in AString strQuery);
260 
268  void addPreparedStatement(in sbIDatabasePreparedStatement PreparedStatement);
269 
275  unsigned long getQueryCount();
276 
283  sbIDatabasePreparedStatement getQuery(in unsigned long nIndex);
284 
294  void resetQuery();
295 
306 
314  long getLastError();
315 
323  void setLastError(in long dbError);
324 
332  long execute();
333 
341  long waitForCompletion();
342 
348  boolean isExecuting();
349 
355  unsigned long currentQuery();
356 
364  boolean abort();
365 
377  attribute unsigned long long rollingLimit;
378 
382  attribute unsigned long rollingLimitColumnIndex;
383 
388  attribute unsigned long rollingLimitResult;
389 
395  void bindUTF8StringParameter(in unsigned long aParamIndex,
396  in AUTF8String aValue);
397 
403  void bindStringParameter(in unsigned long aParamIndex,
404  in AString aValue);
405 
411  void bindDoubleParameter(in unsigned long aParamIndex,
412  in double aValue);
413 
419  void bindInt32Parameter(in unsigned long aParamIndex,
420  in long aValue);
421 
427  void bindInt64Parameter(in unsigned long aParamIndex,
428  in long long aValue);
429 
434  void bindNullParameter(in unsigned long aParamIndex);
435 };
void bindInt64Parameter(in unsigned long aParamIndex, in long long aValue)
Binds an int64 to the last added query.
void bindInt32Parameter(in unsigned long aParamIndex, in long aValue)
Binds an int32 to the last added query.
void bindDoubleParameter(in unsigned long aParamIndex, in double aValue)
Binds a double to the last added query.
void removeSimpleQueryCallback(in sbIDatabaseSimpleQueryCallback dbPersistCB)
Remove a sbIDatabaseSimpleQueryCallback instance from the query.
attribute nsIURI databaseLocation
Set a specific folder/directory URI for the database.
PRBool isAyncQuery()
Return whether or not the query will run asynchronously.
onPageChanged aValue
Definition: FeedWriter.js:1395
attribute unsigned long rollingLimitColumnIndex
The index of the column used to add to the limit total.
long execute()
Execute the queries enqueued in the object.
sbIDatabaseResult getResultObject()
Get the results object for the query that has executed.
void addPreparedStatement(in sbIDatabasePreparedStatement PreparedStatement)
Add a prepared query to the queue.
AString getDatabaseGUID()
Get the database identifier string.
var uuid
void addQuery(in AString strQuery)
Add a SQL query string to the queue.
void bindUTF8StringParameter(in unsigned long aParamIndex, in AUTF8String aValue)
Binds a UTF8String to the last added query.
void onQueryEnd(in sbIDatabaseResult dbResultObject, in AString dbGUID, in AString strQuery)
Called when the query has completed.
sbIDatabasePreparedStatement getQuery(in unsigned long nIndex)
Get the query at the Nth index.
long waitForCompletion()
Wait until the query has finished executing asynchronously.
void setLastError(in long dbError)
Set the last error on the query.
void onQueryStart(in AString dbGUID, in AString strQuery)
Called for each query that executes.
A callback object used to inform client code that a query has completed.
void onQueryError(in long dbError, in AString dbGUID, in AString strQuery)
Called if the query has an error.
attribute unsigned long rollingLimitResult
The number of the row (1 is the first row) that met or exceeded the limit.
void addSimpleQueryCallback(in sbIDatabaseSimpleQueryCallback dbPersistCB)
Add a sbIDatabaseSimpleQueryCallback instance to the query.
An object containing the results of a database SELECT query.
void onQueryEnd(in sbIDatabaseResult dbResultObject, in AString dbGUID, in AString strQuery)
Called when the query has completed.
void bindStringParameter(in unsigned long aParamIndex, in AString aValue)
Binds a String to the last added query.
An object responsible for executing SQL queries on the database.
unsigned long getQueryCount()
Return the number of query strings enqueued for execution.
void setAsyncQuery(in PRBool bAsyncQuery)
Set the query to run asynchronously (ie: execute() does not block)
boolean abort()
Abort a currently executing query.
long getLastError()
Get the last error on the query that has executed.
unsigned long currentQuery()
Return the current index in the queue being indexed.
attribute unsigned long long rollingLimit
Set the rolling limit for this query.
void bindNullParameter(in unsigned long aParamIndex)
Binds a null to the last added query.
void resetQuery()
Clear out the query and make it all sparkly new.
A more complex callback object that can be used to read each row of the results in turn...
boolean isExecuting()
Return whether or not the query is currently executing.
sbIDatabasePreparedStatement prepareQuery(in AString strQuery)
Create a prepared statement object to reduce overhead for repeated queries.
void setDatabaseGUID(in AString dbGUID)
Set the database to be queried.
A prepared database statement.
void onQueryRow(in sbIDatabaseResult dbResultObject, in unsigned long dbRowResult, in unsigned long dbRowTotal)
Called as each row is added to the result set.