MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / UpdateIdentityMetadata

Method UpdateIdentityMetadata

database/metadata.go:91–103  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

89// Returns:
90// - error: An error if the update operation fails.
91func (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}

Callers 1

Calls

no outgoing calls

Tested by 1