fix(dynamodb): hybrid persistence (#2677)

* fix: persist DynamoDB index definitions

* test(dynamodb): declare LSI sort key attribute in HybridStorageTest fixture

Real DynamoDB requires every attribute used in a table or index key
schema to appear in AttributeDefinitions; the LSI's sort key (lsiSk)
was missing from the fixture.
This commit is contained in:
Sam Fakhreddine authored and GitHub committed 2026-08-28 18:14:28 -04:00
1 parent 5033ace772
commit e5316839ca
4 files changed
+35

No files matched your search

@@ -64,6 +64,7 @@ public class GlobalSecondaryIndex {
public long getIndexSizeBytes() { return indexSizeBytes; }
public void setIndexSizeBytes(long indexSizeBytes) { this.indexSizeBytes = indexSizeBytes; }
@JsonIgnore
public String getPartitionKeyName() {
return keySchema.stream()
.filter(k -> "HASH".equals(k.getKeyType()))
@@ -72,6 +73,7 @@ public class GlobalSecondaryIndex {
.orElseThrow();
}
@JsonIgnore
public String getSortKeyName() {
return keySchema.stream()
.filter(k -> "RANGE".equals(k.getKeyType()))
@@ -63,6 +63,7 @@ public class LocalSecondaryIndex {
public long getItemCount() { return itemCount; }
public void setItemCount(long itemCount) { this.itemCount = itemCount; }
@JsonIgnore
public String getPartitionKeyName() {
return keySchema.stream()
.filter(k -> "HASH".equals(k.getKeyType()))
@@ -71,6 +72,7 @@ public class LocalSecondaryIndex {
.orElseThrow();
}
@JsonIgnore
public String getSortKeyName() {
return keySchema.stream()
.filter(k -> "RANGE".equals(k.getKeyType()))
@@ -207,6 +207,7 @@ public class TableDefinition {
public Integer getOnDemandMaxWriteRequestUnits() { return onDemandMaxWriteRequestUnits; }
public void setOnDemandMaxWriteRequestUnits(Integer v) { this.onDemandMaxWriteRequestUnits = v; }
@JsonIgnore
public String getPartitionKeyName() {
return keySchema.stream()
.filter(k -> "HASH".equals(k.getKeyType()))
@@ -216,6 +217,7 @@ public class TableDefinition {
}
/** Returns the sort key attribute name, or null if none. */
@JsonIgnore
public String getSortKeyName() {
return keySchema.stream()
.filter(k -> "RANGE".equals(k.getKeyType()))