Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support @alias #31

Open
kkharji opened this issue Aug 28, 2021 · 2 comments
Open

support @alias #31

kkharji opened this issue Aug 28, 2021 · 2 comments

Comments

@kkharji
Copy link

kkharji commented Aug 28, 2021

@alias is great for options, it would be cool to have them supported

Example:

---@alias SqliteActions
---| '"no action"' : when a parent key is modified or deleted from the database, no special action is taken.
---| '"restrict"' : prohibites from deleting (for ON DELETE RESTRICT) or modifying (for ON UPDATE RESTRICT) a parent key when there exists one or more child keys mapped to it.
---| '"null"' : when a parent key is deleted or modified, the child key columns of all rows in the child table that mapped to the parent key are set to contain SQL NULL values.
---| '"default"' : "default" actions are similar to "null", except that each of the child key columns is set to contain the column's default value instead of NULL.
---| '"CASCADE"' : propagates the delete or update operation on the parent key to each dependent child key.

In action

2021-08-28 06 22 08

@Conni2461
Copy link
Collaborator

hmm according to spec @alias is this https://emmylua.github.io/annotations/alias.html

Supporting this in the grammar is one thing and supporting this in docgen another. How do you want the docgen output to look like?

@kkharji
Copy link
Author

kkharji commented Aug 28, 2021

perhaps something like this

SqliteActions                                                      *SqliteActions*
    what is this enum about

    Variants: ~
        {no action} (string)   when a parent key is modified or deleted from the database, 
                               no special action is taken.
        {restrict}  (string)   prohibites from deleting/modifying a parent key when a child 
                               key is mapped to it.
        {null}      (string)   when a parent key is deleted/modified, the child key that 
                               mapped to the parent key gets set to null.
        {default}   (string)   similar to "null", except that sets to the column's default 
                               value instead of NULL.
        {cascade}   (string)   propagates the delete or update operation on the parent key 
                               to each dependent child key.

surely the string parts is inferred from that '"()"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants