You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.
This issue builds on #41. You should be able to add custom metadata to frames. You can then use the metadata in reports.
# add custom meta fields
hours meta:add sprint
hours meta:add estimate --interval
hours meta:add velocity --computed 'estimate / elapsed'
hours meta:add points --number
# Track time with meta fields
hours start --tag migrations --notes 'adding emails table' --sprint 'bulbasaur' --estimate '20 minutes' --points 2
# Use meta in reports
hours report --sprint='bulbasaur'
Metadata can be defined as one of the following types:
string (default)
boolean
number
interval
datetime
timestamp
computed (will clarify in a separate issue)
Any field can optionally be variadic, which corresponds to passing multiple flags (i.e. how tags work now).
The field type is used to determine how it's (de)serialized for storage and how it's parsed from the CLI input.
Challenges:
Adding the meta option flags at runtime will be challenging, and will require additional database queries every time you run a command that supports meta. If we use the meta field name as the option name (and don't namespace them) adding any options in the future will technically be a breaking change.
Ideally we could store the meta as a JSON column, but to query JSON (i.e. for reports) requires the JSON1 extension for SQLite. Some PHP installations don't load this extension. We might be able to compile and distribute the shared library? It does work with Laravel, so it's a viable option.
I really don't want to have to do an EAV table for this, but that's an option too. Since SQLite doesn't have real date/time types every value would either be integer, real, or text.
The text was updated successfully, but these errors were encountered:
Since JSON support will only be necessary for querying meta columns in reports and won't be used unless you use it explicitly it's probably OK if it doesn't work on certain platforms by default.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This issue builds on #41. You should be able to add custom metadata to frames. You can then use the metadata in reports.
Metadata can be defined as one of the following types:
Any field can optionally be variadic, which corresponds to passing multiple flags (i.e. how tags work now).
The field type is used to determine how it's (de)serialized for storage and how it's parsed from the CLI input.
Challenges:
Adding the meta option flags at runtime will be challenging, and will require additional database queries every time you run a command that supports meta. If we use the meta field name as the option name (and don't namespace them) adding any options in the future will technically be a breaking change.
Ideally we could store the meta as a JSON column, but to query JSON (i.e. for reports) requires the JSON1 extension for SQLite. Some PHP installations don't load this extension. We might be able to compile and distribute the shared library? It does work with Laravel, so it's a viable option.
I really don't want to have to do an EAV table for this, but that's an option too. Since SQLite doesn't have real date/time types every value would either be integer, real, or text.
The text was updated successfully, but these errors were encountered: