* Add ListOptionIndexerOptions to create ListOptionIndexer
* Remove unused function
* Implement configurable garbage collection on ListOptionIndexer
* Propagate Steve options from Server
* Move types related to list options and sql queries into their own package.
The problem having these in the informer package is that eventually code
in other packages will need to import `informer` only for constants or types,
but some members of the informer package may already depend on those. Best to
move type definitions into their own simpler package.
* Fix the ListOptions sort field.
Instead of making it a single array-ish field, convert it into a
true array of Sort Directives. Easier to read, less bending backwards.
* Pass the listOptions struct by reference to avoid copying.
We never update the ListOptions struct once it's created so there's
no need to pass it by value.
This might be a near-useless optimization...
The problem having these in the informer package is that eventually code
in other packages will need to import `informer` only for constants or types,
but some members of the informer package may already depend on those. Best to
move type definitions into their own simpler package.
* Generate field names with brackets when needed.
* Stop hard-wiring complex selectors as `["field1", "field2[sub-field3]"]`
and instead represent them as a more consistent `["field1", "field2", "sub-field3"]`
* Convert all filter strings ending with square brackets to an array.
Stop special-casing 'metadata.labels[X]' and handle any query string that ends with '[...]'.
* Stop checking for pre-bracketed terms in constant field-accessor arrays.
In this commit we stop converting string arrays like
`["metadata", "labels[k8s.io/deepcode]"]` into the database field
`"metadata.labels[k8s.io/deepcode]"` and instead will do a
naive `join` to give `metadata[labels[k8s.io/deepcode]]`. The solution
is to never express the above terms in separate fields, like
`["metadata", "labels", "k8s.io/deepcode"]`. This also better reflects
the stucture of the referenced object.
* gofmt changes
* Simplify comment about 'smartJoin'.
Previous SQLite-related code used context.Background() and context.TODO() because it was not developed with context awareness.
This commit propagates the main Steve context so that it can be used when interacting with SQL context-aware functions.
This PR removes all production-code use of context.Background() and context.TODO() and replaces test-code use of TODO with Background.
Contributes to rancher/rancher#47825