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

Create way to easily bulk-insert resources into our database (CTE?) #36

Open
VirtualDOMinic opened this issue Sep 19, 2018 · 1 comment
Assignees

Comments

@VirtualDOMinic
Copy link
Contributor

VirtualDOMinic commented Sep 19, 2018

Had a look into this last night but didn't have enough time to figure it out, sadly!

We want to be able to generate INSERT INTO queries that allow us to:

  • Insert a resource with all its relevant info
  • Get the resource_id of the newly-inserted object
  • Use this resource_id and the direct and indirect tags to insert into our linking table (demographic_resource_link)

The above should be a single, multi-part transaction/query for each resource, I believe!

Possible useful resources:

Hope they help! Definitely overkill to look at all of them, and I'm sure Aisha will have some useful insight, if/when she's in.

@sbinlondon
Copy link
Collaborator

Initial CTE query created.

Possibly can combine with a JS script to bulk add resources.

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

No branches or pull requests

3 participants