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

No error when opening a jpg as a database #54

Closed
mtissington opened this issue May 19, 2016 · 13 comments
Closed

No error when opening a jpg as a database #54

mtissington opened this issue May 19, 2016 · 13 comments

Comments

@mtissington
Copy link

mtissington commented May 19, 2016

I attempt to open a jpg file as a database and do not get any error. This must be wrong?
url is pointing to a .jpg file

`var config: Configuration = Configuration()

    config.trace = { print($0) }
    config.readonly = true

    let dbQueue = try! DatabaseQueue(path: url.path!, configuration: config)`
@groue
Copy link
Owner

groue commented May 19, 2016

Hello @mtissington

I think that SQLite won't complain until database is actually accessed. I know that this is the case for encrypted databases: SQLite won't notice any error, for example a wrong passphrase, until the database is accessed.

So that the user gets an early error when the passphrase is not correct, GRDB does an early check. It does this check only for encrypted databases.

Maybe we could do it for regular databases, too.

@mtissington
Copy link
Author

or set it as an option parameter in the configuration to check db?

@groue
Copy link
Owner

groue commented May 19, 2016

Do you see a reason to want to avoid the check?

@mtissington
Copy link
Author

Hmm, maybe efficiency?

@groue
Copy link
Owner

groue commented May 19, 2016

Hmm, maybe efficiency?

Not really relevant here: we don't open databases that often.

OK, let's perform the check for all databases.

groue added a commit that referenced this issue May 19, 2016
groue added a commit that referenced this issue May 19, 2016
@groue
Copy link
Owner

groue commented May 19, 2016

GRDB v0.65.0 is out: it fixes this issue.

@groue groue closed this as completed May 19, 2016
@groue
Copy link
Owner

groue commented May 19, 2016

Thanks for the report.

@mtissington
Copy link
Author

thanks - how long before cocoapods picks this up?

@groue
Copy link
Owner

groue commented May 19, 2016

A couple of seconds?

@mtissington
Copy link
Author

strange it seems to be stuck with .62

@groue
Copy link
Owner

groue commented May 19, 2016

v0.65.0 has been pushed: https://cocoapods.org/pods/GRDB.swift.

@mtissington
Copy link
Author

very strange the latest i can install is .62

@mtissington
Copy link
Author

i see i need to do a pod repo update now ...

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

No branches or pull requests

2 participants