From the course: Using SQL with Python

Unlock the full course today

Join today to access over 23,300 courses taught by industry experts.

Adding CRUD methods

Adding CRUD methods

- [Instructor] Now that we have a library of SQL methods it's time to add our CRUD methods. This is BWDB.py from chapter two of the EerciseFiles. And we've already gone through a lot of this in the previous movie, if you haven't watched that one, I strongly suggest that you do before you watch this one. Over here on the right, I have my structure opened up. We can get this by pressing Command + Y on a Mac or Alt + Y on a PC and I'm just going to open up my BWDB class here to help us navigate around. We're going to start with the init and you notice we've added a couple of properties here for table and column_names that's because with the way that the CRUD methods work, as they depend on particular tables being created in a particular way and so if we come down here to Main, you'll notice when we create our tables, our tables have an ID column, which is a primary key and it auto increments. And this is essential for the…

Contents