MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / move_persona_to_folder

Method move_persona_to_folder

astrbot/core/db/sqlite.py:1130–1142  ·  view source on GitHub ↗

Move a persona to a folder (or root if folder_id is None).

(
        self, persona_id: str, folder_id: str | None
    )

Source from the content-addressed store, hash-verified

1128 )
1129
1130 async def move_persona_to_folder(
1131 self, persona_id: str, folder_id: str | None
1132 ) -> Persona | None:
1133 """Move a persona to a folder (or root if folder_id is None)."""
1134 async with self.get_db() as session:
1135 session: AsyncSession
1136 async with session.begin():
1137 await session.execute(
1138 update(Persona)
1139 .where(col(Persona.persona_id) == persona_id)
1140 .values(folder_id=folder_id)
1141 )
1142 return await self.get_persona_by_id(persona_id)
1143
1144 async def get_personas_by_folder(
1145 self, folder_id: str | None = None

Callers

nothing calls this directly

Calls 5

get_persona_by_idMethod · 0.95
updateFunction · 0.50
get_dbMethod · 0.45
executeMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected