LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-19-2011, 11:04 PM   #1
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
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.
 
Old 05-20-2011, 05:01 PM   #2
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
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.
 
Old 05-21-2011, 08:58 AM   #3
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
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?
 
Old 05-21-2011, 01:24 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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 01:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best free relational database for ubuntu? tommytea Linux - General 10 09-24-2009 06:56 PM
LXer: Is the relational database now a commodity? LXer Syndicated Linux News 1 04-16-2007 06:32 PM
a good book for relational database design? kpachopoulos General 3 11-20-2004 08:14 AM
Question: How to define an SQL HAVING clause in relational algebra? jdruin Linux - Software 1 11-08-2004 07:50 AM
Relational Database on Linux Ronw Linux - Software 10 11-11-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration