Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- sqlToFile :: RenderSql a b => b -> a -> FilePath -> IO ()
- sqlToFileCollapsed :: RenderSql a b => b -> a -> FilePath -> IO ()
- printSql :: RenderSql a b => b -> a -> IO ()
- renderSql' :: RenderSql a b => b -> a -> String
- renderSqlWith :: RenderSql a b => Style -> b -> a -> String
- renderSqlCollapsed :: RenderSql a b => b -> a -> String
- styleCollapsed :: Style
- class RenderSql a backend where
- class CommandDescr a backend where
- commandDescr :: backend -> a -> String
- data RenderedSql = forall a backend.RenderSql a backend => RenderedSql backend a
- unpackRenderedSql :: RenderedSql -> String
- class ReplaceReference backend where
Documentation
sqlToFile :: RenderSql a b => b -> a -> FilePath -> IO () #
Render to a local SQL file, mainly for debugging/devel help.
sqlToFileCollapsed :: RenderSql a b => b -> a -> FilePath -> IO () #
renderSql' :: RenderSql a b => b -> a -> String #
renderSqlWith :: RenderSql a b => Style -> b -> a -> String #
renderSqlCollapsed :: RenderSql a b => b -> a -> String #
styleCollapsed :: Style #
class RenderSql a backend where #
If one day we support multiple backends, one option would be for this typeclass to take a (Proxy backend) argument to dispatch on the right backend.
Instances
class CommandDescr a backend where #
commandDescr :: backend -> a -> String #
Instances
data RenderedSql #
forall a backend.RenderSql a backend => RenderedSql backend a |
unpackRenderedSql :: RenderedSql -> String #
class ReplaceReference backend where #
Ability to hackishly replace references to a given table within a SQL string blob. Enables namespacing and we wouldn't need it if we could comprehensively parse each backend's SQL.
Nothing
Instances
ReplaceReference Sqlite # | Reference replacement |
ReplaceReference Redshift # | Reference replacement |
ReplaceReference Postgres # | Reference replacement |
ReplaceReference BigQuery # | Reference replacement |