Incorporate server and cli into new code #13

Merged
Jaculabilis merged 16 commits from tvb/server into develop 2021-06-16 03:53:07 +00:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit d8d20f4224 - Show all commits

View File

@ -3,6 +3,7 @@ Lexicon query interface
""" """
import re import re
from typing import Sequence
from sqlalchemy import select, func from sqlalchemy import select, func
@ -52,3 +53,8 @@ def create(
db.session.add(new_lexicon) db.session.add(new_lexicon)
db.session.commit() db.session.commit()
return new_lexicon return new_lexicon
def get_all_lexicons(db: DbContext) -> Sequence[Lexicon]:
"""Get all lexicons."""
return db(select(Lexicon)).scalars()

View File

@ -3,7 +3,7 @@ User query interface
""" """
import re import re
import uuid from typing import Sequence
from sqlalchemy import select, func from sqlalchemy import select, func
@ -67,3 +67,8 @@ def create(
db.session.add(new_user) db.session.add(new_user)
db.session.commit() db.session.commit()
return new_user return new_user
def get_all_users(db: DbContext) -> Sequence[User]:
"""Get all users."""
return db(select(User)).scalars()