codemation / pydbantic

A single model for shaping, creating, accessing, storing data within a Database
https://pydbantic.readthedocs.io/en/latest/
Apache License 2.0
228 stars 15 forks source link

README Shows Incomplete Import Statement #27

Closed engineerjoe440 closed 2 years ago

engineerjoe440 commented 2 years ago

By my reading, it looks like this example shows an incomplete import statement. The statement does not import all of the models required to create the database. (I think :stuck_out_tongue_closed_eyes: )

Present documentation

import asyncio
from pydbantic import Database
from models import Employee ### <---- Missing additional model imports here...?

async def main():
    db = await Database.create(
        'sqlite:///test.db',
        tables=[
            Employee,
            EmployeeInfo,
            Positions,
            Department
        ]
    )

if __name__ == '__main__':
    asyncio.run(main())

Suggested Documentation

import asyncio
from pydbantic import Database
from models import Employee, EmployeeInfo, Positions, Department

async def main():
    db = await Database.create(
        'sqlite:///test.db',
        tables=[
            Employee,
            EmployeeInfo,
            Positions,
            Department
        ]
    )

if __name__ == '__main__':
    asyncio.run(main())
engineerjoe440 commented 2 years ago

On another note.... THIS PROJECT LOOKS AMAZING! Thank you so much for your work on this, I'm terrified of databases, and this makes them look so approachable, I'm excited to play with it!

codemation commented 2 years ago

Hey @engineerjoe440 , thanks for opening the issue, I will try to cover this in my next PR. Feel free in the future to also fork / fix / create your own PR, all contributions are welcome.

engineerjoe440 commented 2 years ago

Hi @codemation! I'm so excited to hear you're open to PR's! I'll go ahead and fork, make those updates and open one. Thanks again for this outstanding work. I can't wait to find an excuse to start using it!

engineerjoe440 commented 2 years ago

Thanks again, @codemation!