This is a working group for those involved in the development and extension of Drupal's Next Generation database abstraction layer, including the Schema API and the development of new database drivers.
Please remember to read the documentation for the Database API. It will likely be helpful to review the PDO documentation as well.
Multi-master synchronous replication system for MySQL on AWS with Drupal as POC
At MySQLcon I ran into the guys from Codership. They did a 25 minute presentation on how to do multi-master synchronous replication across many instances of MySQL.
In layman's terms.
Read moreIf you are running 5 Master MySQL databases behind your giant Drupal site, and one of those servers crashes, you won't lose a transaction, and you won't corrupt your logs and destroy your database.
Drupal & MySQL 5.x Cluster
I setup a MySQL 5.0 Cluster on a spare server with multiple Xen VMs and discovered that Drupal 6 (and most likely D7 as wel) as it exists today cannot function properly under the MySQL NDBCLUSTER engine. It seems that under the NDBCLUSTER engine (also known as NDB), D6 has a table called menu_router that fails to be converted.
I posted a bug report about it under the D6 platform as it is rather detailed, but I have an idea this will affect D7 as well.
http://drupal.org/node/391130
Bikeshed Showdown: Figure out a "one true" DBTNG syntax
I've heard various rumblings in #drupal from people who don't like the current DBTNG code style for one reason or another. Since PDO doesn't have coding standards, we've had to make up our own. Complaints range from it being inconsistent (which wouldn't shock me, since it was decided sort of piecemeal between random conversations between Larry and myself) to not being easily formatted in tools like Coder Format and emacs (which is a big problem) to just being kind of "icky." Not having this nailed down is actively blocking issues such as porting core files to DBTNG.
So let's have it out! Here's the current syntax. Can you do better? And why?
<?php
$result = db_query("SELECT name FROM {test} WHERE age = :age", array(':age' => 25));
db_insert('test_task')
->fields(array('pid', 'task', 'priority'))
->values(array(
'pid' => $john,
'task' => 'eat',
'priority' => 3,
))
->values(array(
'pid' => $john,
'task' => 'sleep',
'priority' => 4,
))
->execute();
?>Reserved word conflicts: how can we solve it?
According to research progress of http://drupal.org/node/371#comment-1123065, D7 core schema is now conflict with following keywords. Any idea about the solution? Should we revamp and avoid the use of these reserved words?
Read moreSimple object CRUD: a proposal
With Drupal 6, menu tokens are able to automatically load database records given an object id, this is a great feature, however this requires developers to implement 'load functions' for loading their records. Those 'load functions' are often just a wrapper around 'SELECT * from {mytable} WHERE mykey = %d'.
We could do better, and allow automatically load operations, and even better, enable automatic basic CRUD.
Read moreStoring custom fields in users table - anyone doing this?
user.module has long supported storing custom fields in its table. values in those fields are automatically loaded into $user and saved during hook_user('insert'|'update').
has anyone used this feature in d6? i cam considering doing so for a high performance site where avoiding the join is helpful. with hook_scema_alter() we now have a clean wayto extend tables so i am feeling like this is a reasonable feature to use in custom code. i still would not recommend it for contrib code.
Read moreDatabase spotlight (moved)
(Note: I have moved the contents of this node to a sub-page of the http://drupal.org/community-initiatives/drupal-core section: http://drupal.org/node/361858 - webchick)
Read moreDatabases: The Next Generation task list
With the new PDO-based database API now in core (yay!), there are a number of follow-up tasks that need to be taken care of. They were left out of the original patch for a variety of reasons, mostly keeping the already massive patch from becoming even more massive. :-)
Read moreTable "Node" Field "language"
Drupal 6.x. Table "node".
What should the value of the "language" field be if the displayed text is Chinese.
If a value is required, are there any other things that need to be done so that Chinese symbols are correctly displayed.
Any help appreciated.
Steve
http://prime357.org
ps. I've got a thread running at my site which I think this may be a part issue to it. As you can imagine it's becoming very confusing as all I see is either unicode or Chinese symbols (can't read Chinese).
Read moreLooking for Contributors - C++ (and other stuff in time)
Hope I'm not out of line with this request.
I'm now on the lookout for C++ contributors (and other like stuff in time). I started the site http://prime357.org, which is a separation from my personal blogging (http://superjacent.net - running) site, in early April this year. Too much geeky stuff was creeping into the running site.
Read moreBase 36 (Vancode) - leading digit/character
I hope this is the right area for this question which refers to the 'thread' field of the table 'comments'. I provide a non php solution to convert Wordpress data to Drupal. I recently became aware that the thread field is not a string of decimal numbers but is in fact a string of base 36 (Vancode) numbers. I've created the necessary functions to convert to and from base 36 format but I'm a little confused re - the leading digit/character.
Here is an excerpt from http://api.drupal.org/api/function/int2vancode/5
<
blockquote>
Read moreSouth Bay: Birds of a Feather session at MySQL Con followed by Sun & MySQL party (Both free attendance)
Join Amazon (Kieran Lal) and other Drupal community members and leaders at the Drupal Birds of a Feather session at the MySQL Conference & Expo on Wednesday, April 16th at 7:30pm. The BoF takes place in Ballroom “E” at the Santa Clara Convention Center. Afterwards, Sun will be giving away a Playstation 3 and Sun Fire X2100 M2 Server ($2,495) at their party next door. Wear your Drupal shirt!
More info about the conference:
http://en.oreilly.com/mysql2008
More info about the Sun party:
Read moreSome review and proposal about Drupal 7.x database stack
I start my Drupal + Oracle research since the end of Drupal 4.7 life cycle (around Oct 2006), based on my client's request. The project is still running, but I am not satisfy about its progress. After keep trace in Drupal database stack implementation for more than years, it is time for focusing on Drupal 7.x development.
So what are the changes since 4.7.x? And what will be happened for 7.x? I would like to share my research progress with you, and so let's brain storming for what's next :-)
Read moreDB support as contribute: is it a good idea?
Abstract
Drupal 6.0 is revamped with Schema API, so what's next for Drupal 7.x? PDO for sure! With this powerful data-access abstraction layer, workload will much reduced for DB abstraction layer designers and developers, and finally benefit our contribute developers and end users.
By the way, together with the decision of Drupal 7.x + PDO, there is also some voice about moving PostgreSQL (and so other potential databases support, e.g. Oracle, DB2, MSSQL, etc) support away from core, but contribute; on the other hand, add official SQLite support into Drupal core, together with MySQL.
Is this really a good idea? Or even if it is possible? As an existing Drupal + PostgreSQL users, what will this affect your daily work? As a potential customer of Drupal + Oracle/DB2/MSSQL/etc, is this a good new for you, or just an evil? I would like to provide some brief idea for you within this article.
Read moreIssues Need Review for Enhance Cross Database Compatibility
Enhance cross database compatibility is important for our Drupal Core, especially when we are going to ship D7 with PHP5.2.x PDO implementation. BTW, this will require number of individual patches, so your help and review are required - add it to the top list with a brief description and an estimate of the time to review. Once reviewed, move the issues to the bottom "reviewed" list, perhaps with your name attached.
Read moreMy personal battle target for Druapl 7.x
My primary battle plan should be enhance Drupal cross database compatibility. I have involved in this topic for around a year, and I would like to keep it on going. To accomplish this target, I would like to complete the following tasks before D7 code freeze:
<
ul>
Something should be done before any other targets, e.g. resolve reserved words conflict, split drivers into individual files for better management, indeed but simple abstraction for different database syntax, add INSERT/UPDATE/DELETE abstraction and enhance drupal_write_record() abstraction, etc. With a better common base for multiple database development, we will need much less time to study the differences between databases than that of before.
Shipping D7 with PHP PDO should be a spotlight topic, since it is now official package for PHP5.2.x, and legacy drivers will soon be removed in PHP6.x. We may need some cleanup in our core query syntax, in order to let PDO get works.
Up to this point, I would like to introduce some other database backend for D7, e.g. <a href="http://drupal.org/node/39260'>Oracle, SQLite, IBM DB2 and also MSSQL. If we are able to support SQLite in D7, which also means we are going to standardize our core queries into SQL92 standard, the problem for maintain multiple database backend should no longer a critical problem; if we are able to support Oracle, the most complicated database I guess, this should no longer a problem for us to implement drivers for other databases.
I have summarize most of my personal battle targets in here. Most logic are proved as functioning, and they are all get set for the open of D7 public development. On the other hand, I would like to explore if this may integrate with other interest musings with Data API, so we will able get all stuff better in D7 ;-)
Read moreAre performance optimisations still going into D6?
I'm assuming it's too late, but if not here's an easy performance win for D6:
<
blockquote>The type column of the {system} table is currently a varchar(255) field. Yet in 99% of all Drupal installations it stores either the text 'module' or the text 'theme' and nothing else. This is already a strong case for making it an int column and defining constants for module and theme. Then, on every page, there is this query:
SELECT filename FROM system WHERE name = 'user' AND type = 'module';
Musings on a Data API
I have been pondering the question of a data API for a while, as have a lot of people. Much of the recent discussion has focused on an Active Record approach to a data API. Now, Active Record is a very powerful architectural pattern. It maps nicely from storage to interface, it can be fairly self-documenting, and it is conceptually simple and approachable.
It is also, I believe, insufficient.
Read moreMySQL Table Type
I think it is safe to say that many developers already using or about to start using MySQL table type InnoDB. Some developers even changing default MySQL storage engine to InnoDB.
In many cases it make sense to convert table type if not for all tables, then at least for some tables.
In this situation will be nice if modules developers will state what table type is necessary for those modules and why.
Otherwise, its has to be investigated and tested for all modules in the project installation. May be it is fun but it is also a lot of time.
My suggestions for Drupal developers are
- include into modules .install file the indication of MySQL table type in the end of each table creation query like "CREATE TABLE `tablename` (...) ENGINE=InnoDB DEFAULT CHARSET=utf8" or "... ENGINE=MyISAM ...";
- include into 'INSTALL.TXT' file description of why these tables need to have those types.
That will give another developers enough information for making right decision on MySQL optimization of project's Drupal installations.
Read morePHP 5.2.5 breaks SQL Server support; Yet MSFT SQL Driver Works
So, I've had some free time latley, and I've started back on the database API layers (DB2 and SQL Server currently).
However, I have found 2 disturbing issues.
Overview
First, I'm currently exploring the following 3 ways to connect to sql server:
1. FreeTDS
2. php_mssql driver
3. MSFT SQL Driver ( See pcorbetts posting for a link to the driver )
- PHP 5.2.5 breaks support for SQL Server








