Skip to content

[Feat] Add type hinting to db library and move db url to env #87

@Robbo-lab

Description

@Robbo-lab

Issue Type

  • Other (please specify)

Description

Provide type hinting in the new database classes
Import database URL into env.example file

Possible Solution

Database_url = "sqlite:///./Database.db"

This should probably be added to .env.example and be loaded by an environment variable

it might be worth to add some type annotations to the function signature of these C.R.U.D functions so

def add_object(db: Session, new_object):
might be better as

def add_object(db: Session, new_object: object) -> object:
As these functions do return back the object, but it might be even better to actually annotate the proper type that you've been using which is "DBTask", so see if you can try to set it up with something

def add_object(db: Session, new_object: DBTask) -> DBTaskt:

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions