flesh out the query stuff

This commit is contained in:
2026-02-15 15:04:43 -05:00
parent 94296ae925
commit 7a2f26b75d
5 changed files with 917 additions and 23 deletions

View File

@@ -253,6 +253,18 @@ table_status_to_string :: proc(status: Table_Status) -> string {
return "ACTIVE"
}
table_status_from_string :: proc(s: string) -> Table_Status {
switch s {
case "CREATING": return .CREATING
case "UPDATING": return .UPDATING
case "DELETING": return .DELETING
case "ACTIVE": return .ACTIVE
case "ARCHIVING": return .ARCHIVING
case "ARCHIVED": return .ARCHIVED
}
return .ACTIVE
}
// Table description
Table_Description :: struct {
table_name: string,
@@ -352,6 +364,17 @@ error_to_response :: proc(err_type: DynamoDB_Error_Type, message: string) -> str
return fmt.aprintf(`{{"__type":"%s","message":"%s"}}`, type_str, message)
}
// Build an Attribute_Value with the correct scalar type from raw bytes
build_attribute_value_with_type :: proc(raw_bytes: []byte, attr_type: Scalar_Attribute_Type) -> Attribute_Value {
owned := strings.clone(string(raw_bytes))
switch attr_type {
case .S: return String(owned)
case .N: return Number(owned)
case .B: return Binary(owned)
}
return String(owned)
}
// Deep copy an attribute value
attr_value_deep_copy :: proc(attr: Attribute_Value) -> Attribute_Value {
switch v in attr {