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

Support for multiple configurations #1

Open
marwey opened this issue Feb 20, 2024 · 6 comments
Open

Support for multiple configurations #1

marwey opened this issue Feb 20, 2024 · 6 comments

Comments

@marwey
Copy link

marwey commented Feb 20, 2024

Hi, will this extension library also work for the case that the SwiftData ModelContainer is created with multiple configurations? I saw test cases implemented using only one configuration?

@fatbobman
Copy link
Owner

@marwey Theoretically, it is feasible, but currently, SwiftData has a bug where only the first configuration works, making it impossible to implement multiple stores within one container, similar to Core Data.

@marwey
Copy link
Author

marwey commented Feb 20, 2024

@fatbobman Thanks for the heads up! Yes, looks like this part is buggy. The funny thing is, when I peek into my modelContext with the debugger I can see the data of both of my configurations?

@fatbobman
Copy link
Owner

@marwey Yes, This is a very interesting bug.
SwiftData creates a corresponding SQLite file for each configuration, but it only loads the first configuration (corresponding to NSPersistentStoreDescription in Core Data).

I mentioned it in my twitter
https://twitter.com/fatbobman/status/1741820272964251751

@marwey
Copy link
Author

marwey commented Feb 20, 2024

@fatbobman Yes, that is inline with what I see in my code. And it's actually independent from your library.

Will file a bug report with them and see if I can work around this in my app.

@marwey
Copy link
Author

marwey commented Apr 2, 2024

@fatbobman It seems Apple has fixed the above bug. At least the sample I attached to my bug report works in macOS 14.4.

@fatbobman
Copy link
Owner

@marwey Thanks, I just test it , Yes, It works finally!

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

2 participants