-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Basic read/write functionality for database #23
Conversation
… date time automatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm mostly, just some comments. Also, do we want to add a __init__.py
to client/data
so that it gets picked up by the auto documentation?
class User(NamedTuple): | ||
"""Represents a user record in the SQLite database""" | ||
|
||
id_: Optional[int] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the underscore suffix notation mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its to avoid name clashes with the inbuilt id()
function.
client/data/routines.py
Outdated
return user_id | ||
|
||
|
||
def save_posture(posture: Posture | tuple) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm should this just be Posture
so that we can just use posture.id_
below? why tuple
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking @avg-lebesgue-enjoyer and @polypies73 might not want to worry about using the Posture
class and tried to make it a bit more flexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it'd be too much more work, wouldn't you just wrap a tuple in Posture()
to convert it? It would also be nice for data validation reasons too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah okay I agree, I will typehint just Posture
.
Done. |
No description provided.