UpdateIdentityMetadata updates the metadata for a specific identity in the database. It marshals the metadata map to JSON before storing it. Parameters: - id: The ID of the identity to update. - metadata: The new metadata to store. Returns: - error: An error if the update operation fails.
(id string, metadata map[string]interface{})
| 89 | // Returns: |
| 90 | // - error: An error if the update operation fails. |
| 91 | func (d *Datasource) UpdateIdentityMetadata(id string, metadata map[string]interface{}) error { |
| 92 | metadataJSON, err := json.Marshal(metadata) |
| 93 | if err != nil { |
| 94 | return err |
| 95 | } |
| 96 | |
| 97 | _, err = d.Conn.ExecContext(context.Background(), ` |
| 98 | UPDATE ledgerforge.identity |
| 99 | SET meta_data = $1 |
| 100 | WHERE identity_id = $2 |
| 101 | `, metadataJSON, id) |
| 102 | return err |
| 103 | } |
no outgoing calls