Spaces:
Runtime error
Runtime error
gamingflexer
commited on
Commit
·
44adb4d
1
Parent(s):
db9914d
Add option to fetch all data in fetch_papers_data function
Browse files- src/db/db_functions.py +4 -1
src/db/db_functions.py
CHANGED
@@ -50,6 +50,9 @@ def get_correct_author_name(user_input_author):
|
|
50 |
return None
|
51 |
|
52 |
|
53 |
-
def fetch_papers_data(author_name, fields_to_query = ["doi_no"],table_name: str = 'papers'):
|
|
|
|
|
|
|
54 |
data, count = supabase.table(table_name).select(",".join(fields_to_query)).eq('author_name', author_name).execute()
|
55 |
return data[1]
|
|
|
50 |
return None
|
51 |
|
52 |
|
53 |
+
def fetch_papers_data(author_name, fields_to_query = ["doi_no"],table_name: str = 'papers', all=False):
|
54 |
+
if all:
|
55 |
+
data, count = supabase.table(table_name).select("*").execute()
|
56 |
+
return data
|
57 |
data, count = supabase.table(table_name).select(",".join(fields_to_query)).eq('author_name', author_name).execute()
|
58 |
return data[1]
|