[Gambas-user] Suggestion SQL object

Jean-Yves F. Barbier 12ukwn at ...626...
Sun Aug 9 20:27:27 CEST 2009


kobolds a écrit :
> I wish to propose SQL object . 
> 
> in the project tree to add a new folder call SQL where it contain sql object
> . 
> the sql object basically is just use to store sql code (like a local stored
> procedure) but you can edit with 2 option . one using sqlquery the second
> edit the sql code (text directly)
> 
> these sql object can be call directly from the code .
> 
> the purpose of sql object is so that 
> - easy and cleaner  to maintain .  if you want to change the sql code , you
> don't need to hunt in your program source code

? A really good program doesn't contains much of SQL code, and if so, you just have
to put it in only one class and that's all

> - sqlquery tools make easy to create sql code

manual SQL coding as *always* been far superior to whatever tools you can use;
one of the reasons is no DB absolutely follow the SQLxxxx standards, each have
its idomatics AND, sometimes, these "specialties" are mandatory against a complex
application

> - some database that you do not wish or unable to have stored proc in it 

1st case is a terrible nonsense, 2nd: don't use such a dump

> - provide independent test your sql code without running the program

DB independant code is a popular DB rookies' myth: everybody producted such a driver/piece of 
code/addon/... however, if you dive into real good codes, you _never_ find such things: they all
use specifics.
Of course, some programmers still think mysql is a real good DB and they don't need stored
procs nor referential integrity; they also prefer to spend 4 days to develop some application 
remote poor code that could have been made in 4 hours as a stored proc; which is 200% more sure.

It is this kind of morons that yell to every ear that SQL is dead and "we must and will find 
a way to get rid of it" - still they're all wrong 'cos if such a solution was "so easily" 
reacheable, it should be today's standard.

And testing SQL code from files is only possible if you issue small and immutable queries;
if you involve 5 (or 15 or 45 or much more) tables, with a part of the proc that determine 
which tables will be further queried, you're out because your code is complex and no query
appears as a unique and complete string


-- 
Auribus teneo lupum.
	[I hold a wolf by the ears.]
	[Boy, it *sounds* good.  But what does it *mean*?]




More information about the User mailing list