mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 19:21:03 +02:00
Processing schema
This commit is contained in:
parent
4efb23e5da
commit
949924dc8a
2 changed files with 36 additions and 10 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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("""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue