He asked if there was a specific reason why we have to go through an 'interface' to access our database instead of simply using the MySQL client.
If you mean the command line tool, it's also an interface to the library DBD::mysql uses. The difference is that the command line tool is an interface designed for interaction with humans, while DBD::mysql is an interface designed for interaction with code.
Given that the command line tool is meant for human use, you'll need to write a whole library's worth of code to properly make requests and parse responses.
That's a lot of work that's already been done for you. And very well done at that. Redoing it will take a lot of work, particularly in getting the kinks ironed out.
It'll take a long time because it's inherently fragile to use a human interface as an API. You'll be facing intermittent, subtle and hard to debug problems down the line.
In particular, do you think MySQL pays any special interest is keeping the output of the command line tool unchanged? Patching or upgrading could break your code.
And that means you'll have to maintain and fix this library, while DBD::mysql is well tested and there's a lot of outside interest in keeping it working.
And when MySQL is no longer optimal for your company, your codebase will be useles.
Does your boss think he'll be saving time? He's dead wrong.
In reply to Re: Advantage of using DBI
by ikegami
in thread Advantage of using DBI
by bichonfrise74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |