packages feed

ihp-schema-compiler-1.5.0: IHP/SchemaCompiler/Parser.hs

{-|
Module: IHP.SchemaCompiler.Parser
Description: IHP-specific schema file utilities
Copyright: (c) digitally induced GmbH, 2020
-}
module IHP.SchemaCompiler.Parser
( parseSchemaSql
, schemaFilePath
) where

import IHP.Prelude
import IHP.Postgres.Parser (parseSqlFile)
import IHP.Postgres.Types (Statement)

-- | Path to the IHP schema file
schemaFilePath :: OsPath
schemaFilePath = "Application/Schema.sql"

-- | Parse the IHP schema file at 'Application/Schema.sql'
parseSchemaSql :: IO (Either ByteString [Statement])
parseSchemaSql = parseSqlFile schemaFilePath