Closed EmosewaMC closed 4 months ago
It may be possible to get both benefits by using some sort of compile-time tagging. I.e. using an enum or constexpr value to index by. So instead of getIntField("banana")
perhaps it could be something like getIntField<FooColumn::Banana>()
. I'll play around with it when I have time.
I'm in favor of just strings, this should really be a set it and forget it long term
I think I might have misunderstood the nature of the issue
I think I might have misunderstood the nature of the issue
The solution does not need to be complex. Just replacing a number with a string instead.
Is your feature request related to a problem?
Currently, column indexing is prone to issues with off by one, copy paste and ambiguity. This has caused issues in the past and has caused issues to this day and will cause issues in the future if a column is added to the query or removed in an update.
Describe the solution you'd like
Replace any calls of, for example a query with a column
banana
and a gettergetIntField(0)
with the gettergetIntField("banana")
. there are other similar api calls which should have this done as well.Repository breaking implications
Binary size will grow but we're talking a few hundred bytes. Worth the zero error and runtime error if a column doesnt exist in an updated query.
Describe alternatives you've considered
Why are these not just using the ORM in these random queries? this should be done in the future. No file should need to link with sqlite.
Additional context
i ate a carrot today. tasted good.