Added support for explicit ":memory:" database path. #117

Open
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

dodikk commented Jan 22, 2013

The user will be able to pass ":memory:" database path explicitly
EmbeddedSources/fmdb@a34f2fd

Owner

ccgus commented Jan 31, 2013

I'm not sure an explicit :memory: method is needed- what's wrong with the current method? Is there something I'm missing? And I'm not sure a new classes for errors is needed either. I don't want to add anything that isn't needed.

Contributor

dodikk commented Feb 1, 2013

I'm not sure an explicit :memory: method is needed- what's wrong with the current method?

Well, users of libSqlite.a are used to explicit ":memory:" constant usage. I had some issues in my prototype and was not sure whether [ @":memory:" fileSystemRepresentation ] left it as is.
Anyway, this explicit check makes the code more clear and you no longer depend on "fileSystemRepresentation" API that may be changed by Apple.

And I'm not sure a new classes for errors is needed either.

This will make easier to handle errors in the application code. Sometimes you need to replace the low level error message with some more user friendly one.
In other words, you no more write |if ( [ error_.domain isEqualToString: @"FMDatabase" ] )| to achieve this. Instead you write a categories for your custom error classes. |@interface FMError( UserFriendlyError )|

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