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

Replacing UUID Requirement? #9

Open
autoreleasefool opened this issue Apr 7, 2024 · 2 comments
Open

Replacing UUID Requirement? #9

autoreleasefool opened this issue Apr 7, 2024 · 2 comments

Comments

@autoreleasefool
Copy link

I started investing Harmony for my project, which has a number of tables and pivot tables. The pivot tables have primary keys that are just the 2 UUIDs for each of the tables it connects. If I understand correctly, Harmony requires HRecord types have a UUID ID, which these pivot tables lack.

I suppose I could add a third column to this table, which would just be a UUID for the row itself, though it isn't technically necessary.

I took a brief shot at refactoring HRecord to use a generic ID that could be encoded/decoded from a String, but the type erasure I tried threw me off.

Do you think this is technically feasible? Is there a reason for the UUID requirement besides ease of implementation?

I don't mind taking a shot at implementation

@aehlke
Copy link

aehlke commented Jul 23, 2024

I don't have this fork of another iCloud sync project (SyncKit, for CoreData and Realm/RealmSwift; which I reduced to RealmSwift only) https://github.com/lake-of-fire/BigSyncKit but I have the ID part working well, you can see this as an example reference implementation if you like. See things around recordName. You can use UUID or other types flexibly - I like having a compound string ID that I generate, for instance.

@aaronpearce
Copy link
Owner

There is no technical reason that UUID are required. It was just a specific implementation I was already doing. It could be generalised down to anything that can be converted a CloudKit ID.

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