extractor

Types

pub type TableField {
  TableField(
    dependencies: List(String),
    name: String,
    type_: surreal_type.SurrealType,
    linked_enum: option.Option(String),
    object_fields: List(TableField),
  )
}

Constructors

pub type TableInfo {
  TableInfo(
    name: common.IdentifierCase,
    path: String,
    fields: List(TableField),
    enums: List(#(String, List(String))),
    delegated: option.Option(node.Node),
  )
}

Constructors

Values

pub fn complete_fields_dependencies(
  tables: dict.Dict(String, TableInfo),
) -> dict.Dict(String, TableInfo)

Complete the dependencies of the fields for each table. This will sort the dependencies in alphabetical order and add the missing dependencies for identifiers and records.

pub fn extract_tables(
  path: String,
  nodes: List(node.Node),
) -> Result(dict.Dict(String, TableInfo), String)

Extract the table info from an AST (list of nodes).

✨ Search Document