forked from orbit-oss/flask
moved Table import to next code block
This commit is contained in:
parent
8089eb5769
commit
9cecf0d81c
1 changed files with 3 additions and 1 deletions
|
|
@ -177,7 +177,7 @@ SQL Abstraction Layer
|
|||
If you just want to use the database system (and SQL) abstraction layer
|
||||
you basically only need the engine::
|
||||
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy import create_engine, MetaData
|
||||
|
||||
engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
|
||||
metadata = MetaData(bind=engine)
|
||||
|
|
@ -185,6 +185,8 @@ you basically only need the engine::
|
|||
Then you can either declare the tables in your code like in the examples
|
||||
above, or automatically load them::
|
||||
|
||||
from sqlalchemy import Table
|
||||
|
||||
users = Table('users', metadata, autoload=True)
|
||||
|
||||
To insert data you can use the `insert` method. We have to get a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue