extractor

Types

pub type AccessInfo {
  AccessInfo(name: String, path: String, raw_string: String)
}

Constructors

  • AccessInfo(name: String, path: String, raw_string: String)
pub type ExtractorResult {
  ExtractorResult(
    tables: dict.Dict(String, TableInfo),
    accesses: dict.Dict(String, AccessInfo),
  )
}

Constructors

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

Constructors

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

Constructors

Values

pub fn complete_fields_dependencies(
  result: ExtractorResult,
) -> ExtractorResult

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(ExtractorResult, String)

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

✨ Search Document