IreneKnapp / direct-sqlite

MIT License
35 stars 54 forks source link

Add URI filename support #41

Closed sethfowler closed 10 years ago

sethfowler commented 10 years ago

This patch adds support for URI filenames. (And defaults them to on.)

I wish this was a bit cleaner to express in cabal syntax...

sethfowler commented 10 years ago

Issue #40 made me realize that I needed to take some action to be consistent with the interaction of the "systemlib" and "fulltextsearch" flags. It seemed more logical to me to simply ignore these kinds of flags if "systemlib" is specified.

nurpax commented 10 years ago

What's the reason for making URI filenames the default? The commit message doesn't say why the SQLite default build options are changed. Doesn't seem like we'll lose anything by changing this though, this seems to be mostly backwards compatible with old behavior as people don't name their files beginning with "file:".

Perhaps at least add a link to http://www.sqlite.org/uri.html?

sethfowler commented 10 years ago

Well, the general answer is that URI filenames are convenient in some situations and don't seem to have any significant downsides. My interest in them was originally triggered by in-memory databases, though. From the SQLite docs:

In-memory databases are allowed to use shared cache if they are opened using a
URI filename. If the unadorned ":memory:" name is used to specify the in-memory
database, then that database always has a private cache and is this only visible
to the database connection that originally opened it.

I'd add that link, but so far as I can see cabal descriptions don't support links or any kind of hypertext. Googling for "sqlite uri filename" gives that page as the first hit, though. If you'd prefer I can add the link to the description as raw text, but it would be the first such link, so I hesitated.

sethfowler commented 10 years ago

Also, to my knowledge there's no way to specify flags for dependencies in a cabal file, so it's better to be inclusive in what's installed by default. Otherwise any downstream package foo that relies on direct-sqlite can no longer be installed using cabal install foo if they use one of the flagged features. They'd have to give directions to install direct-sqlite with a specific combinations of flags, which increases friction for end users.

nurpax commented 10 years ago

Agreed, sounds good. I meant adding a link to the commit message, so that the history would've mentioned some reasoning for this.

sethfowler commented 10 years ago

Ah, I misunderstood! =) I'll add a link to the commit message.

sethfowler commented 10 years ago

@IreneKnapp ping? =)

IreneKnapp commented 10 years ago

Ah! My apologies - I missed this entire conversation, somehow. I have read it, agree with the changes, and will do a release to Hackage in a few minutes. Seth, thank you for the hard work; Janne, thank you for saying what I would have said, but much more promptly! :)

sethfowler commented 10 years ago

Great! Thanks for the review.