Processing schema

This commit is contained in:
Cyber MacGeddon 2025-05-04 21:41:01 +01:00
parent 4efb23e5da
commit 949924dc8a
2 changed files with 36 additions and 10 deletions

View file

@ -203,19 +203,16 @@ class Librarian:
)
async def list_processing(self, request):
raise RuntimeError("Not implemented")
async def list(self, user, collection):
procs = await self.table_store.list_processing(request.user)
raise RuntimeError("Not implemented")
info = self.table_store.list(user, collection)
print(">>", info)
print(procs)
return LibrarianResponse(
error = None,
document = None,
info = info,
document_metadata = None,
content = None,
document_metadatas = None,
processing_metadatas = procs,
)

View file

@ -211,7 +211,7 @@ class TableStore:
WHERE user = ?
""")
self.list_document_by_collection_stmt = self.cassandra.prepare("""
self.list_document_by_tag_stmt = self.cassandra.prepare("""
SELECT
id, time, kind, title, comments, metadata, tags, object_id
FROM document
@ -219,6 +219,35 @@ class TableStore:
ALLOW FILTERING
""")
self.insert_processing_stmt = self.cassandra.prepare("""
INSERT INTO processing
(
id, document_id, time,
flow, user, collection,
tags,
)
VALUES (?, ?, ?, ?, ?, ?, ?)
""")
self.delete_processing_stmt = self.cassandra.prepare("""
DELETE FROM processing
WHERE user = ? AND id = ?
""")
self.test_processing_exists_stmt = self.cassandra.prepare("""
SELECT id
FROM processing
WHERE user = ? AND id = ?
LIMIT 1
""")
self.list_processing_stmt = self.cassandra.prepare("""
SELECT
id, document_id, time, flow, collection, tags
FROM processing
WHERE user = ?
""")
return
self.insert_triples_stmt = self.cassandra.prepare("""