How to connect to an already existing database in SqlAlchemy?

3,367 views
Skip to first unread message

Aarushi ign

unread,
Jun 27, 2014, 1:47:51 PM6/27/14
to sqlal...@googlegroups.com
I am using Flask-SqlAlchemy. It does allows you to make models but how do map an existing table to a class object so that u can use it later to do other functions like Pagination?
My MySql database is created in different scripts and i need to access those tables and perform pagination.
In SqlAlchemy only SQLSoup provides the ability to map an existing table i guess.
Any help guys please.

Jonathan Vanasco

unread,
Jun 27, 2014, 2:53:41 PM6/27/14
to sqlal...@googlegroups.com

Michael Weylandt

unread,
Jul 4, 2014, 8:34:36 PM7/4/14
to sqlal...@googlegroups.com
Set app.config["SQLALCHEMY_DATABASE_URI"] to point to your database. Normally won't create tables unless you call flask.ext.sqlalchemy.SQLAlchemy.creae_all explicitly. 
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages