Closed simonw closed 3 years ago
I'm also going to change how "banned" columns work. Currently if your data has a item_
column the tool raises an error. The new reserved column will be _item
but my rule will be that if your column is reserved I'll add a trailing _
to it - and if you also have a _item_
column I'll rename that to _item__
and so-on.
Current implementation: https://github.com/simonw/git-history/blob/d58f4466ac4fd16f4adc430ab1988ac6508cf3b1/git_history/cli.py#L288-L300
I'm going to split out some of this logic into a utils.py
module, and write some separate tests for it.
Well this was a mistake... Datasette treats columns that start with an underscore as querystring parameters it should ignore!
Switching to underscore suffixes instead.
... I do like underscore prefixes though. I'm tempted to fix the bug I filed in Datasette instead and keep this:
I released Datasette 0.59.2 with a fix for this, so I'm free to use _id
and friends here.
Right now I've implemented it such that
id
andcommit
andversion
anditem
are reserved columns, and any user-provided data with those columns gets renamed tocommit_
andid_
and so-on - see #8.I've changed my mind. I think this tool's columns should all have a
_
prefix instead (like semi-private class properties in Python).I'm even going to do that for the
_id
column, mainly so I don't have to explain a special case forid
.