#1 2014-10-10 04:41:03

mariomoretti
Member
From: italy
Registered: 2012-01-29
Posts: 88

engineexecuteall ?

I've updated to trunk.
Engineexecuteall is dead  : perhaps to maintain the framework light...may be a good reason.
Searching among new functions i've found StoredProcExecute : I need only to submit an sql statement to the server...
How can I do this now  ?
tx smile

Offline

#2 2014-10-10 07:03:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: engineexecuteall ?

Yes, we did make some refactoring to gather all CRUD operations at TSQLRest level.
It helps code maintainability and evolution, following SOLID principles (especially the Liskov principle, so that we should work with more abstract class level).

Now you can use those TSQLRest methods:

    /// Execute directly a SQL statement, expecting a list of results
    // - return a result table on success, nil on failure
    // - will call EngineList() abstract method to retrieve its JSON content
    function ExecuteList(const Tables: array of TSQLRecordClass; const SQL: RawUTF8): TSQLTableJSON; virtual;
    /// Execute directly a SQL statement, without any expected result
    // - implements POST SQL on ModelRoot URI
    // - return true on success
    // - will call EngineExecute() abstract method to run the SQL statement
    function Execute(const aSQL: RawUTF8): boolean; virtual;
    /// Execute directly a SQL statement with supplied parameters, with no result
    // - expect the same format as FormatUTF8() function, replacing all '%' chars
    // with Args[] values
    // - return true on success
    function ExecuteFmt(SQLFormat: PUTF8Char; const Args: array of const): boolean; overload;
    /// Execute directly a SQL statement with supplied parameters, with no result
    // - expect the same format as FormatUTF8() function, replacing all '%' chars
    // with Args[] values, and all '?' chars with Bounds[] (inlining them
    // with :(...): and auto-quoting strings)
    // - return true on success
    function ExecuteFmt(SQLFormat: PUTF8Char; const Args, Bounds: array of const): boolean; overload;

Offline

Board footer

Powered by FluxBB