sbISQLBuilder.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 
32 #include "nsISupports.idl"
33 
34 interface sbISQLBuilderCriterion;
35 interface sbISQLBuilderCriterionIn;
36 interface sbISQLSelectBuilder;
37 
46 [scriptable, uuid(c214b05b-0aa8-4bf9-aa0f-a1b1ff646539)]
48 {
49  const unsigned long MATCH_EQUALS = 0;
50  const unsigned long MATCH_NOTEQUALS = 1;
51  const unsigned long MATCH_GREATER = 2;
52  const unsigned long MATCH_GREATEREQUAL = 3;
53  const unsigned long MATCH_LESS = 4;
54  const unsigned long MATCH_LESSEQUAL = 5;
55  const unsigned long MATCH_LIKE = 6;
56  const unsigned long MATCH_NOTLIKE = 7;
57  const unsigned long MATCH_MATCH = 8;
58 
62  attribute long limit;
63 
67  attribute boolean limitIsParameter;
68 
72  attribute long offset;
73 
77  attribute boolean offsetIsParameter;
78 
79  const unsigned long JOIN_INNER = 0;
80  const unsigned long JOIN_LEFT = 1;
81  const unsigned long JOIN_LEFT_OUTER = 2;
82 
94  void addJoin(in unsigned long aJoinType,
95  in AString aJoinedTableName,
96  in AString aJoinedTableAlias,
97  in AString aJoinedColumnName,
98  in AString aJoinToTableName,
99  in AString aJoinToColumnName);
100 
119  void addJoinWithIndexHint(in unsigned long aJoinType,
120  in AString aJoinedTableName,
121  in AString aJoinedTableAlias,
122  in AString aJoinedColumnName,
123  in AString aJoinToTableName,
124  in AString aJoinToColumnName,
125  in boolean aRequiresFromTableIndexHint,
126  in boolean aRequiresToTableIndexHint);
127 
139  void addSubqueryJoin(in unsigned long aJoinType,
140  in sbISQLSelectBuilder aJoinedSubquery,
141  in AString aJoinedTableAlias,
142  in AString aJoinedColumnName,
143  in AString aJoinToTableName,
144  in AString aJoinToColumnName);
145 
154  void addJoinWithCriterion(in unsigned long aJoinType,
155  in AString aJoinedTableName,
156  in AString aJoinedTableAlias,
157  in sbISQLBuilderCriterion aCriterion);
158 
164  void addSubquery(in sbISQLSelectBuilder aSubquery,
165  in AString aAlias);
166 
170  void reset();
171 
176  AString toString();
177 };
178 
183 [scriptable, uuid(ec1c4745-a744-4335-af6f-5caafacb4249)]
185 {
190  void addCriterion(in sbISQLBuilderCriterion aCriterion);
191 
196  void removeCriterion(in sbISQLBuilderCriterion aCriterion);
197 
207  in AString aSrcColumnName,
208  in unsigned long aMatchType,
209  in AString aValue);
210 
212  in AString aSrcColumnName,
213  in AString aLeftValue,
214  in AString aRightValue);
215 
217  in AString aSrcColumnName,
218  in AString aLeftValue,
219  in AString aRightValue);
220 
229  sbISQLBuilderCriterion createMatchCriterionLong(in AString aTableName,
230  in AString aSrcColumnName,
231  in unsigned long aMatchType,
232  in long aValue);
233 
243  in AString aSrcColumnName,
244  in unsigned long aMatchType,
245  in long long aValue);
246 
254  sbISQLBuilderCriterion createMatchCriterionNull(in AString aTableName,
255  in AString aSrcColumnName,
256  in unsigned long aMatchType);
257 
266  sbISQLBuilderCriterion createMatchCriterionTable(in AString aLeftTableName,
267  in AString aLeftColumnName,
268  in unsigned long aMatchType,
269  in AString aRightTableName,
270  in AString aRightColumnName);
271 
277  sbISQLBuilderCriterionIn createMatchCriterionIn(in AString aTableName,
278  in AString aSrcColumnName);
279 
287  in AString aSrcColumnName,
288  in unsigned long aMatchType);
295  in sbISQLBuilderCriterion aRight);
296 
303  in sbISQLBuilderCriterion aRight);
304 
305 
306 };
307 
312 [scriptable, uuid(b91ae93b-9c1e-427c-a751-5c0c19fcdbc3)]
314 {
318  attribute AString baseTableName;
319 
323  attribute AString baseTableAlias;
324 
328  attribute boolean distinct;
329 
336  void addColumn(in AString aTableName,
337  in AString aColumnName);
338 
342  void clearColumns();
343 
350  void addOrder(in AString aTableName,
351  in AString aColumnName,
352  in boolean aAscending);
353 
358  void addRandomOrder();
359 
365  void addGroupBy(in AString aTableName,
366  in AString aColumnName);
367 
368 };
369 
374 [scriptable, uuid(8c584d54-2fa1-4965-8345-f1eda5a1e304)]
376 {
381  void addColumn(in AString aColumnName);
382 
387  void addValueString(in AString aValue);
388 
393  void addValueLong(in long aValue);
394 
398  void addValueNull();
399 
403  void addValueParameter();
404 
410  void addValueRaw(in AString aValue);
411 
415  attribute AString intoTableName;
416 
422 };
423 
428 [scriptable, uuid(68991dbd-83f0-4df9-b3f6-89d0982ed491)]
430 {
434  attribute AString tableName;
435 
441  void addAssignmentString(in AString aColumnName,
442  in AString aValue);
443 
448  void addAssignmentParameter(in AString aColumnName);
449 };
450 
455 [scriptable, uuid(73a18b36-2eee-429e-9cda-1f4428c3afb5)]
457 {
461  attribute AString tableName;
462 };
463 
469 [scriptable, uuid(442c1d9d-4e8e-4aa1-9124-2f700b625a45)]
471 {
472  [noscript] AString toString();
473 };
474 
479 [scriptable, uuid(51992f09-7b9a-4a91-b708-b4551c25acf9)]
481 {
486  void addString(in AString aValue);
487 
492  void addLong(in long aValue);
493 
498  void addSubquery(in sbISQLSelectBuilder aSubquery);
499 
503  void clear();
504 };
505 
void addString(in AString aValue)
Adds a string value to the list of IN criteria.
void addJoin(in unsigned long aJoinType, in AString aJoinedTableName, in AString aJoinedTableAlias, in AString aJoinedColumnName, in AString aJoinToTableName, in AString aJoinToColumnName)
Add a join to the query.
attribute boolean distinct
Is the query distinct?
sbISQLBuilderCriterion createMatchCriterionString(in AString aTableName, in AString aSrcColumnName, in unsigned long aMatchType, in AString aValue)
Create a match criterion with an AString datatype.
const unsigned long MATCH_NOTLIKE
onPageChanged aValue
Definition: FeedWriter.js:1395
attribute boolean limitIsParameter
Is the limit clause a parameter?
void reset()
Clears out query configuration to this instance can be reused.
void addRandomOrder()
Add a random order clause to the query.
void clearColumns()
Clears added columns.
void addSubquery(in sbISQLSelectBuilder aSubquery)
Adds a subquery to the IN list.
sbISQLBuilderCriterion createMatchCriterionParameter(in AString aTableName, in AString aSrcColumnName, in unsigned long aMatchType)
Create a match criterion that tests against a parameter placeholder.
void addGroupBy(in AString aTableName, in AString aColumnName)
Add an group by clause to the query.
void addColumn(in AString aTableName, in AString aColumnName)
Add a column to the output column list.
sbISQLBuilderCriterion createMatchCriterionNotBetweenString(in AString aTableName, in AString aSrcColumnName, in AString aLeftValue, in AString aRightValue)
void addLong(in long aValue)
Adds a long value to the list of IN criteria.
attribute AString baseTableAlias
The query's base table's alias.
const unsigned long MATCH_LESSEQUAL
var uuid
void addValueLong(in long aValue)
Add a long value to the value list.
Interface for building WHERE expressions.
restoreDimensions aLeft
void addSubqueryJoin(in unsigned long aJoinType, in sbISQLSelectBuilder aJoinedSubquery, in AString aJoinedTableAlias, in AString aJoinedColumnName, in AString aJoinToTableName, in AString aJoinToColumnName)
Add a subquery join join to the query.
Interface for "in" SQL critera.
attribute AString tableName
Table to update.
Interface for building SELECT statements.
void addSubquery(in sbISQLSelectBuilder aSubquery, in AString aAlias)
Add a subquery to the from clause.
sbISQLBuilderCriterion createMatchCriterionBetweenString(in AString aTableName, in AString aSrcColumnName, in AString aLeftValue, in AString aRightValue)
Base interface for SQL building components.
attribute long offset
Value for the offset clause.
sbISQLBuilderCriterion createAndCriterion(in sbISQLBuilderCriterion aLeft, in sbISQLBuilderCriterion aRight)
Create a match criterion that is the logical AND of two critera.
sbISQLBuilderCriterion createMatchCriterionLongLong(in AString aTableName, in AString aSrcColumnName, in unsigned long aMatchType, in long long aValue)
Create a match criterion with a long long (64 bit) datatype.
const unsigned long JOIN_LEFT_OUTER
attribute long limit
Value for the limit clause.
void addAssignmentString(in AString aColumnName, in AString aValue)
Add a string assignment to the set clause.
const unsigned long MATCH_LESS
AString toString()
Return the generated SQL statement for the query.
const unsigned long MATCH_MATCH
const unsigned long JOIN_INNER
const unsigned long MATCH_LIKE
sbISQLBuilderCriterion createMatchCriterionLong(in AString aTableName, in AString aSrcColumnName, in unsigned long aMatchType, in long aValue)
Create a match criterion with a long (32 bit) datatype.
void addValueParameter()
Add a parameter to the value list.
void addColumn(in AString aColumnName)
Add a column to the insert list.
attribute boolean offsetIsParameter
Is the offset clause a parameter?
const unsigned long JOIN_LEFT
const unsigned long MATCH_GREATEREQUAL
Interface for SQL critera. This interface has no public methods as it is used only as a return type f...
attribute sbISQLSelectBuilder select
Select statement to use as the source of data for the insert. This can be used in place of the value ...
void addAssignmentParameter(in AString aColumnName)
Add a parameter assignment to the set clause.
const unsigned long MATCH_NOTEQUALS
sbISQLBuilderCriterion createMatchCriterionTable(in AString aLeftTableName, in AString aLeftColumnName, in unsigned long aMatchType, in AString aRightTableName, in AString aRightColumnName)
Create a match criterion that tests against a table column.
void addValueNull()
Add a null to the value list.
void addValueRaw(in AString aValue)
Add a raw string the value list. Note that this does not do any escaping of the value so please only ...
attribute AString tableName
Table to delete from.
void removeCriterion(in sbISQLBuilderCriterion aCriterion)
Remve a criteria constraint from the query.
Interface for building UPDATE statements.
void clear()
Clear In critera list.
attribute AString baseTableName
The query's base table.
sbISQLBuilderCriterion createMatchCriterionNull(in AString aTableName, in AString aSrcColumnName, in unsigned long aMatchType)
Create a match criterion that tests against the null value.
attribute AString intoTableName
Table to insert into.
const unsigned long MATCH_GREATER
void addValueString(in AString aValue)
Add a string value to the value list.
void addOrder(in AString aTableName, in AString aColumnName, in boolean aAscending)
Add an order clause to the query.
void addJoinWithCriterion(in unsigned long aJoinType, in AString aJoinedTableName, in AString aJoinedTableAlias, in sbISQLBuilderCriterion aCriterion)
Add a join to the query with a critera object specifcying the join constraints.
void addJoinWithIndexHint(in unsigned long aJoinType, in AString aJoinedTableName, in AString aJoinedTableAlias, in AString aJoinedColumnName, in AString aJoinToTableName, in AString aJoinToColumnName, in boolean aRequiresFromTableIndexHint, in boolean aRequiresToTableIndexHint)
Add a join to the query.
sbISQLBuilderCriterion createOrCriterion(in sbISQLBuilderCriterion aLeft, in sbISQLBuilderCriterion aRight)
Create a match criterion that is the logical OR of two critera.
Interface for building INSERT statements.
Interface for building DELETE statements.
const unsigned long MATCH_EQUALS
sbISQLBuilderCriterionIn createMatchCriterionIn(in AString aTableName, in AString aSrcColumnName)
Create a match criterion using the IN() operator.
void addCriterion(in sbISQLBuilderCriterion aCriterion)
Add a criteria constraint to the query.