I often make small projects for friends or for people on forum I visit. For instance, it's create a user space, or chat page, or stuff like that.
That's why I think Frameworks/ORM is not suitable for the size of these projects, the code is often less than 300 lines.
But in all cases, I use PDO, and it's really using to write the SQL string, check the docs to make a INSERT, .. So I was thinking of extending the PDO Class with a chaining approach, like this:
$pdo->create('users', array(
'id' => 'int',
'username' => 'text',
'password' => 'text'
));
$pdo->insert(array(
'username' => $user,
'password' => md5($password)
))->in('users');
$pdo->update(array(
'username' => $new_user
))->in('users')->where('id', $user_id);
$pdo->select()->from('users')->where('id', $user_id)->row();
$pdo->select('username')->from('users')->rows();
$pdo->drop('users');
$pdo->close();
And if PDO or the way of storing (mysql/sqlite/...) changes, I just have to edit the class and it's done.
So, does a similar class exist ? And is it a good idea to make things like this ?
EDIT: I'm sorry to bump this thread, but I'm afraid that no-one has made a thing like this..