Query module: more than just SELECT
Posted: 15 July 2007 04:48 AM   [ Ignore ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15450
Joined  05-15-2004

Personally, I find the query module one of the most versatile and useful ones to ship with EE. Is there a particular reason why only “SELECT” statements are processed, though? I recently had a situation where I needed an UPDATE statement, and had to resort to PHP.

We can, I think, safely assume that only moderately advanced users are using the query module anyway, so why not allow the full spectrum of SQL syntax? Because sometimes, you know, I like to be able to shoot myself in the foot grin

EE with its Superadmin concept is very similar to the UNIX “root” thing anyway, and assumes at least to some degree that users know what they are doing. So, unless there is some technical reason, please consider adding DELETE, INSERT and UPDATE statements to the query module.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 15 July 2007 05:06 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

I think the main purpose of said module is to allow developers to create their own repeatable output, which update/insert/delete etc.. do not return.  Perhaps you could write a simple module to take queries such as those you wish to execute. It would certainly be more optimised for such a task, since it needn’t worry about output.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 15 July 2007 05:50 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15450
Joined  05-15-2004

Yes, that is probably an option, but the query module has everything I need, really. Of course I am not talking about one time queries, they would be performed every time a particular template is loaded.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 06 September 2007 06:21 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

I couldn’t agree more. Sometimes writing a module/plugin for something just isn’t in the cards. I really want to be able to DELETE right now actually, which is why I’m here, and now realize I must resort to PHP. Ho hum.

So yeah, one more big vote for allowing all queries! :D

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 07 September 2007 08:48 AM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002

This is a general security issue.  Anyone with access to editing a template can use the Query module, but you can control whether or not someone has access to a PHP enabled template.

 Signature 
Profile
MSG
 
 
Posted: 07 September 2007 10:17 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

Couldn’t someone with access to editing a template also enable PHP and run their query in that (the long way)?

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 07 September 2007 10:29 AM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002
wondermonkey - 07 September 2007 10:17 AM

Couldn’t someone with access to editing a template also enable PHP and run their query in that (the long way)?

Only if they also have the privilege “Can administrate template groups and templates” enabled.

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65027 Total Logged-in Users: 47
Total Topics: 82117 Total Anonymous Users: 17
Total Replies: 441316 Total Guests: 206
Total Posts: 523433    
Members ( View Memberlist )