Detecting schema version of database created with different ORM

If a database was originally created and migrated several times with Core Data, is there a way for GRDB to determine the current schema version, in order to run migrations starting at the appropriate version?

Hello @naftalibeder,

This is more a question about Core Data than about GRDB, and you'll have better chances getting an answer on Stack Overflow, or straight from the doc.

@gwendal.roue Thank you for the reply!

A big part of what I'm looking for is if, given an arbitrary sqlite database file, there's a way to programmatically analyze with GRDB it to determine the schema.

In other words, if I know where the current schema version is stored, how can I direct GRDP to that information and use it during migration? (Where this is in a Core Data-managed database is a separate matter, I agree.)

I've looked through the documentation and haven't been able to find this.

Let me find the documentation for you.

SQLite exposes the schema in The Schema Table.

GRDB adds a few convenience methods on top: Database Schema Introspection.

This is exactly what I was looking for. Thank you!

Terms of Service

Privacy Policy

Cookie Policy