Incorporate server and cli into new code #13
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue