[V4MD] please read ALL: what about next idea -- let's take some Arca syntax ?

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jan 22 17:50:41 CST 2006


Hi Director developers,

I have spend some time reading Arca Xtra site and features,
and talking to few developers, some of them have choose Arca instead of
Valentina, as I understand only because of simpler syntax.

So, this is information from Arca site:

> myresult = gDB.executeSQL("SELECT name, age FROM users WHERE age<=18")

returns:

> [#rowschanged: 0, #columns: ["name", "age"], #columntype: ["text", "integer"],
> #rows: [["John", 15], ["Mary", 13], ["Paulo", 10]], #errorMsg: 0]
 
What good ideas I see here...

1) single QUERY function in Database class, which eliminates need of cursor
at all. 

    Hmm. I believe in V4MD 1.x was such function. Also we did have similar
    db level function in the Valentina for WebSiphon about 5 years ago.

    So it is good idea add such function to V4MD 2 back.


2) In Vcursor class we have
        GetRecordAsPropList(),
        GetRecordsAsPropList().

   and we have functions which can return records as SIMPLE list,
   and as Strings formated with some delimiters. So we have a lots here.
   
BUT. GetRecordsAsPropList() returns prop list in format

    [ [#fld1_name:v11, #fld2_name:v21],
      [#fld1_name:v12, #fld2_name:v22],
      [#fld1_name:v13, #fld2_name:v23],
      [#fld1_name:v14, #fld2_name:v24]
    ]

It is easy to see that this function stupidly create field names many times.
IF you look on Arca list, then its author have extract field names into
separate sublist, and rows go as simple list in fact.


------------------------------------------
So how we can improve V4MD2 to get this idea?

A) Arca use SqlExecute() function to execute EXECUTE and SELECT commands.

    Valentina 2 on C++ Level have 3 functions in fact:

        db.SqlExecute() as integer
        db.SqlSelect() as VCursor
        db.Query() as VResult

    Function Query() is exactly what we need!
    So we can add into V4MD new function

    Vdatabase.Query() -- returns property list in format of Arca do.


This can be implemented very easy.
    (at last of end do simple things is much easier then do hard :-)

I think everybody will agree that we can add this function with no problems.

IF exists some Lingo developers that prefer this way they will get it.
Developers which what more flexibility and control will go to

    SqlExecute() -- it simply returns integer
    SqlSelect() -- to get vcursor and its features.


--------
B) Now lets think about existed RecordsAsPropList()
    
    it looks like will be good idea to change their result.

I think we can:

    * rename existed functions to
                RecordAsPropList2() // deprecated

    * and have RecordAsPropList() with new behavior.

So people that use them now will need just find/replace to fix existed code.
All new code will go with these new methods.

What you think about this plan ?


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list