yumemi/gen/model

生成器の内部モデル。★ から読み取った事実だけを持ち、出力の判断は emit 側に置く。

Types

pub type Admit {
  AnonymousAdmit
  AuthenticatedAdmit
}

Constructors

  • AnonymousAdmit
  • AuthenticatedAdmit
pub type Agg {
  ACount
  ASum(String)
  AMin(String)
  AMax(String)
  AAvg(String)
}

Constructors

  • ACount
  • ASum(String)
  • AMin(String)
  • AMax(String)
  • AAvg(String)
pub type Along {
  LDistance
  LRank
  LRunning(Agg)
}

Constructors

  • LDistance
  • LRank
  • LRunning(Agg)
pub type App {
  App(
    value_types: List(ValueType),
    entities: List(Entity),
    collections: List(Collection),
    services: List(Service),
    arrows: List(Arrow),
    reverse_arrows: List(Arrow),
    clauses: List(#(String, List(Clause))),
    entries: List(Entry),
    attached: List(AttachedRoute),
    server: Server,
    handwritten_verbs: List(#(String, List(String))),
    manual_verbs: List(#(String, List(String))),
  )
}

Constructors

  • App(
      value_types: List(ValueType),
      entities: List(Entity),
      collections: List(Collection),
      services: List(Service),
      arrows: List(Arrow),
      reverse_arrows: List(Arrow),
      clauses: List(#(String, List(Clause))),
      entries: List(Entry),
      attached: List(AttachedRoute),
      server: Server,
      handwritten_verbs: List(#(String, List(String))),
      manual_verbs: List(#(String, List(String))),
    )

    Arguments

    reverse_arrows

    with: に書かれた Held の逆向き(親 -> 子)。arrows には混ぜない ── join / Has / root の矢印 read は順向きだけを見る。

    clauses

    Service ごとの allow 句(module 名 -> 句)。

    server

    src/server.gleam の宣言(HTTP の上書き・別名・cron・DO・hook)。

    handwritten_verbs

    Entity / ER 外 module の手書き verb 名。header と警告に使う。

    manual_verbs

    ER 外 module の manual_verbs。header に載せ、警告は出さない。

pub type Arg {
  Arg(name: String, type_: TypeShape)
}

Constructors

矢印。関係 Property 1つにつき1本。

pub type Arrow {
  Arrow(
    name: String,
    from_entity: String,
    prop: String,
    target_entity: String,
    kind: RelKind,
    optional: Bool,
  )
}

Constructors

  • Arrow(
      name: String,
      from_entity: String,
      prop: String,
      target_entity: String,
      kind: RelKind,
      optional: Bool,
    )

    Arguments

    name

    “ArticleToMuse”

src/server.gleam の attached_roles の 1 行(WGy r4、0.12)。role は framework の JS の綴り (declare / needs_declared / read_session / switch_subject / tail_path)、kind は申告の種類(他の役は “”)。

pub type AttachedRole {
  AttachedRole(attached: String, role: String, kind: String)
}

Constructors

  • AttachedRole(attached: String, role: String, kind: String)

Service でない HTTP の口。src/server.gleam の attached から読む(WGy ── 生成器は http_runtime.mjs を読まない)。name は PascalCase、who は “anyone” / “party”。

pub type AttachedRoute {
  AttachedRoute(
    name: String,
    method: String,
    path: String,
    who: String,
  )
}

Constructors

  • AttachedRoute(
      name: String,
      method: String,
      path: String,
      who: String,
    )

値型(types.gleam の pub const <name>: Spec)。

pub type Backing {
  StringValue
  IntValue
}

Constructors

  • StringValue
  • IntValue

src/server.gleam の browser(WGy r4、0.12)。

pub type BrowserCookie {
  BrowserCookie(
    cookie: String,
    key_binding: String,
    max_age_days: Int,
    declarations: List(Declaration),
  )
}

Constructors

  • BrowserCookie(
      cookie: String,
      key_binding: String,
      max_age_days: Int,
      declarations: List(Declaration),
    )

allow 句 1 つ。who / at / owner は構成子の名のまま持つ。

pub type Clause {
  Clause(who: String, at: ClauseAt, owner: String)
  UnreadClause(text: String)
}

Constructors

  • Clause(who: String, at: ClauseAt, owner: String)
  • UnreadClause(text: String)

    句が読めなかった(構成子でない式など)。読みへ allow 句を入れる時に exit 4。

pub type ClauseAt {
  AnyPhaseAt
  OnlyAt(List(String))
  UnreadAt(text: String)
}

Constructors

  • AnyPhaseAt
  • OnlyAt(List(String))

    Only([...]) の相の構成子名。

  • UnreadAt(text: String)

ER の外にある module が HTTP の集合名を名乗る宣言。

pub type Collection {
  Collection(
    module: String,
    collection: String,
    handwritten_verbs: List(String),
    manual_verbs: List(String),
  )
}

Constructors

  • Collection(
      module: String,
      collection: String,
      handwritten_verbs: List(String),
      manual_verbs: List(String),
    )

    Arguments

    module

    トップレベル module 名。ledger / metrics。

    collection

    入口での集合名。ledger_stores / metrics。

    handwritten_verbs

    生成せず、手書きの実体へ委ねる verb 名。

    manual_verbs

    生成候補を持たない手書き verb 名(manual_verbs)。

pub type Cond {
  CEq(String, Operand)
  CNe(String, Operand)
  CLt(String, Operand)
  CLe(String, Operand)
  CGt(String, Operand)
  CGe(String, Operand)
  CIn(String, Operand)
  CContains(String, Operand)
  CIsNull(String)
  CNotNull(String)
  CIsTrue(String)
  CEqOrNull(String, Operand)
  CCurrentVersion(String, String)
  CHas(String, List(Cond))
  CHasNone(String, List(Cond))
}

Constructors

server.connectors。口だけ ── 型は ★。

pub type Connector {
  Connector(name: String, ports: List(ConnectorPort))
}

Constructors

pub type ConnectorPort {
  CallPort(name: String, op: String)
  SendPort(name: String, op: String)
  EnqueuePort(name: String, kind: String)
  FetchPort(name: String, module: String, js: String, arity: Int)
  PurePort(name: String, module: String, js: String, arity: Int)
}

Constructors

  • CallPort(name: String, op: String)
  • SendPort(name: String, op: String)
  • EnqueuePort(name: String, kind: String)
  • FetchPort(name: String, module: String, js: String, arity: Int)
  • PurePort(name: String, module: String, js: String, arity: Int)

面の門の pageview(0.12)。face は面(= 入口)の名。

pub type Counted {
  Counted(
    face: String,
    only: List(GateWhen),
    fields: List(PageviewField),
    sink: PageviewSink,
  )
}

Constructors

src/entry.gleam の入口に宣言された認証媒体。

pub type Credential {
  SessionCredential
  ApiKeyCredential
}

Constructors

  • SessionCredential
  • ApiKeyCredential
pub type Cron {
  Cron(schedule: String, jobs: List(CronJob))
}

Constructors

  • Cron(schedule: String, jobs: List(CronJob))
pub type CronJob {
  EachDue(service: String, query: String)
  HookedJob(service: String, hook: String)
}

Constructors

  • EachDue(service: String, query: String)
  • HookedJob(service: String, hook: String)
pub type Declaration {
  Declaration(kind: String, claim: String, max_age_days: Int)
}

Constructors

  • Declaration(kind: String, claim: String, max_age_days: Int)
pub type DurableObject {
  DurableObject(
    class: String,
    module: String,
    adapter: String,
    methods: List(String),
  )
}

Constructors

  • DurableObject(
      class: String,
      module: String,
      adapter: String,
      methods: List(String),
    )
pub type Effect {
  ReadEffect
  WriteEffect
}

Constructors

  • ReadEffect
  • WriteEffect
pub type Entity {
  Entity(
    module: String,
    name: String,
    type_name: String,
    table: String,
    props: List(Prop),
    fields: List(FieldDef),
    verb_fields: List(FieldDef),
    phases: List(String),
    key_prop: String,
    key_column: String,
    key_props: List(String),
    key_columns: List(String),
    key_type: option.Option(TypeShape),
    path_key_type: option.Option(TypeShape),
    collection: String,
    subject: Bool,
    edges: List(#(String, String)),
    verbs: List(VerbRule),
    handwritten_verbs: List(String),
    manual_verbs: List(String),
    ordered_by: option.Option(OrderedBy),
    upsert_key: List(String),
    auto_key: List(String),
  )
}

Constructors

  • Entity(
      module: String,
      name: String,
      type_name: String,
      table: String,
      props: List(Prop),
      fields: List(FieldDef),
      verb_fields: List(FieldDef),
      phases: List(String),
      key_prop: String,
      key_column: String,
      key_props: List(String),
      key_columns: List(String),
      key_type: option.Option(TypeShape),
      path_key_type: option.Option(TypeShape),
      collection: String,
      subject: Bool,
      edges: List(#(String, String)),
      verbs: List(VerbRule),
      handwritten_verbs: List(String),
      manual_verbs: List(String),
      ordered_by: option.Option(OrderedBy),
      upsert_key: List(String),
      auto_key: List(String),
    )

    Arguments

    module

    module 名。“article” / “consent_version”

    name

    From / Field の接頭辞。module 名の PascalCase

    type_name

    レコード型の名。“Article” / “ConsentVersionRow”

    table

    表の名。module 名

    verb_fields

    verb SQL だけが使う補助列(例: Sealed の <prop>_key_id)。

    phases

    Lifecycle の相。無ければ空

    key_prop

    key 関数が返す Property の名。組なら先頭

    key_column

    key の列名

    key_props

    key 関数が返す Property の全て。複合 key を先頭列へ潰さない。

    key_columns

    key の列の全て。key_props と同じ順序。

    key_type

    key / path_key の戻り型。Service Args の照合に使う。

    path_key_type

    key が別にある Entity の path_key 戻り型。root はどちらも受ける。

    collection

    入口での集合名(★ の collection)

    edges

    Phase の遷移辺。無ければ空。

    verbs

    Entity に宣言された追加の verb 規則。

    handwritten_verbs

    生成せず、手書きの実体へ委ねる verb 名。

    manual_verbs

    生成候補を持たない手書き verb 名(manual_verbs)。候補と一致したら exit 4。

    ordered_by

    reorder の宣言。無ければ None。

    upsert_key

    put の鍵。無ければ空。

    auto_key

    create 時に実行側/DB が自動採番する key Property。明示が無ければ空。

pub type Entry {
  Entry(
    name: String,
    prefix: String,
    admit: Admit,
    subject: EntrySubjects,
    services: EntryServices,
    credential: Credential,
  )
}

Constructors

pub type EntryServices {
  ReadOnlyServices
  AllServices
}

Constructors

  • ReadOnlyServices
  • AllServices

入口が受ける subject の集合。型名は entry.gleam の構成子名をそのまま保持する。

pub type EntrySubjects {
  AnyEntrySubject
  NamedEntrySubjects(List(String))
}

Constructors

  • AnyEntrySubject
  • NamedEntrySubjects(List(String))
pub type FieldDef {
  FieldDef(
    name: String,
    entity_name: String,
    column: String,
    optional: Bool,
    repeated: Bool,
    value: FieldValue,
  )
}

Constructors

  • FieldDef(
      name: String,
      entity_name: String,
      column: String,
      optional: Bool,
      repeated: Bool,
      value: FieldValue,
    )

    Arguments

    name

    “ArticleMuse”

    entity_name

    “Article”

    column

    “muse_id”

列 1本。Field の variant 1つと SQL の 1列が同じものを指す。

pub type FieldValue {
  RelValue(target_module: String, target_type: String)
  TypeValue(type_ref: TypeRef)
  PhaseValue(module: String)
  DatetimeValue
}

Constructors

  • RelValue(target_module: String, target_type: String)
  • TypeValue(type_ref: TypeRef)
  • PhaseValue(module: String)
  • DatetimeValue

門の条件(WhenDeclared(kind) / WhenSignedIn)。

pub type GateWhen {
  WhenDeclared(kind: String)
  WhenSignedIn
}

Constructors

  • WhenDeclared(kind: String)
  • WhenSignedIn
pub type Group {
  GByField(String)
  GBucket(String, String)
  GVia(String)
}

Constructors

  • GByField(String)
  • GBucket(String, String)
  • GVia(String)
pub type Hook {
  Hook(name: String, module: String)
}

Constructors

  • Hook(name: String, module: String)
pub type Limit {
  LNoLimit
  LPaged(size: Operand, after: Operand)
  LFirst(Int)
  LFirstPerGroup(Int, Group)
}

Constructors

server.reads の 1 行(手書きの SQL の読み)。

pub type ManualRead {
  ManualRead(
    service: String,
    query: String,
    args: List(#(String, String)),
    returns: String,
    imports: List(String),
    hook: String,
  )
}

Constructors

  • ManualRead(
      service: String,
      query: String,
      args: List(#(String, String)),
      returns: String,
      imports: List(String),
      hook: String,
    )

src/server.gleam の media(0.12)。

pub type Media {
  Media(
    path: String,
    variants: List(MediaVariant),
    theme_background: String,
  )
}

Constructors

  • Media(
      path: String,
      variants: List(MediaVariant),
      theme_background: String,
    )
pub type MediaVariant {
  MediaVariant(
    name: String,
    width: Int,
    height: option.Option(Int),
    fit: String,
  )
}

Constructors

  • MediaVariant(
      name: String,
      width: Int,
      height: option.Option(Int),
      fit: String,
    )
pub type NamedQuery {
  NamedQuery(name: String, select: Select)
}

Constructors

  • NamedQuery(name: String, select: Select)

読みの語彙。構成子は yumemi/query.gleam と1対1(Pick は Select.columns に畳む)。

pub type Operand {
  OpParam(String)
  OpNum(Int)
  OpStr(String)
  OpAt(String)
  OpPhase(entity: String, variant: String)
  OpKey(entity: String)
  OpCol(String)
}

Constructors

  • OpParam(String)
  • OpNum(Int)
  • OpStr(String)
  • OpAt(String)
  • OpPhase(entity: String, variant: String)
  • OpKey(entity: String)
  • OpCol(String)
pub type Order {
  ONearest(String, Operand)
  OAsc(String)
  ODesc(String)
  OAscAgg(Agg)
  ODescAgg(Agg)
}

Constructors

  • ONearest(String, Operand)
  • OAsc(String)
  • ODesc(String)
  • OAscAgg(Agg)
  • ODescAgg(Agg)
pub type OrderedBy {
  OrderedBy(field: String, within: List(String))
}

Constructors

  • OrderedBy(field: String, within: List(String))
pub type PageviewField {
  NavKindField
  ClientAtField
  PathField
  PreviousField
  ReferrerField
  FromQueryField(name: String, param: String, max: Int)
}

Constructors

  • NavKindField
  • ClientAtField
  • PathField
  • PreviousField
  • ReferrerField
  • FromQueryField(name: String, param: String, max: Int)

    FromQuery(name, param, Slug(max))

pub type PageviewSink {
  StoreSink(
    resolve: option.Option(String),
    rollup_by: List(String),
    exclude_when: List(String),
  )
  ServiceSink(service: String)
}

Constructors

  • StoreSink(
      resolve: option.Option(String),
      rollup_by: List(String),
      exclude_when: List(String),
    )
  • ServiceSink(service: String)
pub type Prop {
  Prop(
    name: String,
    optional: Bool,
    repeated: Bool,
    kind: PropKind,
  )
}

Constructors

  • Prop(
      name: String,
      optional: Bool,
      repeated: Bool,
      kind: PropKind,
    )

    Arguments

    name

    “muse”

pub type PropKind {
  RelProp(
    kind: RelKind,
    target_module: String,
    target_type: String,
  )
  ValueProp(type_ref: TypeRef)
  SumProp(type_ref: TypeRef, payloads: List(TypeRef))
}

Constructors

  • RelProp(
      kind: RelKind,
      target_module: String,
      target_type: String,
    )

    has / held / link / multi

  • ValueProp(type_ref: TypeRef)

    値(gen/types の型、framework の型、Int / Bool / String / Float)

  • SumProp(type_ref: TypeRef, payloads: List(TypeRef))

    構成子を持つ sum(列は _kind + 各 payload)

pub type RelKind {
  Has
  Held
  Link
  Multi
}

Constructors

  • Has
  • Held
  • Link
  • Multi

server.roots の 1 行(root の形の上書き)。

pub type RootShape {
  Rootless(service: String)
  OwnRoot(service: String)
  RootOf(service: String, entity: String)
  WithVersion(service: String)
  Carried(
    service: String,
    name: String,
    type_: String,
    import_: String,
  )
  QueueParty(service: String, party: String)
}

Constructors

  • Rootless(service: String)
  • OwnRoot(service: String)
  • RootOf(service: String, entity: String)
  • WithVersion(service: String)
  • Carried(
      service: String,
      name: String,
      type_: String,
      import_: String,
    )
  • QueueParty(service: String, party: String)
pub type Select {
  Select(
    from: String,
    join: List(String),
    where: List(Cond),
    group: List(Group),
    having: List(#(String, Agg, Operand)),
    agg: List(Agg),
    along: List(Along),
    with: List(String),
    order: List(Order),
    limit: Limit,
    unread: List(String),
    unshaped: List(String),
    columns: option.Option(List(String)),
  )
}

Constructors

  • Select(
      from: String,
      join: List(String),
      where: List(Cond),
      group: List(Group),
      having: List(#(String, Agg, Operand)),
      agg: List(Agg),
      along: List(Along),
      with: List(String),
      order: List(Order),
      limit: Limit,
      unread: List(String),
      unshaped: List(String),
      columns: option.Option(List(String)),
    )

    Arguments

    unread

    join: / with: の項のうち矢印として読めなかったもの(join: <綴り> の形)。

    unshaped

    List の欄が literal でない・spread を持つ・where の条件が読めない、の名指し (where の spread(..) の形)。読めた項だけで SQL を出すと絞りや欄が黙って消える。

    columns

    q.Pick(columns:, select:) で選んだ列(Field の名)。None は従来どおり全列。 with の子の Entity の列も混ざる(typing.owner が行の列と子の列に分ける)。

src/server.gleam の宣言。declared は module があったか(無い app は back の表を出さない)。

pub type Server {
  Server(
    declared: Bool,
    routes: List(ServerRoute),
    aliases: List(ServerAlias),
    cron: List(Cron),
    durable_objects: List(DurableObject),
    hooks: List(Hook),
    connectors: List(Connector),
    storage: List(Storage),
    reads: List(ManualRead),
    roots: List(RootShape),
    attached_roles: List(AttachedRole),
    browser: option.Option(BrowserCookie),
    subject_free: List(String),
    consents: List(String),
    media: option.Option(Media),
    counted: List(Counted),
  )
}

Constructors

  • Server(
      declared: Bool,
      routes: List(ServerRoute),
      aliases: List(ServerAlias),
      cron: List(Cron),
      durable_objects: List(DurableObject),
      hooks: List(Hook),
      connectors: List(Connector),
      storage: List(Storage),
      reads: List(ManualRead),
      roots: List(RootShape),
      attached_roles: List(AttachedRole),
      browser: option.Option(BrowserCookie),
      subject_free: List(String),
      consents: List(String),
      media: option.Option(Media),
      counted: List(Counted),
    )

    Arguments

    subject_free

    入口の主体の集合の検査を外す Service の名(subject_free)

    consents

    同意の種類の名(consents、0.12)

    media

    画像の variant の表(media、0.12)

    counted

    面の門の数える口(0.12)。src/server.gleam の宣言でなく、生成器が面の src/gate.gleam から足す

src/server.gleam の aliases の 1 行。

pub type ServerAlias {
  ServiceAlias(
    name: String,
    service: String,
    method: String,
    path: String,
    credential: String,
    external_id: Bool,
  )
  AttachedAlias(
    name: String,
    attached: String,
    method: String,
    path: String,
    credential: String,
    who: String,
  )
}

Constructors

  • ServiceAlias(
      name: String,
      service: String,
      method: String,
      path: String,
      credential: String,
      external_id: Bool,
    )
  • AttachedAlias(
      name: String,
      attached: String,
      method: String,
      path: String,
      credential: String,
      who: String,
    )

src/server.gleam の routes の 1 行。method は “GET” などの大文字。

pub type ServerRoute {
  OverrideRoute(
    service: String,
    method: String,
    path: String,
    credential: option.Option(String),
  )
  InternalRoute(service: String)
}

Constructors

  • OverrideRoute(
      service: String,
      method: String,
      path: String,
      credential: option.Option(String),
    )

    credential は RouteVia のときだけ Some(“session” / “api_key”)。

  • InternalRoute(service: String)
pub type Service {
  Service(
    module: String,
    out_type: option.Option(TypeRef),
    params: List(String),
    queries: List(NamedQuery),
    args: List(Arg),
    allow_module: option.Option(String),
    subjects: List(Subject),
    effect: Effect,
    faces: List(String),
    faces_declared: Bool,
  )
}

Constructors

  • Service(
      module: String,
      out_type: option.Option(TypeRef),
      params: List(String),
      queries: List(NamedQuery),
      args: List(Arg),
      allow_module: option.Option(String),
      subjects: List(Subject),
      effect: Effect,
      faces: List(String),
      faces_declared: Bool,
    )

    Arguments

    out_type

    Type at the second parameter of Service(Args, Out, Error).

server.storage の 1 行(Entity の器と列の写像)。entity は module 名。

pub type Storage {
  InObject(entity: String, object: String)
  ColumnName(entity: String, property: String, column: String)
  TextSum(
    entity: String,
    property: String,
    values: List(#(String, String)),
  )
  SplitColumns(
    entity: String,
    property: String,
    columns: List(#(String, String)),
  )
  ArrayColumn(entity: String, property: String, element: String)
}

Constructors

  • InObject(entity: String, object: String)
  • ColumnName(entity: String, property: String, column: String)
  • TextSum(
      entity: String,
      property: String,
      values: List(#(String, String)),
    )
  • SplitColumns(
      entity: String,
      property: String,
      columns: List(#(String, String)),
    )
  • ArrayColumn(entity: String, property: String, element: String)

allow の who。Entity は Service の第一引数へ写す主体。

pub type Subject {
  SubjectEntity(module: String, type_name: String)
  SubjectAnonymous
  SubjectParty
  SubjectSystem
}

Constructors

  • SubjectEntity(module: String, type_name: String)
  • SubjectAnonymous
  • SubjectParty
  • SubjectSystem

型の参照。module は import の道(gen/types/title など)。

pub type TypeRef {
  TypeRef(
    module: option.Option(String),
    name: String,
    parameters: List(TypeShape),
  )
}

Constructors

  • TypeRef(
      module: option.Option(String),
      name: String,
      parameters: List(TypeShape),
    )

    Arguments

    parameters

    Sealed(String, StaffKey) のような型引数。Property でも落とさない。

★ の型を root の鍵照合に使う形。module は import 解決後の道。

pub type TypeShape {
  NamedShape(
    module: option.Option(String),
    name: String,
    parameters: List(TypeShape),
  )
  TupleShape(List(TypeShape))
}

Constructors

pub type ValueType {
  ValueType(
    name: String,
    type_name: String,
    spec: String,
    backing: Backing,
    range: option.Option(#(Int, Int)),
  )
}

Constructors

  • ValueType(
      name: String,
      type_name: String,
      spec: String,
      backing: Backing,
      range: option.Option(#(Int, Int)),
    )

    Arguments

    name

    “article_id”

    type_name

    “ArticleId”

    spec

    “Uuid” / “Pattern” / “Text” / “Markdown” / “MarkdownText” / “Range” / “Url”

    range

    Range(min:, max:) の両端。Range 以外は None。

pub type VerbBump {
  Always
  BumpUnless(from: String, to: String)
}

Constructors

  • Always
  • BumpUnless(from: String, to: String)
pub type VerbGate {
  AnyPhase
  Only(List(String))
}

Constructors

  • AnyPhase
  • Only(List(String))

Entity の yumemi/verbs 宣言を、生成器が検証した形で保持する。

pub type VerbRule {
  UpdateRule(name: String, fields: List(String), at: VerbGate)
  AdvanceRule(bump: VerbBump)
  DeleteWhereRule(field: String)
  CreateManyRule
  AdvanceAllRule
}

Constructors

  • UpdateRule(name: String, fields: List(String), at: VerbGate)
  • AdvanceRule(bump: VerbBump)
  • DeleteWhereRule(field: String)
  • CreateManyRule
  • AdvanceAllRule

Values

pub fn advance_bump(entity: Entity) -> VerbBump
pub fn arrow_by_name(
  arrows: List(Arrow),
  name: String,
) -> option.Option(Arrow)
pub fn backing_of(spec: String) -> Backing
pub fn empty_server() -> Server
pub fn entity_by_module(
  entities: List(Entity),
  module: String,
) -> option.Option(Entity)
pub fn entity_by_name(
  entities: List(Entity),
  name: String,
) -> option.Option(Entity)
pub fn field_by_name(
  entities: List(Entity),
  name: String,
) -> option.Option(FieldDef)
pub fn field_for_prop(
  entity: Entity,
  name: String,
) -> option.Option(FieldDef)
pub fn has_key(entity: Entity) -> Bool
pub fn has_lifecycle(entity: Entity) -> Bool
pub fn has_transitions(entity: Entity) -> Bool
pub fn order_bounds(
  prop: Prop,
  types: List(ValueType),
) -> option.Option(#(Int, Int))

順序列の宣言上の値域。Int は int4 の全域、Range は宣言の両端。それ以外は None。

pub fn prop_by_name(
  entity: Entity,
  name: String,
) -> option.Option(Prop)
pub fn server_route(
  server: Server,
  service: String,
) -> option.Option(ServerRoute)
pub fn value_type_by_name(
  types: List(ValueType),
  type_name: String,
) -> option.Option(ValueType)
✨ Search Document