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

implement named parameterized queries #23

Closed
WolfgangFahl opened this issue Nov 2, 2024 · 3 comments
Closed

implement named parameterized queries #23

WolfgangFahl opened this issue Nov 2, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@WolfgangFahl
Copy link
Owner

see beancount/beanquery#201

see e.g. https://github.com/WolfgangFahl/pyLoDStorage/blob/master/lodstorage/params.py

which does jinja compatible parameter handling and is used in https://github.com/WolfgangFahl/snapquery

with demos at https://snapquery.bitplan.com/ and https://genwiki2024.bitplan.com/

grafik grafik
@WolfgangFahl WolfgangFahl self-assigned this Nov 2, 2024
@WolfgangFahl WolfgangFahl added the enhancement New feature or request label Nov 2, 2024
@WolfgangFahl WolfgangFahl added this to the 0.0.9 milestone Nov 2, 2024
@WolfgangFahl
Copy link
Owner Author

npbeanquery -ep /tmp/endpoints.yaml -qp nomina_examples/queries.yaml --list
AccountSummary:AccountSummary
TotalSum:TotalSum
PayeeSummary:PayeeSummary

@WolfgangFahl
Copy link
Owner Author

npbeanquery  -qp nomina_examples/queries.yaml -qn TotalSum --params account=Expenses:Food:Groceries
[
  {
    "currency": "USD",
    "total": "6634.95"
  }
]

@WolfgangFahl
Copy link
Owner Author

npbeanquery -qp nomina_examples/queries.yaml -qn TotalSum --params account=Expenses:Food:Groceries -f github

TotalSum

query

select sum(position) as total
where account = 'Expenses:Food:Groceries'

result

total currency
6635 USD

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

No branches or pull requests

1 participant