IreneKnapp/direct-sqlite — pull request #14 by joeyadams (2012-08-24 20:32:47+00:00)
Title: Should we use Text instead of String in the API?

This commit replaces all usage of `String` in Database.SQLite3 with `Text`. We were already using `Text` to marshal SQLite3 `TEXT` data. This commit uses `Text` instead of `String` for the following:

* File path passed to `open`

* Query strings passed to `exec` and `prepare`

* Name returned by `bindParameterName`

* Error details stored in the `SQLError`

But do we want to do this?

Pro:

* [sqlite-simple][1] and [persistent-sqlite][2] already use `Text`, so this would be less conversion for them (and for us, too).

Con:

* It's a little less convenient. Users will have to use `OverloadedStrings` (or use [pack][3] everywhere).

* Users who want more direct conversion can use functions in `.Direct` instead.

* Fusion might eliminate most or all of the overhead of using `String`.

An alternative proposal would be to make a `Database.SQLite3.Text` module. On the other hand, we don't want to put too much code on top of our package, as it's also carrying the `sqlite3.c` amalgamation.

Thoughts?

[1]: http://hackage.haskell.org/package/sqlite-simple
[2]: http://hackage.haskell.org/package/persistent-sqlite
[3]: http://hackage.haskell.org/packages/archive/text/latest/doc/html/Data-Text.html#v:pack