Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove defensive pre-fixing of column headers with MySQL reserved words #4284

Open
1 of 4 tasks
swirtSJW opened this issue Sep 12, 2024 · 0 comments
Open
1 of 4 tasks
Assignees
Labels
Component: Datastore feature request Good First Issue good issues for first time contributors

Comments

@swirtSJW
Copy link
Contributor

Feature Description

This section of code prefixes any MySQL reserved words like 'condition' so that it becomes '_condition'

This is even more apparent when switching from the Chunk importer to the MySQL importer because it causes data properties to change.
MySQL importer results on left, Chunk Importer results on right
image

There is a note in the code that this can be dropped once Drupal 9 goes away.

Detailed Feature Description

Clean up queries to use []. https://www.drupal.org/node/2986894 so that this prefixing of certain properties can be dropped.
This however would be a breaking change for any consumers of the API.... so I don't know how to reconcile that, unless it is an option that defaults to the prefixes way?

Problem and Motivation

Ideally we don't want DKAN to be opinionated about what data column names / properties are. We want properties to be driven by the datasource.

Potential Benefits

Users will not have data shifts if they switch from the Chunk importer to MySQL importer, or vice versa.
DKAN will not introduce changes to data properties

Target Audience

  • End Users
  • Developers
  • Administrators
  • Other

Possible Implementation

  • Leave the current code as the default??
  • Adjust queries to use [] https://www.drupal.org/node/2986894
  • Put the ability in the UI to opt out of the prefixing. That way individual sites can decide whether they want to make a breaking change for their data consumers.

Additional Context

This came up for CMS:PDC

@dafeder dafeder self-assigned this Dec 17, 2024
@dafeder dafeder added Component: Datastore Good First Issue good issues for first time contributors labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Datastore feature request Good First Issue good issues for first time contributors
Projects
None yet
Development

No branches or pull requests

2 participants