WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 16 months ago

#37252 closed enhancement (maybelater)

Generic driver access to database

Reported by: alain91gmail Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: Database Keywords:
Focuses: Cc:

Description

Find attached an archive with files allowed generic access to database. Mysql at the moment.

The wp-db.php is modified as a proof of concept. It is possible to test all kind of extensions by modifying test conditions.

This is not a final file but it works

Attachments (1)

wp-db.zip (24.6 KB) - added by alain91gmail 4 years ago.

Download all attachments as: .zip

Change History (4)

@alain91gmail
4 years ago

#1 @tw2113
4 years ago

The mysql extension version should not be considered. It has been deprecated in PHP 5.5.0 and removed in PHP 7. The mysqli and PDO ones are recommended, so those would be fine if this gets traction at all.

#2 @pento
4 years ago

  • Milestone changed from Awaiting Review to Future Release

Thank you for the ticket, @alain91gmail! We've discussed implementing a DB driver system in the past (#21663, for example), but I think now's a good time to start that discussion again.

Your implementation reminds me a lot of @markoheijnen's WP DB Driver plugin, I'd absolutely recommend looking at that.

Ultimately, the primary requirements for this to get into core would be:

  • 100% backwards compatibility. The changes in #21663 bore most of the pain of getting plugins to switch to using WPDB (instead of the ext/mysql functions), so that shouldn't be too much of an issue, but it does need to be considered.
  • Ease of use. We cannot make the WPDB interface more complex than it already is. About the only exception to that would be to provide a real query prepare interface.
  • Performance. We would need a good set of benchmarks to show that the change doesn't have a negative effect on performance or memory usage. Ideally, I'd like to see performance improvements.

As a side note, we won't be able to drop ext/mysql support until WordPress officially drops PHP 5.5 support, which isn't on the roadmap (and isn't the topic of this ticket).

#3 @pento
16 months ago

  • Resolution set to maybelater
  • Status changed from new to closed

It's unlikely that we're going to perform a massive re-architecture of WP DB in the forseeable future, so I'm going to close this ticket.

Note: See TracTickets for help on using tickets.