From colab directly manipulate sqlite3 format data in Google drive

依然范特西╮ 提交于 2019-12-21 01:57:31

问题


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:

  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.



回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!