Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From colab directly manipulate sqlite3 format data in Google drive

From colaboratory, is it possible to directly manipulate sqlite 3 format data in google drive? It is possible if you upload it, but it is convenient to use it in google drive.

like image 973
Tadashi Nagao Avatar asked Nov 19 '17 08:11

Tadashi Nagao


People also ask

Can I store SQLite database on Google Drive?

Uploading-SQLite-Database-to-Google-Drive-in-AndroidCreate a new app in android studio. Register and "enable" "Google Drive Api" and Google Drive SDK. Create Java files- MainActivity. java and CloudBackup.

How do I use SQLite in Google Colab?

we are good to start using the SQLite DB. %%sqlcreate table sample(column_1 int, column_2 varchar);insert into sample values (1,'abc'),(2,'abcd');select * from sample; For those who prefer to deal setting up the database using a database tool, you can download the test. db file and connect it using a db tool.


1 Answers

You can do load files directory from Drive by mounting your Google Drive as a FUSE filesystem.

Here's an example: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q

There's no official Google Drive FUSE filesystem. But, several open-source FUSE + Drive libraries have been written by third parties. The example notebook above uses google-drive-ocamlfuse. The notebook shows three things:

  1. Installing the Drive FUSE wrapper in the Colab VM.
  2. Authenticating to Drive and mounting your Drive using the FUSE wrapper.
  3. Listing and creating files in the newly mounted Drive-backed filesystem.
like image 143
Bob Smith Avatar answered Sep 25 '22 02:09

Bob Smith