@@ -139,6 +139,14 @@ data QualifiedIdentifier = QualifiedIdentifier (Maybe ByteString) ByteString
139instance Hashable QualifiedIdentifier where
139instance Hashable QualifiedIdentifier where
140 hashWithSalt i (QualifiedIdentifier q t) = hashWithSalt i (q, t)
140 hashWithSalt i (QualifiedIdentifier q t) = hashWithSalt i (q, t)
142+instance IsString QualifiedIdentifier where
143+ fromString str = let (x,y) = B.break (== 46)
145+ . Utf8.fromString $ str
147+ then QualifiedIdentifier Nothing x
148+ else QualifiedIdentifier (Just x) (B.tail y)
142-- | Wrap a list for use as a PostgreSQL array.
150-- | Wrap a list for use as a PostgreSQL array.
143newtype PGArray a = PGArray {fromPGArray :: [a]}
151newtype PGArray a = PGArray {fromPGArray :: [a]}
144 deriving (Eq, Ord, Read, Show, Typeable, Functor)
152 deriving (Eq, Ord, Read, Show, Typeable, Functor)