"2020-12-24 16:56:29,442 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)\n",
"2020-12-24 16:56:29,449 INFO sqlalchemy.engine.base.Engine INSERT INTO users (name, fullname, nickname) VALUES (?, ?, ?)\n",
"2020-12-24 16:56:29,450 INFO sqlalchemy.engine.base.Engine ('ed', 'Ed Jones', 'edsnickname')\n",
"2020-12-24 16:56:29,452 INFO sqlalchemy.engine.base.Engine SELECT users.id AS users_id, users.name AS users_name, users.fullname AS users_fullname, users.nickname AS users_nickname \n",
"FROM users \n",
"WHERE users.name = ?\n",
" LIMIT ? OFFSET ?\n",
"2020-12-24 16:56:29,455 INFO sqlalchemy.engine.base.Engine ('ed', 1, 0)\n"
"2020-12-24 16:56:29,513 INFO sqlalchemy.engine.base.Engine UPDATE users SET nickname=? WHERE users.id = ?\n",
"2020-12-24 16:56:29,514 INFO sqlalchemy.engine.base.Engine ('eddie', 1)\n",
"2020-12-24 16:56:29,515 INFO sqlalchemy.engine.base.Engine INSERT INTO users (name, fullname, nickname) VALUES (?, ?, ?)\n",
"2020-12-24 16:56:29,520 INFO sqlalchemy.engine.base.Engine ('wendy', 'Wendy Williams', 'windy')\n",
"2020-12-24 16:56:29,521 INFO sqlalchemy.engine.base.Engine INSERT INTO users (name, fullname, nickname) VALUES (?, ?, ?)\n",
"2020-12-24 16:56:29,521 INFO sqlalchemy.engine.base.Engine ('mary', 'Mary Contrary', 'mary')\n",
"2020-12-24 16:56:29,522 INFO sqlalchemy.engine.base.Engine INSERT INTO users (name, fullname, nickname) VALUES (?, ?, ?)\n",
"2020-12-24 16:56:29,523 INFO sqlalchemy.engine.base.Engine ('fred', 'Fred Flintstone', 'freddy')\n",
"2020-12-24 16:56:29,525 INFO sqlalchemy.engine.base.Engine COMMIT\n"
]
}
],
"source": [
"session.commit()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2020-12-24 16:56:29,534 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)\n",
"2020-12-24 16:56:29,538 INFO sqlalchemy.engine.base.Engine SELECT users.id AS users_id, users.name AS users_name, users.fullname AS users_fullname, users.nickname AS users_nickname \n",
"FROM users \n",
"WHERE users.id = ?\n",
"2020-12-24 16:56:29,539 INFO sqlalchemy.engine.base.Engine (1,)\n"
"2020-12-24 16:56:29,569 INFO sqlalchemy.engine.base.Engine UPDATE users SET name=? WHERE users.id = ?\n",
"2020-12-24 16:56:29,571 INFO sqlalchemy.engine.base.Engine ('Edwardo', 1)\n",
"2020-12-24 16:56:29,573 INFO sqlalchemy.engine.base.Engine INSERT INTO users (name, fullname, nickname) VALUES (?, ?, ?)\n",
"2020-12-24 16:56:29,573 INFO sqlalchemy.engine.base.Engine ('fakeuser', 'Invalid', '12345')\n",
"2020-12-24 16:56:29,576 INFO sqlalchemy.engine.base.Engine SELECT users.id AS users_id, users.name AS users_name, users.fullname AS users_fullname, users.nickname AS users_nickname \n",
"FROM users \n",
"WHERE users.name IN (?, ?)\n",
"2020-12-24 16:56:29,580 INFO sqlalchemy.engine.base.Engine ('Edwardo', 'fakeuser')\n"
"2020-12-24 16:56:29,591 INFO sqlalchemy.engine.base.Engine ROLLBACK\n",
"2020-12-24 16:56:29,594 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)\n",
"2020-12-24 16:56:29,596 INFO sqlalchemy.engine.base.Engine SELECT users.id AS users_id, users.name AS users_name, users.fullname AS users_fullname, users.nickname AS users_nickname \n",
"FROM users \n",
"WHERE users.id = ?\n",
"2020-12-24 16:56:29,597 INFO sqlalchemy.engine.base.Engine (1,)\n",
"ed\n",
"False\n"
]
}
],
"source": [
"session.rollback()\n",
"print(ed_user.name)\n",
"print(fake_user in session)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2020-12-24 16:56:29,607 INFO sqlalchemy.engine.base.Engine SELECT users.id AS users_id, users.name AS users_name, users.fullname AS users_fullname, users.nickname AS users_nickname \n",
"FROM users \n",
"WHERE users.name IN (?, ?)\n",
"2020-12-24 16:56:29,611 INFO sqlalchemy.engine.base.Engine ('ed', 'fakeuser')\n"