Skip to content

Instantly share code, notes, and snippets.

@lucidguppy
Created March 1, 2013 02:38
Show Gist options
  • Save lucidguppy/5062088 to your computer and use it in GitHub Desktop.
Save lucidguppy/5062088 to your computer and use it in GitHub Desktop.
Create an sql table
from sqlalchemy import *
from datetime import datetime
metadata = MetaData('postgres://blah blah blah')
temperature_table = Table(
'tf_temperatures', metadata,
Column('id', Integer, primary_key=True),
Column('temperature', Float, nullable=False),
Column('datetime',DateTime, default=datetime.now))
metadata.create_all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment