Download & Extend

Move to PDO for all database access

Project:Provision
Component:Code
Category:task
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:aegir-0.4

Issue Summary

Postgres support is very very far from high priority, but when we do have it, it would make more sense to maintain 1 provision_db_server module that extends drupal's existing db api. ie: provision.mysql.inc and provision.pgsql.inc.

even less of a higher priority is multiple web server (ie: apache/lightppd etc) support, but something similar could be useful if we wanted to implement multiple TYPES of apache hosting (ie: clusters, web front ends, etc).

Comments

#1

Title:Turn all provision_mysql speciality functions into db_mysql functions, to integrate with database.inc» Turn all provision_mysql speciality functions into provision_db functions, to integrate with database.inc

Make it clear that we want to abstract the database layer here.

#2

Status:active» postponed

This can't be done until we're on D7 with the new db layer.

so this is a very very long time away.

#3

Title:Turn all provision_mysql speciality functions into provision_db functions, to integrate with database.inc» 0.3 - Move to PDO for all database access
Version:5.x-0.1-alpha1»

We now no longer rely on the drupal database layer at all, and drush 2.x now requires php 5.2, so we can rely on PDO always being available.

The only functions that need to differ for PG are :

<?php
function _provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host) {}
function
_provision_mysql_destroy_site_db($db_name, $db_user, $db_passwd, $db_host) {}
function
_provision_mysql_database_exists($name) {}
function
_provision_mysql_create_database($name) {}
function
_provision_mysql_grant($name, $username, $password, $host = '') {}
function
_provision_mysql_revoke($name, $username, $host = '') {}
function
_provision_mysql_import_dump($dump_file, $db_name, $db_user, $db_passwd, $db_host) {}
?>

At least for D6 sites, this should allow us to have full postgres support for drupal (in as far as the drupal postgres port actually works).

This would also give us access to sqlite, which might be useful for some interesting problems.

#4

Title:0.3 - Move to PDO for all database access» Move to PDO for all database access
Status:postponed» active

Tagging for 0.4.

#5

This is a requirement of #585796: postgresql backend support.

#6

Main purpose of this post is to subscribe to get this into my issue queue.

I think a small provisionPDO class might be sufficient (not extending PDO itself). The constructor and destructor can handle a connection with other methods such as query, results, db_exists (?), create/drop_db, grant/revoke, and some others.

#7

we need to move them into drush engines, and conditionally include them based on a flag.

i'm open to making them classes too.

in fact, this might help a lot in our future work for server stuff.

#8

Status:active» fixed

this is done in dev-services.

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.