Python SQLite database connection and managing by using colab platform and mounting drive

Published: 29 December 2020
on channel: plus2net
11,606
114

https://www.plus2net.com/python/sqlit...

List of all Python SQLite tutorials

https://www.plus2net.com/python/pytho...


As SQLite is a file based database and there is no client server network system, to manage this we can use google drive to keep our database file and connect to it from our Colab platform. For this we need to mount the google drive to our colab platform. Run this code in your Jupiter notebook to mount google drive. from google.colab import drive drive.mount('/content/drive') Now google will ask for authorization, this can be given by using following the link and using the authorization code. After mounting the drive we can copy the path of the database file and then use the path to connect to SQLite database by using SQLalchem library. After successful connection we can run the code below to check the tables available in our database file. r_set=my_conn.execute('''select name from sqlite_master where type = 'table' ''') for row in r_set: print(row) This will list all the tables available. Let us run this code to get all records of student table. r_set=my_conn.execute('''SELECT * from student'''); for row in r_set: print(row)


On this page of the site you can watch the video online Python SQLite database connection and managing by using colab platform and mounting drive with a duration of hours minute second in good quality, which was uploaded by the user plus2net 29 December 2020, share the link with friends and acquaintances, this video has already been watched 11,606 times on youtube and it was liked by 114 viewers. Enjoy your viewing!