Closed nurpax closed 11 years ago
I see your point. System.FilePath uses FilePath
(a type alias for String
) for working with file names. getArgs and getOpt return Strings. Those using direct-sqlite (rather than a higher-level library) will almost always have to call Text.pack to use open
, unless the database path is hard-coded.
I asked a similar question in pull request #14. But why not do the same for exec
and bindParameterName
? Or why not go all the way and use String
for bindText
, too? We could have a separate Direct.SQLite3.Text
module with text versions of these functions.
In any case, there's always Database.SQLite3.Direct
for users who want to avoid conversions.
It's hard to decide where to draw the line. I opened this pull request just for discussion. Since the version with open :: Text -> IO Connection was already released, it's probably not worth trying to change this anymore.
I'll close - I don't think this is worth the trouble anymore.
Most operations on filenames in Haskell libraries are using Strings instead of Text, so use String for "open".
I realize this is debatable but pushing the change anyway. Performance-wise this shouldn't matter. It's a question of consistency: whether to be consistent with other APIs that operate on filenames or to be consistent within direct-sqlite and the decision to use Text for everything.