mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
remove conflict constraint name from relation_repository.py
Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -162,7 +162,7 @@ def parse_inline_relations(content: str) -> List[Dict[str, Any]]:
|
||||
|
||||
target = content[start + 2 : end].strip()
|
||||
if target:
|
||||
relations.append({"type": "links to", "target": target, "context": None})
|
||||
relations.append({"type": "links_to", "target": target, "context": None})
|
||||
|
||||
start = end + 2
|
||||
|
||||
|
||||
@@ -132,15 +132,11 @@ class RelationRepository(Repository[Relation]):
|
||||
|
||||
if dialect_name == "postgresql":
|
||||
stmt = pg_insert(Relation).values(values)
|
||||
stmt = stmt.on_conflict_do_nothing(
|
||||
index_elements=["from_id", "to_name", "relation_type"]
|
||||
)
|
||||
stmt = stmt.on_conflict_do_nothing()
|
||||
else:
|
||||
# SQLite
|
||||
stmt = sqlite_insert(Relation).values(values)
|
||||
stmt = stmt.on_conflict_do_nothing(
|
||||
index_elements=["from_id", "to_name", "relation_type"]
|
||||
)
|
||||
stmt = stmt.on_conflict_do_nothing()
|
||||
|
||||
result = await session.execute(stmt)
|
||||
return result.rowcount if result.rowcount else 0
|
||||
|
||||
Reference in New Issue
Block a user