Currently there is no way to use the Schema API to describe tables which are located in external databases. This is prevented by the usage of db_* wrapper functions in drupal_(un)install_schema and drupal_write_record. I believe that using schema for other databases than the default one could make sense. It would, for example, simplify the creation of entity controllers which handle external data. (see attached example controller).

In Drupal 8, Schema should be usable for all tables regardless the role of the database. I've created a stub patch against 7.x-dev therefore I've set the version to 7.x-dev. Please change to 8.x-dev if more appropriate.

Comments

xatoo’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
StatusFileSize
new4.84 KB
new3.14 KB

Rerolled patch for 8.x. I hope this will work since its my first patch created using git.

catch’s picture

Subscribing.

mitchell’s picture

Would this allow for a project like Salsa Entity + Salsa API to be more easily built using a Remote Entity Controller and a cURL database backend?

berdir’s picture

Salsa doesn't need this, it has nothing to do with it. This is about managing a schema in an external database, when accessing it through DBTNG. Salsa is a custom HTTP based API, this gives us absolutely nothing.

The salsa entity property information is embedded using a custom entity property controller that fetches it from the provides service. We are not interested in adding a hardcoded duplicate of that information. All we want to do is already possible thanks to the pluggable architecture.

Also, Translation Management Tools and consorts are plain normal local entities. Not sure about Artesian, but I'm quite that's a local entity too?

Not saying that this wouldn't be useful in general but it's certainly not for Salsa/TMGMT.

The last submitted patch, 1: 1125024-remoteschema8x-1.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

marvil07’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

D8 patch here does not apply anymore, and probably needs to be re-worked, hence marking this as NW.

tameeshb’s picture

What needs to be done here for the reroll if the files so not exist?

git apply --check 1125024-remoteschema8x-1.patch 
error: includes/common.inc: No such file or directory
error: includes/database/schema.inc: No such file or directory

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

arunkumark’s picture

Status: Needs work » Needs review
StatusFileSize
new1.39 KB

Hi,

I have re-rolled the patch for latest Drupal 8.x.3 version.

Status: Needs review » Needs work

The last submitted patch, 13: Enabling-Schema-API-1125024-13.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new679 bytes
new1.9 KB
  • Added missing use statement.
  • Removed redundant @file.
  • Added missing @return.
arunkumark’s picture

Status: Needs review » Reviewed & tested by the community

Patch Working fine!

@Jo Fitzgerald thanks for re-rolled

jofitz’s picture

Status: Reviewed & tested by the community » Needs review

@arunkumark Setting back to Needs Review because you (and I) cannot review and set to RTBC because we have contributed patches. We need someone else to review it.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

So after 6 years and the change from D9 + D10 can someone confirm this is still an issue please?
Tagging for IS update as again after 6 years the solution may change.

daffie’s picture

Status: Needs work » Closed (outdated)

Closing this issue as outdated. You can create a connection to an external database and use the Schema API in the same way as you can do with the internal database.