Skip to content

Preparing Stream for Alternate Database Drivers#865

Closed
faishal wants to merge 26 commits intoxwp:developfrom
faishal:feature/db-driver
Closed

Preparing Stream for Alternate Database Drivers#865
faishal wants to merge 26 commits intoxwp:developfrom
faishal:feature/db-driver

Conversation

@faishal
Copy link
Copy Markdown
Contributor

@faishal faishal commented Aug 2, 2016

  • Enable alternate drivers in WP_Stream\Plugin::__construct(), Replaced the hard-coded WP_Stream\DB reference with a value that can be filtered, defaulting to the WordPress Database.
  • Created WP_Stream\DB_Driver interface, which help to implement Driver classes
  • Created WP_Stream\DB_Driver_WPDB class and implemented WP_Stream\DB_Driver interface, Moved all WordPress database related operation and query into driver class.
  • Updated WP_Stream\DB class to use driver passed in constructor. Class contains wrapper function to communicate with driver, Moved all query related function into database driver file.
  • Updated WP_Stream\List_Table to use WP_Stream\DB wrapper method instead of WP_Stream\Query class methods.
  • Some minnor changes in other files to adopt new DB class methods.
  • Added related test cases.

Luke Carbis and others added 26 commits November 27, 2015 13:52
abstracted db class interface, so it is configurable
Conflicts:
	classes/class-db.php
	classes/class-query.php
…p, since that work was moved a level deeper
@faishal
Copy link
Copy Markdown
Contributor Author

faishal commented Aug 2, 2016

@lukecarbis

As we talked earlier on this, This branch is forked from vip branch. We have fixed couple of issues found during building an alternative driver and have added related test cases.

Also we tested this with Stream to Papertrail add-on to make sure we are not breaking anything.

@tlovett1
Copy link
Copy Markdown
Contributor

Hey XWP, any update on this?

@lukecarbis
Copy link
Copy Markdown
Contributor

Will test it today, but can you fix the unit test that's failing?

$wpdb->streammeta = $this->table_meta;

// Hack for get_metadata
$wpdb->recordmeta = $this->table_meta;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much spacing after each of these properties. They can be aligned with less spaces.

* @return array
*/
public function get_column_values( $column );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line here can be removed.

@lukecarbis
Copy link
Copy Markdown
Contributor

@faishal This is looking really strong. I've made a whole bunch of comments, including some really small spacing changes (sorry about that).

There's three major things that need to happen before this can be merged:

  1. We should have a discussion about the Query class, and whether it should be renamed, or merged with DB_Driver_WPDB
  2. There are some TODO methods in DB_Driver_WPDB which still need implementation (purge_storage, setup_storage)
  3. Some unit tests are failing

@dkotter
Copy link
Copy Markdown
Contributor

dkotter commented Sep 15, 2016

This PR can be closed out in favor of #881.

@lukecarbis lukecarbis closed this Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants