-- Copyright   :  Daan Leijen (c) 1999, daan@cs.uu.nl
--                HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
-- License     :  BSD-style

module Opaleye.Internal.HaskellDB.Sql.Generate (SqlGenerator(..)) where

import Opaleye.Internal.HaskellDB.PrimQuery
import Opaleye.Internal.HaskellDB.Sql

import qualified Data.List.NonEmpty as NEL

data SqlGenerator = SqlGenerator
    {
     SqlGenerator -> SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate
sqlUpdate      :: SqlTable -> [PrimExpr] -> Assoc -> SqlUpdate,
     SqlGenerator -> SqlTable -> [PrimExpr] -> SqlDelete
sqlDelete      :: SqlTable -> [PrimExpr] -> SqlDelete,
     SqlGenerator
-> SqlTable
-> [Attribute]
-> NonEmpty [PrimExpr]
-> Maybe OnConflict
-> SqlInsert
sqlInsert      :: SqlTable -> [Attribute] -> NEL.NonEmpty [PrimExpr] -> Maybe OnConflict -> SqlInsert,
     SqlGenerator -> PrimExpr -> SqlExpr
sqlExpr        :: PrimExpr -> SqlExpr,
     SqlGenerator -> Literal -> Attribute
sqlLiteral     :: Literal -> String,
     -- | Turn a string into a quoted string. Quote characters
     -- and any escaping are handled by this function.
     SqlGenerator -> Attribute -> Attribute
sqlQuote       :: String -> String
    }