Add Python notes
This commit is contained in:
4
python/sqlalchemy/core.py
Normal file → Executable file
4
python/sqlalchemy/core.py
Normal file → Executable 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)
|
||||
|
||||
Reference in New Issue
Block a user