Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

MySQL-specific SQL in management commands #231

Open
dcloud opened this issue Aug 26, 2015 · 2 comments
Open

MySQL-specific SQL in management commands #231

dcloud opened this issue Aug 26, 2015 · 2 comments

Comments

@dcloud
Copy link

dcloud commented Aug 26, 2015

MySQL-specific syntax and settings are used in loadcalaccesscampaignfilings and flushcalaccesscampaignbrowser management commands. The following settings variables are specific to MySQL and so throw a syntax error on other database systems.

  • SQL_NOTES
  • FOREIGN_KEY_CHECKS

The SQL queries should only be executed on MySQL.

Additionally, the TRUNCATE command in PostgreSQL would require the CASCADE option and double quotes rather than backticks.

So there are some MySQL dependency issues…

@palewire
Copy link
Owner

palewire commented Sep 1, 2015

You've put your finger on the bleeding edge of our project. While the raw-data app has been massaged to support both MySQL and PostgreSQL, this app currently only works with the former.

The SQL queries you were inspecting are all incomplete. They are only beginnings of our effort to transform, clean and filter the source data into bulk data files the average hacker can grip and rip. It's all alpha and needs exactly the kind of work you're pointing out.

@dcloud
Copy link
Author

dcloud commented Sep 1, 2015

I completely understand! I wanted to make note of this since I ran across it and it seemed like a group of issues around SQL copy commands could indicate some tooling for SQL operations might be in order.

I'm spending some time looking into how the various database drives (mysqlclient, psycopg2) might be used to ameliorate the situations where you want to perform interactions closer to the database than the ORM level.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants