Include Postgres + Fay scaffolding

This commit is contained in:
Michael Snoyman 2013-02-19 08:00:14 +02:00
parent 789cd18b6c
commit a0dd09c2e1
4 changed files with 5955 additions and 1 deletions

View File

@ -25,7 +25,12 @@ prompt f = do
hFlush stdout
prompt f
data Backend = Sqlite | Postgresql | Mysql | MongoDB | Simple
data Backend = Sqlite
| Postgresql
| PostgresqlFay
| Mysql
| MongoDB
| Simple
deriving (Eq, Read, Show, Enum, Bounded)
puts :: LT.Text -> IO ()
@ -37,6 +42,7 @@ backends = [minBound .. maxBound]
showBackend :: Backend -> String
showBackend Sqlite = "s"
showBackend Postgresql = "p"
showBackend PostgresqlFay = "pf"
showBackend Mysql = "mysql"
showBackend MongoDB = "mongo"
showBackend Simple = "simple"
@ -47,6 +53,7 @@ readBackend s = lookup s $ map (showBackend &&& id) backends
backendBS :: Backend -> S.ByteString
backendBS Sqlite = $(embedFile "hsfiles/sqlite.hsfiles")
backendBS Postgresql = $(embedFile "hsfiles/postgres.hsfiles")
backendBS PostgresqlFay = $(embedFile "hsfiles/postgres-fay.hsfiles")
backendBS Mysql = $(embedFile "hsfiles/mysql.hsfiles")
backendBS MongoDB = $(embedFile "hsfiles/mongo.hsfiles")
backendBS Simple = $(embedFile "hsfiles/simple.hsfiles")

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ We recommend starting with SQLite: it has no dependencies.
s = sqlite
p = postgresql
pf = postgresql + Fay (experimental)
mongo = mongodb
mysql = MySQL
simple = no database, no auth

View File

@ -22,6 +22,7 @@ extra-source-files:
hsfiles/mongo.hsfiles
hsfiles/mysql.hsfiles
hsfiles/postgres.hsfiles
hsfiles/postgres-fay.hsfiles
hsfiles/simple.hsfiles
hsfiles/sqlite.hsfiles