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

UUIDs - Advice needed #147

Open
PleiadesAustralia opened this issue Jul 2, 2018 · 6 comments
Open

UUIDs - Advice needed #147

PleiadesAustralia opened this issue Jul 2, 2018 · 6 comments

Comments

@PleiadesAustralia
Copy link

Hello,

I am tearing my hair out with UUIDs. In creating append queries to the database it will usually work to simply add a unique integer value in these feels which then automatically convert to a UUID. However, when trying to debug and manually entering a record this approach doesn't work and I am unable to enter record manually. Why are UUIDs there? They seem to add little value while making things difficult. How should I work with these fields?

Regards,
Sam

@horsburgh
Copy link
Member

Sam - we used UUIDs for a small number of things in ODM2 because we wanted those identifiers to be unique regardless of where they went. For example, if we had several ODM2 database instances from which metadata were being harvested for cataloging, we wanted the identifiers for things like SamplingFeatures to be the same in the database instance and in the catalog. This would help in disambiguating where multiple users (e.g., multiple database instances) may have use the same codes or names for different objects, which can happen.

Which RDBMS are you using, and how are you trying to insert data? Generally speaking - I've used a function in Python to generate UUIDs to insert them into ODM2 instances in SQLite, and I've used similar functions available in MySQL and SQL Server. Let us know a little more about what you've tried and we may be able to help more.

@emiliom
Copy link
Member

emiliom commented Jul 6, 2018

FYI, in PostgreSQL (9.3, I think) I've used built-in uuid functionality, with this scheme:

md5(random()::text || clock_timestamp()::text)::uuid

@PleiadesAustralia
Copy link
Author

PleiadesAustralia commented Jul 7, 2018 via email

@emiliom
Copy link
Member

emiliom commented Jul 9, 2018

@PleiadesAustralia are you deploying ODM2 on MS Access? Note that none of us has tried that. We've committed to supporting 4 RDBMS platforms (SQL Server, PostgreSQL, MySQL and SQLite), and the software ecosystem we've developed is generally tested on those 4 (eg, see https://github.com/ODM2/odm2-software-ecosystem) -- though it's not always possible to test all 4 for all software. However, with MS Access, you're pretty much on your own.

@PleiadesAustralia
Copy link
Author

PleiadesAustralia commented Jul 9, 2018 via email

@emiliom
Copy link
Member

emiliom commented Jul 9, 2018

SQL Server - feeding data in from an access data capture module.

👍

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

No branches or pull requests

3 participants