RE: get the SQL to be executed
Greg Monroe <[email protected]> Thu, 19 Jan 2012 10:05:15 -0500
| Newsgroups | gmane.comp.jakarta.turbine.torque.user |
|---|---|
| Message-ID | <55B8568AFA5F144F886F18186BAD5B2C2BEC7C1875@durham-e2k7mb1.dukece.com> |
If you are trying to generate an initial data scripts rather=0D=0Athan a "a= udit log", you might look at the dumpdata and datasql=0D=0Atasks that Torqu= e supplies=2E I have used these to create =0D=0Ainitial data sets that app= lications need (e=2Eg=2E initial user=0D=0Aentry, rights entry, etc=2E)=0D= =0A=0D=0AIf you need to do this inside the code, you might look at=0D=0Athe= apache ddlutils project db=2Eapache=2Ecom/ddlutils=2E This has=0D=0Asome = code callable functions to generate various SQL scripts=2E=0D=0A=0D=0AIf yo= u don't need SQL, but are really looking for a way to =0D=0Aexport/import d= ata between Torque applications, look at=0D=0Asf=2Enet/projects/torque-addo= ns=2E This has a framework for =0D=0Aeasily creating XML exports of record= s=2E You may need to=0D=0Awrite some record handler code to deal with fore= ign keys=2E=0D=0A=0D=0AGreg =0D=0A=0D=0A-----Original Message-----=0D=0AFro= m: Joe Carter [mailto:joe=2Ecarter@gmail=2Ecom] =0D=0ASent: Thursday, Janua= ry 19, 2012 3:32 AM=0D=0ATo: Apache Torque Users List=0D=0ASubject: Re: get= the SQL to be executed=0D=0A=0D=0AYou can use a logging driver such as p6s= py to see your SQL statements=2E=0D=0Ahttp://sourceforge=2Enet/projects/p6s= py/=0D=0A=0D=0AOn 19 January 2012 08:25, Thomas Fox <Thomas=2EFox@seitenbau= =2Enet> wrote:=0D=0A> Perhaps you can use the log output (with some tweaks = to the log4j=0D=0A> configuration)=2E However I'm not sure how and if Torqu= e 3=2E3 logs the update=0D=0A> statements=2E But then again I've heard of d= rivers which at as a bridge=0D=0A> between the application and the real dri= ver (e=2Eg=0D=0A> http://www=2Esquirrelsql=2Eorg/) and which can do the log= ging for you=2E=0D=0A>=0D=0A> Torque 4 will not work because it uses prepar= ed statements for updates,=0D=0A> this will not give you any sensible sql= =2E=0D=0A>=0D=0A> =A0 =A0Thomas=0D=0A>=0D=0A>> Hello all, is there a way in= Torque to get the SQL that is sent to the=0D=0A> DB=2E=0D=0A>> I have to g= enerate a txt file where I save queries basically INSERT=0D=0A>> statements= of long records=2E=0D=0A>> I was thinking of create the Torque classes, po= pulate the objects with=0D=0A>> data that I get from a local instance of th= e DB and then, instead of=0D=0A>> using a save command, get the SQL that wo= uld be executed and store it in=0D=0A>> a file=2E=0D=0A>>=0D=0A>> Alternati= vely I could use this:=0D=0A>>=0D=0A>> http://openhms=2Esourceforge=2Enet/s= qlbuilder/=0D=0A>>=0D=0A>> but has dependencies that requires GPL license a= nd I would avoid in this=0D=0A>> case that kind of license=2E=0D=0A>=0D=0A>= =0D=0A> -------------------------------------------------------------------= --=0D=0A> To unsubscribe, e-mail: torque-user-unsubscribe@db=2Eapache=2Eorg= =0D=0A> For additional commands, e-mail: torque-user-help@db=2Eapache=2Eorg= =0D=0A>=0D=0A=0D=0A--------------------------------------------------------= -------------=0D=0ATo unsubscribe, e-mail: torque-user-unsubscribe@db=2Eapa= che=2Eorg=0D=0AFor additional commands, e-mail: torque-user-help@db=2Eapach= e=2Eorg=0D=0A=0D=0ADukeCE Privacy Statement:=0D=0APlease be advised that th= is e-mail and any files transmitted with=0D=0Ait are confidential communica= tion or may otherwise be privileged or=0D=0Aconfidential and are intended s= olely for the individual or entity=0D=0Ato whom they are addressed=2E If yo= u are not the intended recipient=0D=0Ayou may not rely on the contents of t= his email or any attachments,=0D=0Aand we ask that you please not read, cop= y or retransmit this=0D=0Acommunication, but reply to the sender and destro= y the email, its=0D=0Acontents, and all copies thereof immediately=2E Any u= nauthorized=0D=0Adissemination, distribution or copying of this communicati= on is=0D=0Astrictly prohibited=2E