Created
August 3, 2018 14:14
-
-
Save rupesh2017/9699de402586ad092669ef638fb9dc30 to your computer and use it in GitHub Desktop.
to view database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
engine = create_engine(os.getenv("DATABASE_URL")) | |
db = scoped_session(sessionmaker(bind=engine)) | |
def main(): | |
flights = db.execute("SELECT userid FROM A").fetchall() | |
for flight in flights: | |
print(f"{flight.userid}") | |
#print(flight) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment