sqlalchemy allows you to issue any literal sql statements as text:

http://www.sqlalchemy.org/docs/core/tutorial.html#using-text


On Feb 22, 7:38 am, Toninho Nunes <toninhonu...@gmail.com> wrote:
> Hi,
>
> I would like to know how to create database with sqlalchemy using the
> PostGresql driver, are there a sample or example?
>
> sqlalchemy just only works with database postgresql previous created.
>
> see my code:
>
> import sqlalchemy
> from sqlalchemy import create_engine, Table, MetaData, Integer,
> String, ForeignKey, Column, LargeBinary
>
> db_engine = create_engine('postgresql+psycopg2://
> postgres:magi1850@localhost/newscom')
>
> metadata = MetaData()
>
> metadata.create_all(db_engine)
>
> Error message:
>
> sqlalchemy.exc.OperationalError: (OperationalError) FATAL:  database
> "newscom2" does not exist
>  None None
>
> Any ideas ?
>
> Toninho Nunes

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to