Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Convex.Schema.Parser
Synopsis
- parseSchema :: String -> IO (Either ParseError ParsedFile)
- data ParsedFile = ParsedFile {}
- newtype Schema = Schema {}
- data Table = Table {
- tableName :: String
- tableFields :: [Field]
- tableIndexes :: [Index]
- data Index = Index {
- indexName :: String
- indexFields :: [String]
- data Field = Field {}
- data ConvexType
- = VString
- | VNumber
- | VInt64
- | VFloat64
- | VBoolean
- | VBytes
- | VNull
- | VAny
- | VId String
- | VArray ConvexType
- | VObject [(String, ConvexType)]
- | VOptional ConvexType
- | VUnion [ConvexType]
- | VLiteral String
- | VReference String
- | VVoid
- data ParserState = ParserState {}
- initialState :: ParserState
- getLiteralString :: ConvexType -> String
- isLiteral :: ConvexType -> Bool
- sanitizeUnionValues :: String -> String
Documentation
parseSchema :: String -> IO (Either ParseError ParsedFile) Source #
data ParsedFile Source #
Constructors
ParsedFile | |
Fields |
Instances
Show ParsedFile Source # | |
Defined in Convex.Schema.Parser Methods showsPrec :: Int -> ParsedFile -> ShowS # show :: ParsedFile -> String # showList :: [ParsedFile] -> ShowS # | |
Eq ParsedFile Source # | |
Defined in Convex.Schema.Parser |
Constructors
Table | |
Fields
|
Constructors
Index | |
Fields
|
Constructors
Field | |
Fields
|
data ConvexType Source #
Constructors
VString | |
VNumber | |
VInt64 | |
VFloat64 | |
VBoolean | |
VBytes | |
VNull | |
VAny | |
VId String | |
VArray ConvexType | |
VObject [(String, ConvexType)] | |
VOptional ConvexType | |
VUnion [ConvexType] | |
VLiteral String | |
VReference String | |
VVoid |
Instances
Show ConvexType Source # | |
Defined in Convex.Schema.Parser Methods showsPrec :: Int -> ConvexType -> ShowS # show :: ConvexType -> String # showList :: [ConvexType] -> ShowS # | |
Eq ConvexType Source # | |
Defined in Convex.Schema.Parser | |
Ord ConvexType Source # | |
Defined in Convex.Schema.Parser Methods compare :: ConvexType -> ConvexType -> Ordering # (<) :: ConvexType -> ConvexType -> Bool # (<=) :: ConvexType -> ConvexType -> Bool # (>) :: ConvexType -> ConvexType -> Bool # (>=) :: ConvexType -> ConvexType -> Bool # max :: ConvexType -> ConvexType -> ConvexType # min :: ConvexType -> ConvexType -> ConvexType # |
data ParserState Source #
Constructors
ParserState | |
Fields |
Instances
Show ParserState Source # | |
Defined in Convex.Schema.Parser Methods showsPrec :: Int -> ParserState -> ShowS # show :: ParserState -> String # showList :: [ParserState] -> ShowS # | |
Eq ParserState Source # | |
Defined in Convex.Schema.Parser |
getLiteralString :: ConvexType -> String Source #
isLiteral :: ConvexType -> Bool Source #
sanitizeUnionValues :: String -> String Source #
Sanitizes union literals. It might be that a union like this is defined: export const instruction_mime_type = v.union( v.literal("application/pdf"), v.literal("text/html"), v.literal("text/plain") );
And `applicationpdf` would be translated into a type `Applicationpdf`, which
is invalid in most languages. After sanitization, it would become application_pdf
.