Connect to PostgreSQL Using SQLAlchemy & Python

preview_player
Показать описание
Learn how to connect to a PostgreSQL database using Python and SQLAlchemy.

Note: If you want the database to be created automatically, you'll need to grant the user superpowers from within Postgres: =# ALTER USER alpha WITH SUPERUSER;

0:24 Open Jupyter Notebook
1:20 What is SQLAlchemy?
2:26 Import SQLAlchemy
3:05 Import Connection Settings
3:52 Create SQLAlchemy Engine Function
5:05 Create SQLAlchemy Engine
7:13 Create SQLAlchemy Session Function
7:45 Create SQLAlchemy Session

#postgresql
#sqlalchemy
#python

---
---
Рекомендации по теме
Комментарии
Автор

Is there a way to work with the connected database or table with pyspark instead of pandas?

I would like to store the accessed database into a variable in which I can apply modifications directly through jupyter notebook

ronaldososa
Автор

Why is pool_size required in the create_engine method any particular importance for it?could anyone mention about it

saikrishnavemula
Автор

nice video man, i can see you have a lot of experience :-)

UnpluggedPerformance
Автор

Couple things:
1. First off nice video, I like what you're putting out!
2. From 5:45 onward you kind of stopped explaining the reasoning for what you were doing and WHY you were doing it. Maybe consider going more into depth of what was what after that timestamp.
3. (This is a minor thing) you often had your current code at the bottom of the video and the youtube playbar is often in the way. Maybe try to keep whatever you're working on in the middle of the screen.
4. Please continue putting out more of this type of content! thanks

redplazma
Автор

I have the error: "from sqlalchemy_utils import database_exists, create_database" name 'database_exists' is not defined

okgoogle
Автор

I am trying this on my chromebook. Completed this first tutorial just fine except since the linux subsystem on chromebook does not have systemctl the sudo -i -u postgres command gives an error. But everything works. Curious to see if I can complete the whole series. Should be able to. Thanks for your work and you have a nice pace and a good voice for this.

JoelBerman
Автор

I seem to be having trouble with importing the PostgreSQL name with the database credentials from the local_settings.py file. Any recommendations on this problem?

johnwithers
Автор

Hi, how do you ensure the session/connections gets closed?

Kerni
Автор

I'm having problems importing psql module. What package do I need to install to access it?

krestenbuch
Автор

I receiver this error when trying to import postgresql as settings No module named ‘Local_setting’

dilan_caro
Автор

Such a big code just to use a password.

jacquelingonza
Автор

Might I suggest that you read-up on ~/.pgpass?

palevell
join shbcf.ru