Database Abstraction KISS

I think I’m going to throw my hands up and just go with the simple method of doing everything instead of playing god and recreating the world. In the way, I plan on doing it, it will kind of work with PDO when I convert it over to it.


// Mysql
$database->mysql()->query($sql); // Regular Query
$database->mysql()->query($sql)->log(); // Run Regular Query, and then Log

// SQLite
$database->sqlite()->query($sql); // Regular SQLite Query
$database->sqlite()->createdatabase($name); // Create Database
$database->sqlite()->createtable($table); // Create Table

I believe that if I allow for a connection in the parameter:

$database->mysql('connection1')->query($sql);

Then I could have multiple connections connecting to different databases. This would allow for multiple database connections as well as multiple sqlite database file connections to be created. I’ll document this better and see how well it goes. If this doesn’t cut it with the speed and what not then I don’t know what I’ll do.

Exceptions

I need to create more exceptions for the Databases for the different errors that could occur. Right now the one exception isn’t even used at all.

Result

Result will still return an iterator for processing, but I want to continue working on cleaning up the code a little bit. Also making it more intelligent on how many rows and speed up the preformance of the class.

Possibly Related Posts:


Comments are closed.