user_key_value


Description

{“what”:“Arbitrary key-value data per user, namespaced, with optional expiry.”,“why”:“Without it, per-user arbitrary data would require new tables or columns per feature, causing schema churn.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:40.946098376+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null

{“what”:“Integer primary key, unique per row.”,“why”:“Without it, rows cannot be uniquely referenced for updates or deletes.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:40.957985765+00:00”}

user_id int4 10 null
core_user.id fk_user_key_value_user_id R

{“what”:“Identifier of the user who owns this entry.”,“why”:“Without it, entries cannot be scoped to a specific user, making per-user retrieval impossible.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:40.977844075+00:00”}

namespace varchar 254 null

{“what”:“String grouping keys into logical sets, e.g. ‘preferences’ or ‘session’.”,“why”:“Without it, keys from different features would collide, and per-feature isolation would be lost.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:40.995002245+00:00”}

key varchar 254 null
setting.key Implied Constraint R

{“what”:“Unique key within a (user_id, namespace) pair; the lookup identifier.”,“why”:“Without it, values cannot be addressed or updated individually within a namespace.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:41.017547710+00:00”}

value text 2147483647 √ null

{“what”:“Free-form text content of the entry; null when no value is set.”,“why”:“Without it, there would be no payload to retrieve; null allows explicit absence of data.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:41.029158048+00:00”}

created_at timestamptz 35,6 now()

{“what”:“UTC timestamp of row creation, set to current time on insert.”,“why”:“Without it, the age of entries cannot be determined, breaking audit or cleanup logic.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:41.039266973+00:00”}

updated_at timestamptz 35,6 now()

{“what”:“Timestamp of the most recent update to the row; defaults to creation time.”,“why”:“Without it, you cannot know when the value was last changed, breaking cache invalidation or staleness checks.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:41.059557241+00:00”}

expires_at timestamptz 35,6 √ null

{“what”:“UTC timestamp after which the entry is considered expired; null means no expiry.”,“why”:“Without it, temporary data like sessions or one-time tokens would persist indefinitely, requiring manual cleanup.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:41.071115347+00:00”}

Indexes

Constraint Name Type Sort Column(s)
user_key_value_pkey Primary key Asc id
unique_user_key_value_user_id_namespace_key Must be unique Asc/Asc/Asc user_id + namespace + key

Relationships