Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I assume you need a Query Builder to compose an SQL statement to a database and not a filter on the Quantum Grid (wich has an excellent filtering system on its own.)</p> <p>We have been using a SQLGenerator object for several years now. We have inherited this object from another project. While it does what it is supposed to do, I always have to look up an example if I am to create a new statement, to me an indication things should be simplified <em>(simplified at least to my level of understanding)</em>.</p> <p>Several <em>ideas</em> have passed the revue.</p> <p><strong>from each SQL keyword being an object in itself</strong></p> <pre><code>Node := where.AddNode; Node.Condition := cndOR Node.Add(a); Node.Add(b) </code></pre> <p><strong>to open arrays adding conditions</strong></p> <pre><code>And([a, Or([b])]); </code></pre> <p><p> <strong>but today I would probably implement this as</strong></p> <pre><code>SQLBuilder .where .condition(a) .and .condition(b) </code></pre> <p>The SQLBuilder object might look like this</p> <pre><code> ISQLBuilder = interface function select: ISQLBuilder; function from: ISQLBuilder; function innerJoin: ISQLBuilder; function where: ISQLBuilder; </code></pre> <p>and it should be possible to write</p> <pre><code> sqlStatement := SQLBuilder .select .column('o.name') .column('oi.price') .from .table('orders o') .innerjoin('orderitems oi').on('o.orderid').equals('oi.orderid') .where .condition('oi.price &lt; 100') .and.condition('o.name').equals('LatestOrder') .Build; </code></pre> <p>I am still trying to figure out what this all buys me besides writing the statement in plain text.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload