Still, tons of Linux apps are written exclusively to use MySQL. I'd like to see them written with tools such as DBI, ODBC (pain!), etc, more often so that they are portable and users can choose what DB they want to use.
Don't get me wrong: I, too, would love to see more apps that are written exclusively for MySQL to be database-agnostic, but the problem is not in the lack of using DBI. The problem is that all of the major databases I can think of (Oracle, MySQL, Postrgess, Sybase, MS-SQL) use different dialects of SQL. That is, you have to write out a different SQL statement for one DB than the other to do exactly the same thing.
Granted, using DBI, or whatever the closest analog is in your language of choice, will make such porting issues easier, but there's no getting around the fact that, for example, join syntax is different between MySQL and Oracle. If you want your app to be usable on both DBs, simply coding it with DBI doesn't make it happen. You need to EITHER make all of your SQL so ridiculously simple that you might as well use a flat DB instead of an RDBMS, OR to make separate DB access sub-modules in your app for the databases you plan to support.
------------
:Wq
Not an editor command: Wq
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|