-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Describe the bug
When a composite index (type: "composite") uses projection: "keys_only" or an array projection, the TypeScript response types don't account for the fact that composite key attributes are stored as native DynamoDB columns and are always physically present in query responses.
Current behavior
keys_only+ composite index: response type is{}(empty object)- Array projection (e.g.
["name"]) + composite index: response type only includesname, missing the pk/sk composite attributes attributesparameter rejects composite key attributes under restricted projections- Collection queries have the same issues
ElectroDB Version
Specify the version of ElectroDB you are using
3.7.1
Entity/Service Definitions
Include your entity model (or a model that sufficiently recreates your issue) to help troubleshoot.
{
model: {
entity: "tasks",
version: "1",
service: "taskapp"
},
attributes: {
id: { type: 'string' },
hello: { type: 'string' },
world: { type: 'string' }
},
indexes: {
primary: {
pk: {
field: "pk",
composite: ["id"]
},
},
keysOnly: {
index: "gsi1pk-gsi1sk-index",
projection: 'keys_only',
type: 'composite',
pk: {
composite: ["hello"]
},
sk: {
composite: ['id']
}
},
include: {
index: "gsi1pk-gsi1sk-index",
projection: ['world'],
type: 'composite',
pk: {
composite: ["hello"]
},
},
}
}
Expected behavior
keys_only+ composite index: response type should include all pk and sk composite attributes (e.g.{ tenantId: string; age: number })- Array projection + composite index: response type should include the listed attributes plus all pk and sk composite attributes
attributesparameter should accept composite key attributes- Collection response types should reflect composite key availability per entity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels