Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

DB already exists.

If the DB already exists like a remotely hosted one that I want to connect to, do I still need the model, declarative base etc...?

2 Answers

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,998 Points

As far as I know, if you're only going to be performing SQL queries on that database you shouldn't have the need for declaring models / declarative base.

If you plan to do more than that then it may be necessary. Though in doing a few Google searches, I did stumble upon "reflection". Seems like a convenient way of building objects off of tables in a database without declaring models, but I've never personally used this or anything.

I'd recommend checking it out though! Reflecting Database Objects

I hope this helps out!

It does. I wish you had a course on fastapi or even with the flask/sqlalchemy courses a lesson on how to pass "GET" data from like sqlite or some other remote db to a table in html. All the youtube courses and various websites only use a hard coded array which the coding isn't the same.