I am pretty new to databases; I am currently taking an online course from Stanford about relational algebra, database design, and fundamental and advanced features of the SQL language.
I am going to be writing an application that uses databases extensively (like most applications nowadays), and of course, I would like to abstract away the specifics of the database itself. Ideally, I'm hoping to build a module of my program with a public function that takes SQL code as input and modifies or returns data from the database as specified by that code. I don't want any of the rest of my program to care what database system I'm using (MySQL, SQLite, etc.) underneath. This obviously makes the lack of agreement between the different dialects of SQL used by various vendors a problem.
From what I can tell, this is currently impossible. It seems that my best option would to be to simply use a system like PostgreSQL that strives to follow the standard as closely as possible, but even then, it doesn't seem that PostgreSQL supports the complete standard exactly. Worse, I am then tied to the implementation (read: performance characteristics) of that one SQL system.
So what should I do? Is there a tool that can, at least somewhat reliably, convert between SQL dialects? I'm guessing that that won't even be enough, when you take into account things like triggers that are persistent in the database itself, and therefore affect more than the data and the code in which they are specified. Would I then need a tool that sits on top of the database system and stores its own persistent data? Again, does such a tool even exist? Or should I just suck it up, pick a particular system, and have my application code generate SQL code that that particular system accepts?
If the latter, I am interested in the possibility of later developing such a tool. I realize that it would be an absolutely monstrous task, so where should I go to gauge interest in such a project?