#1 2016-01-06 09:04:26

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

Hi Arnaud,

I can see the advantages (both performance and avoid strange dead-locks) of the BatchStart/BatchSend serious of methods.

Currently the batch operations are limited to record addition, update and deletion only, is it possible to also add a new method which works like Execute(aSql: utf8string) but is handled by the batch mechanism? Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2016-01-06 09:36:23

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

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

We are talking about an ORM, here... SQL may be to be avoided as much as possible, right? wink
It would break the cross-database feature of the framework, I guess...

But it may not be the only safe way of implementing a non-blocking complex transaction from client side...
The idea may rather be to use a SOA method, with direct SQL access, IMHO.

Offline

#3 2016-01-06 10:48:15

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

In this use case of mine it's not a ERP-type of business application, it's desktop app inter-process senario, so cross-db and security is not a concern tongue


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2016-01-06 17:32:54

ed
Member
Registered: 2014-11-19
Posts: 4

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

I second this proposal.

I my opinion not all sql must be seen as one problem to solve.

From the top of my head:
Functional sql: This is what the orm's implementation hides.
Technical sql: Sometimes needed in more complex cases, dialect e.g. could be handled at resource level.

Offline

#5 2016-01-06 18:04:05

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

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

Agreed!

Could someone please add a feature request ticket?
Or even propose a patch?

Offline

#6 2016-01-06 18:39:38

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

@ab, a feature request I can create, a patch is currently beyond my level of understanding into this framework smile

http://synopse.info/fossil/tktview/f56f … 8860308ef1


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#7 2016-07-23 08:11:38

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

Hello Arnaud,

I'm not sure your priority, anyways, the ticket system shows that the ticket is "open", so I guess you haven't added it yet smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#8 2016-07-24 02:14:08

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

Allow raw SQL execution in batch mode,I think this feature is very easy to use, fully supports this feature

Offline

#9 2016-07-24 08:37:28

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

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

It was on purpose that direct SQL execution in a batch is NOT implemented in mORMot.
It breaks most interest of the ORM implementation.
Even the "EngineList" method is a PITA.
Then you would be stuck with a single DB provider.

Of course, as we wrote in the doc, sometimes, there is nothing better than a tuned SQL.
The ORM can't do anything.
If you want to run some complex SQL statement on the server side, do not use the ORM, but the SOA feature of mORMot.
Write your own SOA service, running directly all the SQL statements on the server side, and call it from the client side.

As such, I've rejected this ticket.

Offline

#10 2016-07-24 16:53:23

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Suggestion - Add BatchAddRawSql() to the batch update mechanism :)

Hi ab,

That makes sense. And it's your call smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB