Not_Linked_In

SQLAlchemy Python library

SQLAlchemy - a Python library for working with SQL dbs. Works with SQLite, PostgreSQL, MySQL, Oracle, MS SQL Server, among others. Using with SQLite, as it is most applicable to my current studies.

Code Block Code Desc
from sqlalchemy import create_engine, text
engine = create_engine('sqlite:///./path/to/database.db',echo=True,future=True) Create the engine object
echo=True puts this into verbose mode
future=True future proofs the compiled code
For SQLite the path will be directory and file, for other dbs may be server IP and port
conn = engine.connect()
result = conn.execute(text('<raw SQL string>'))
for row in result: The 'result' object can be iterable
     print(row.col1)
conn.commit() Must commit the changes to write to table