lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

mmmm ...

Where("id",GREATER,0,AND,"id",LESS_OR_EQUAL,10)            :-P

PA wrote:

On 3/8/06, Fabian Peña <> wrote:
DB('somefile'):Select('name,phone'):From('employes'):Where('ID >0'):OrderBy('name'):Go()

Yes, something along those lines.

One thing though:

Shouldn't the 'where' clause be 'exploded' in its components (e.g. key, operator, value)?

Where( 'id', '>', 0 )

Otherwise you will have to parse it to be able to make any sense of it, no?

Also, what about 'and', 'or' and such? If you pass them as literal string, you will need to parse them. Perhaps something like this, where each argument is a simple where clause:

And( Where( 'id', '>', 0 ), Where( 'id', '<', 10 ) )