Commit eca6fe63 authored by William Naslund's avatar William Naslund

Tweaked the conditions

parent 6e0d3159
{
"typescript.tsdk": "node_modules/typescript/lib"
}
\ No newline at end of file
......@@ -7,9 +7,14 @@ export abstract class DBCompoundCondition<T extends DBModel> implements DBCondit
/** The parameters from each condition */
private conditionParameters: any[];
/** The conditions that are part of this compound condition */
private readonly conditions: DBCondition<T>[];
constructor(
protected readonly conditions: DBCondition<T>[]
) { }
...conditions: DBCondition<T>[]
) {
this.conditions = conditions || [];
}
/** Returns the SQL to be placed in between each condition */
protected abstract joiningSQL(): string;
......
const query = blah blah blah ...
query.where(
dbAnd(
dbOr(
'id', dbEquals('ABC 213'),
'account', 'name', dbEquals('AHOY')
),
dbNotEquals('archive', true)
)
)
query.where(
'id', dbEquals('ABC 123'),
dbAnd(
'account', 'blah', dbEquals('yepper'),
'otherfield', dbGreaterThan(123)
),
dbOr('id', dbEquals('DEF 456'))
)
query.where(
dbParent(Account, 'account_id').where('id', 'account id...')
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment