From the course: Advanced SQL for Application Development
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Query with SQLAlchemy
From the course: Advanced SQL for Application Development
Query with SQLAlchemy
- [Instructor] Hey, in this video we're going to take a look at what it's like to actually work with SQLAlchemy to query some of our tables. And in particular actually we'll just query one. We're going to take a look at working with the products table. So the first thing I want to do is import the libraries that we're going to need because we are working with Pythons. So we'll import some drivers here. First of all we'll import a driver for working with the PostgreSQL database and we'll use the same one we've used before and I'm also storing username and password in environment variables. So I'm going to get the operating system package as well so I can look those up. And then I'm going to get a few things from SQLAlchemy. So rather than import all of SQLAlchemy, I'm going to import just the stuff that I need. And the first thing I'm going to do is import the create engine function and create engine allows us to basically…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Overview of object-relational mapping1m 23s
-
Introduction to SQLAlchemy3m 5s
-
(Locked)
Installing SQLAlchemy1m 20s
-
(Locked)
Query with SQLAlchemy9m 47s
-
(Locked)
Limitations of ORM and cautionary advice2m 10s
-
(Locked)
Challenge: Create an ORM model37s
-
(Locked)
Solution: Create an ORM model54s
-
(Locked)
-
-
-
-