steve/pkg/sqlcache/informer/factory
Eric Promislow 0d86756a0b
Capture type info so numeric values sort correctly. (#837)
* Capture type info so numeric values sort correctly.

* Replace conditional string prefixing with strings.TrimPrefix

* Add tabular data for other metadata.fields to sort numerically.

The issue is that some fields are not numeric, but are represented
in an entry in metadata.fields with a numeric indicator.  Like
with secrets, metadata.fields[2] gives the number of actual keys
in the stored secret.

* Update added test to include the typeGuidance param.

* Act on review suggestions/comments.

* Add a unit test verifying typeGuidance can change a DB field type.

The test found an error that it's better for getFieldAndColInfo
to return default typeGuidance = an empty map rather than `nil`.

* Add Tom's unit test to verify TypeGuidance influences sorting.

Also add a fake type-guidance as int on a field where the values
start with a number but also have non-numeric data.  sqlite stores
the entire string, and sort maps the values to 0... so sorting
doesn't repeats the incoming order (and sort-DESC reverses it).

* Add a clarifying comment on sorting non-ints or partly-ints as INT.

* Add more test objects to verify sorting mix of ints and non-ints works as expected.
2025-10-15 10:40:55 -07:00
..
db_mocks_test.go Make vai use the encoding abstraction and improvements (#743) 2025-10-10 08:18:56 +02:00
dynamic_mocks_test.go Bumped dependencies to be compatible with k8s-v1.33 (#681) 2025-06-20 17:53:42 +05:30
informer_factory.go Capture type info so numeric values sort correctly. (#837) 2025-10-15 10:40:55 -07:00
informer_factory_test.go Capture type info so numeric values sort correctly. (#837) 2025-10-15 10:40:55 -07:00
k8s_cache_mocks_test.go Bumped dependencies to be compatible with k8s-v1.33 (#681) 2025-06-20 17:53:42 +05:30
sql_informer_mocks_test.go Drop tables instead of removing the database completely (#807) 2025-09-09 15:52:02 -04:00