Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-20-2011, 12:04 AM
|
#1
|
Member
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Rep:
|
Relational interface/wrapper around SQL database?
I'm not a database guru, so be patient with me: Is there some kind of "wrapper" software you can put around an SQL database (MySQL perhaps) that allows you to internally configure database rules on a higher level than the database itself can actually implement? (E.g., "rows in table A can be deleted, but only if there are no related rows in table B and only if column x for the row in table A is in state y.")
The idea would be to keep from having to trust this kind of logic to the client programs, while also avoiding the need to write a full fledged server daemon just for your application. The clients submit their SQL insert requests to the wrapper daemon, and the daemon passes them on to the database if they pass a rules table defined for that particular database.
Again, not a database guru, but I'm sure that can't be a new idea.
|
|
|
05-20-2011, 06:01 PM
|
#2
|
Member
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213
Rep:
|
You're right about the new idea thing. A few quarters ago, we did the same thing with MySQL server. The exception though is that we did not program the database itself, we used a few PHP scripts to read through the database records and tables. The scripts would only run if information was entered into a form and submitted (or through a cron job, in my case). Not sure if that helps, but the scripts we made did wrap around the database.
Let me rummage through my database stuff and see if I can help you.
|
|
|
05-21-2011, 09:58 AM
|
#3
|
Member
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213
Rep:
|
Unfortunately, I couldn't find anything useful for what you wanted to do. Are there any database admins out there who know more than I do?
|
|
|
05-21-2011, 02:24 PM
|
#4
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
You can try to use triggers in mysql itself.
See e.g. http://www.brokenbuild.com/blog/2006...ith-a-trigger/ how to abort an insert, but I guess it will work similar for delete.
And obviously links about triggers.
Never used triggers, so you have to figure a few things out yourself
Last edited by Wim Sturkenboom; 05-21-2011 at 02:27 PM.
|
|
|
All times are GMT -5. The time now is 08:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|