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

getCustomPragmaFixed does not support more than one pragma parameter #62

Closed
emizzle opened this issue Nov 26, 2020 · 0 comments
Closed

Comments

@emizzle
Copy link

emizzle commented Nov 26, 2020

from macros import getCustomPragmaVal
from stew/shims/macros as stew_macros import hasCustomPragmaFixed, getCustomPragmaFixed

template dbColumnName*(name: string, primaryKey: bool = false) {.pragma.}
    ## Specifies the database column name for the object property

type MyType = object
  name {.dbColumnName("blah", true).}: string

let myType = MyType(name: "eric")

echo type myType.type.getCustomPragmaFixed("name", dbColumnName)
echo type myType.name.getCustomPragmaVal(dbColumnName)

Expected results:

tuple[name: string, primaryKey: bool]
tuple[name: string, primaryKey: bool]

Actual results:

Error Type
tuple[name: string, primaryKey: bool]

Reproduction:

git clone https://github.com/emizzle/nim-test-env && cd nim-test-env
make get_custom_pragma
@zah zah closed this as completed in 04f8150 Feb 10, 2021
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

1 participant