persistent-postgresql 2.1.1 → 2.1.2
raw patch · 2 files changed
+20/−1 lines, 2 files
Files
Database/Persist/Postgresql.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE Rank2Types #-} -- | A postgresql backend for persistent. module Database.Persist.Postgresql@@ -15,6 +16,8 @@ , ConnectionString , PostgresConf (..) , openSimpleConn+ , tableName+ , fieldName ) where import Database.Persist.Sql@@ -830,6 +833,22 @@ , " DROP CONSTRAINT " , escape cname ]++-- | get the SQL string for the table that a PeristEntity represents+-- Useful for raw SQL queries+tableName :: forall record.+ ( PersistEntity record+ , PersistEntityBackend record ~ SqlBackend+ ) => record -> Text+tableName = escape . tableDBName++-- | get the SQL string for the field that an EntityField represents+-- Useful for raw SQL queries+fieldName :: forall record typ.+ ( PersistEntity record+ , PersistEntityBackend record ~ SqlBackend+ ) => EntityField record typ -> Text+fieldName = escape . fieldDBName escape :: DBName -> Text escape (DBName s) =
persistent-postgresql.cabal view
@@ -1,5 +1,5 @@ name: persistent-postgresql-version: 2.1.1+version: 2.1.2 license: MIT license-file: LICENSE author: Felipe Lessa, Michael Snoyman <michael@snoyman.com>