DX rules of thumb:
'user' as const) to get token-narrowed record types at call sites (no generics).entityManager.removeKeys(entityToken, records) in handlers when you want domain shapes.createEntityManager(config as const). The EntityClient carries the literal type,
so createQueryBuilder infers index tokens (ITS) and per-index page keys automatically.
Without a values-first literal, ITS defaults to string.Patterns
// Token-aware get with projection tuple (const narrows the shape)
const out = await client.getItem('user', { hashKey2: 'h', rangeKey: 'r' }, [
'a',
] as const);
// QueryBuilder narrows per-index page keys automatically when the client
// was constructed from createEntityManager(config as const)
const qb = createQueryBuilder({
entityClient: client,
entityToken: 'user',
hashKeyToken: 'hashKey2',
});
Related