News for hackers. Stuff that matters.
Re:Show HN: PugSQL, a Python Port of HugSQL by Scarbutt on Wednesday May 29, 2019 @01:36PM (#20043040)
Looks like sqlalchemy is just used for the "being able to handle multiple databases" part, not for its higher level abstractions.
Re:Show HN: PugSQL, a Python Port of HugSQL by michelpp on Wednesday May 29, 2019 @04:04PM (#20044734)
You may of course already be aware of this but it's worth pointing out. To many, SQLAlchemy is an ORM, but the SA developers very purposefully made the ORM layer completely optional. The SQLAlchamy-Core layer can be used to functionally compose queries without mapping types at all, and below that, SA can be used as an abstract but featureful generic client for executing just raw SQL.
Re:Show HN: PugSQL, a Python Port of HugSQL by Drdrdrq on Thursday May 30, 2019 @01:17AM (#20048610)
Thank you (and sibling for the example), I was not aware of that. I did check SA out, but missed this somehow, so I'm using psycopg2 directly now... But if I gain portability to other DBs for low effort, then I'm all for it. Thanks!
Re:Show HN: PugSQL, a Python Port of HugSQL by eshyong on Wednesday May 29, 2019 @02:20PM (#20043573)
FYI, you can also execute queries directly against a database in SQLAlchemy:

    engine = create_engine('mysql://scott:tiger@localhost/test')
    connection = engine.connect()
    result = connection.execute("select username from users")
    for row in result:
        print("username:", row['username'])
    connection.close()