Skip to content

Conversation

Jnosh
Copy link
Collaborator

@Jnosh Jnosh commented Oct 12, 2024

DatabaseMigrator.hasSchemaChanges currently fails for readonly database configurations. This wasn't an issue before since the migrator needed write access to perform migrations anyway.

With the introduction of hasSchemaChanges this becomes an issue when:

  • one tries to use it with a readonly database
  • using DatabasePool.read which always uses a readonly connection even when the DB is opened as writeable

This PR fixes that issue by adjusting the database configuration used by the migrator to create the temporary database in hasSchemaChanges.


  • CONTRIBUTING: You have read https://github.com/groue/GRDB.swift/blob/master/CONTRIBUTING.md
  • BRANCH: This pull request is submitted against the development branch.
  • DOCUMENTATION: Inline documentation has been updated.
  • DOCUMENTATION: README.md or another dedicated guide has been updated.
  • TESTS: Changes are tested.
  • TESTS: The make smokeTest terminal command runs without failure.

@Jnosh Jnosh force-pushed the schema-changes-readonly branch from f5c9459 to a741fb3 Compare October 12, 2024 16:36
@groue
Copy link
Owner

groue commented Oct 12, 2024

Thanks @Jnosh for this quality PR! 👍 I should be able to merge tomorrow.

@groue groue merged commit 8aaeb25 into groue:development Oct 13, 2024
@Jnosh Jnosh deleted the schema-changes-readonly branch October 13, 2024 09:32
@groue
Copy link
Owner

groue commented Oct 13, 2024

⛵ Shipped in v7.0.0-beta.5 :-)

Would you accept an invitation that grants you a push access to GRDB? I do intend to keep the lead of the project, but it is good for everyone that people of various levels of expertise can improve the repository. Of course, your free time would remain just as free as it was before!

@groue groue added the bug label Oct 13, 2024
@Jnosh
Copy link
Collaborator Author

Jnosh commented Oct 13, 2024

Would you accept an invitation that grants you a push access to GRDB? I do intend to keep the lead of the project, but it is good for everyone that people of various levels of expertise can improve the repository. Of course, your free time would remain just as free as it was before!

Sure, I'd be honored to accept! <3

@groue
Copy link
Owner

groue commented Oct 14, 2024

Woot! Done. Be welcome, @Jnosh :-)

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

Successfully merging this pull request may close these issues.

2 participants