Add Python notes

This commit is contained in:
2022-05-06 00:49:26 +03:00
parent 4c0cdb2f71
commit 1863176b39
57 changed files with 1205 additions and 5 deletions

4
python/sqlalchemy/core.py Normal file → Executable file
View File

@@ -64,7 +64,9 @@ with engine.begin() as conn:
# SELECT
from sqlalchemy import select
stmt = select(user_table).where(user_table.c.name == 'spongebob')
stmt = select(user_table).where(user_table.c.name == 'spongebob') # Where accepts binary expression
print('Where clause: ', user_table.c.name == 'spongebob')
print('Type of where clause: ', type(user_table.c.name == 'spongebob'))
with engine.connect() as conn:
for row in conn.execute(stmt):
print(row)