27 #ifndef __SBSQLBUILDER_H__
28 #define __SBSQLBUILDER_H__
30 #include <sbISQLBuilder.h>
32 #include <nsStringGlue.h>
34 #include <nsCOMArray.h>
37 #define QUOTE_CHAR '\''
39 #define NS_FORWARD_SBISQLBUILDER_WITHOUT_TOSTRING_RESET(_to) \
40 NS_IMETHOD GetLimit(PRInt32 *aLimit) { return _to GetLimit(aLimit); } \
41 NS_IMETHOD SetLimit(PRInt32 aLimit) { return _to SetLimit(aLimit); } \
42 NS_IMETHOD GetLimitIsParameter(PRBool *aLimitIsParameter) { return _to GetLimitIsParameter(aLimitIsParameter); } \
43 NS_IMETHOD SetLimitIsParameter(PRBool aLimitIsParameter) { return _to SetLimitIsParameter(aLimitIsParameter); } \
44 NS_IMETHOD GetOffset(PRInt32 *aOffset) { return _to GetOffset(aOffset); } \
45 NS_IMETHOD SetOffset(PRInt32 aOffset) { return _to SetOffset(aOffset); } \
46 NS_IMETHOD GetOffsetIsParameter(PRBool *aOffsetIsParameter) { return _to GetOffsetIsParameter(aOffsetIsParameter); } \
47 NS_IMETHOD SetOffsetIsParameter(PRBool aOffsetIsParameter) { return _to SetOffsetIsParameter(aOffsetIsParameter); } \
48 NS_IMETHOD AddJoin(PRUint32 aJoinType, const nsAString & aJoinedTableName, const nsAString & aJoinedTableAlias, const nsAString & aJoinedColumnName, const nsAString & aJoinToTableName, const nsAString & aJoinToColumnName) { return _to AddJoin(aJoinType, aJoinedTableName, aJoinedTableAlias, aJoinedColumnName, aJoinToTableName, aJoinToColumnName); } \
49 NS_IMETHOD AddJoinWithIndexHint(PRUint32 aJoinType, const nsAString & aJoinedTableName, const nsAString & aJoinedTableAlias, const nsAString & aJoinedColumnName, const nsAString & aJoinToTableName, const nsAString & aJoinToColumnName, PRBool aRequiresFromTableIndexHint, PRBool aRequiresToTableIndexHint) { return _to AddJoinWithIndexHint(aJoinType, aJoinedTableName, aJoinedTableAlias, aJoinedColumnName, aJoinToTableName, aJoinToColumnName, aRequiresFromTableIndexHint, aRequiresToTableIndexHint); } \
50 NS_IMETHOD AddSubqueryJoin(PRUint32 aJoinType, sbISQLSelectBuilder *aJoinedSubquery, const nsAString & aJoinedTableAlias, const nsAString & aJoinedColumnName, const nsAString & aJoinToTableName, const nsAString & aJoinToColumnName) { return _to AddSubqueryJoin(aJoinType, aJoinedSubquery, aJoinedTableAlias, aJoinedColumnName, aJoinToTableName, aJoinToColumnName); } \
51 NS_IMETHOD AddJoinWithCriterion(PRUint32 aJoinType, const nsAString & aJoinedTableName, const nsAString & aJoinedTableAlias, sbISQLBuilderCriterion *aCriterion) { return _to AddJoinWithCriterion(aJoinType, aJoinedTableName, aJoinedTableAlias, aCriterion); } \
52 NS_IMETHOD AddSubquery(sbISQLSelectBuilder *aSubquery, const nsAString & aAlias) { return _to AddSubquery(aSubquery, aAlias); } \
106 PRBool hasQuote = PR_FALSE;
108 dest.Append(Substring(str, lastPos, pos - lastPos + 1));
116 dest.Append(Substring(str, lastPos, str.Length() - lastPos));
nsTArray< sbSubqueryInfo > mSubqueries
NS_DECL_ISUPPORTS NS_DECL_SBISQLBUILDER sbSQLBuilderBase()
PRPackedBool requiresJoinFromIndexUsageFix
virtual ~sbSQLBuilderBase()
nsresult SB_EscapeSQL(nsAString &str)
nsCOMPtr< sbISQLSelectBuilder > subquery
nsString joinedColumnName
Base interface for SQL building components.
nsString joinToColumnName
nsString joinedTableAlias
nsCOMPtr< sbISQLSelectBuilder > subquery
nsTArray< sbJoinInfo > mJoins
PRPackedBool requiresJoinToIndexUsageFix
nsCOMPtr< sbISQLBuilderCriterion > criterion
PRBool mOffsetIsParameter