Skip to content

add support for metadata comments #15

Description

@prabirshrestha

For example one could set metadata comments on fields or types to provide a lot more concrete information such as sql types or char limit or other hints.

type User {
  id:      UUID
  @sql('nvarchar(1600) NOT NULL')
  name:    String
  email:   Option<Email>
  roles:   List<Role>
  address: Address
}

this could just be @key(value) and could be anything.

might be somethign similar to golang comments but this could be super long.

type User struct {
    id: string `json:"tagada,omitempty"`
}

this might not be good as it could be too long.

type User struct {
    //# sql: nvarchar(255)
    id: string
}
type User struct {
    //@ sql("nvarchar(255)")
    id: string
}

this is more to add extra metadata as comments that one could try to parse into structed data for UIs if needed to show better diagrams or help llm understand and generate code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions