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

Publicado el: 29 diciembre 2020
en el canal de: 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)


En esta página del sitio puede ver el video en línea Python SQLite database connection and managing by using colab platform and mounting drive de Duración hora minuto segunda en buena calidad , que subió el usuario plus2net 29 diciembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 11,606 veces y le gustó 114 a los espectadores. Disfruta viendo!