问题
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.
回答1:
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:
- Installing the Drive FUSE wrapper in the Colab VM.
- Authenticating to Drive and mounting your Drive using the FUSE wrapper.
- Listing and creating files in the newly mounted Drive-backed filesystem.
回答2:
I don't think it's possible.
The notebook is run on a new VM which cannot directly read/seek/write the sqlite file. It can only download/upload the whole file using Drive API.
On Android, you can do this through Google Drive Android API, but not here on a normal VM.
来源:https://stackoverflow.com/questions/47374971/from-colab-directly-manipulate-sqlite3-format-data-in-google-drive