MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / update_token

Method update_token

src/core/database.py:1090–1104  ·  view source on GitHub ↗

Update token fields

(self, token_id: int, **kwargs)

Source from the content-addressed store, hash-verified

1088 return [Token(**dict(row)) for row in rows]
1089
1090 async def update_token(self, token_id: int, **kwargs):
1091 """Update token fields"""
1092 async with self._connect(write=True) as db:
1093 updates = []
1094 params = []
1095
1096 for key, value in kwargs.items():
1097 updates.append(f"{key} = ?")
1098 params.append(value)
1099
1100 if updates:
1101 params.append(token_id)
1102 query = f"UPDATE tokens SET {', '.join(updates)} WHERE id = ?"
1103 await db.execute(query, params)
1104 await db.commit()
1105
1106 async def delete_token(self, token_id: int):
1107 """Delete token and related data"""

Callers 3

update_tokenFunction · 0.45
import_tokensFunction · 0.45
plugin_update_tokenFunction · 0.45

Calls 1

_connectMethod · 0.95

Tested by

no test coverage detected