[ALL] let's think about Query Language for 2.0

Ruslan Zasukhin sunshine at public.kherson.ua
Wed May 21 09:48:17 CDT 2003


on 5/21/03 2:16 AM, Charles Yeomans at yeomans at desuetude.com wrote:

> Class Interface WhereNode
> 
> Function toString() as String
> 
> WhereNodeAnd implements WhereNode
> 
> Sub WhereNodeAnd(condition1 as WhereNode, condition2 as WhereNode)
> Sub WhereNodeAnd(condition1 as WhereNode, condition2 as WhereNode,
> IsNOT as Boolean)
> 
> Class WhereNodeOr implements WhereNode
> 
> Sub WhereNodeOr(condition1 as WhereNode, condition2 as WhereNode)
> Sub WhereNodeOr(condition1 as WhereNode, condition2 as WhereNode, IsNOT
> as Boolean)
> 
> Class WhereNodeEqual implements WhereNode
> 
> Sub WhereNodeEqual(field as VField, rhs as String)
> Sub WhereNodeEqual(field as VField, rhs as Integer)
> Sub WhereNodeEqual(field as VField, rhs as Date)
> etc.
> 
> Sub WhereNodeEqual(field as VField, rhs as String, IsNOT as Boolean)
> Sub WhereNodeEqual(field as VField, rhs as Integer, IsNOT as Boolean)
> Sub WhereNodeEqual(field as VField, rhs as Date, IsNOT as Boolean)
> etc.
> 
> The constructors probably should be something like
> 
> Sub WhereNodeEqual(field as VString, rhs as String)
> Sub WhereNodeEqual(field as VVarChar, rhs as String)
> Sub WhereNodeEqual(field as VText, rhs as String)
> Sub WhereNodeEqual(field as VByte, rhs as Integer)
> etc.
> 
> 
> Class WhereNodeLessThan implements WhereNode
> 
> Sub WhereNodeLessThan(field as VField, rhs as String)
> Sub WhereNodeLessThan(field as VField, rhs as Integer)
> Sub WhereNodeLessThan(field as VField, rhs as Date)
> etc.
> 
> Sub WhereNodeLessThan(field as VField, rhs as String, IsNOT as Boolean)
> Sub WhereNodeLessThan(field as VField, rhs as Integer, IsNOT as Boolean)
> Sub WhereNodeLessThan(field as VField, rhs as Date, IsNOT as Boolean)
> etc.
> 
> Class WhereNoteLIKE implements WhereNode
> 
> Sub WhereNodeLIKE(field as VField, searchString as String,
> IsCaseSensitive as Boolean)
> 
> 
> 
> Then the code
> 
> dim q as Query
> dim c as VCursor
> 
> q = new Query(db.BaseObject("Customers"))
> c = q.Execute
> 
> is equivalent to "SELECT * FROM Customers".
> 
> 
> I believe that it would be useful to write such a set of classes now
> and see how the interface works in practice.
> 
> I'm a little confused about point 4.2 -- does this have to do with
> support for models other than relational?

In fact network model is very simple and nothing special.
Just you jump from one record to related records instead of building the
whole JOIN table.

Yes, your Node class looks close to true.

I think it is possible reduce the number of methods.

    Node( Node1, opCompare, Node2 )

Where opCompare is constant:
                       kEqual, kNotEqual, kThessThan, ...

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list