ipython-sql icon indicating copy to clipboard operation
ipython-sql copied to clipboard

(question) sqlite - path with spaces or r-strings

Open mglatz opened this issue 4 years ago • 1 comments

how do I connect to sqlite db (on win) if the path contains spaces? %sql sqlite:///c:\\tmp tmp\\db.db3 does not work - (sqlite3.OperationalError) near "tmp": syntax error

can I somehow use s r-strings , such as %sql r'sqlite:///c:\tmp tmp\db.db3'

or even connect to path stored in a variable file_name = r'c:\tmp tmp\db.db3' %sql sqlite:/// + file_name

thanks

mglatz avatar Jun 26 '20 08:06 mglatz

I have the same question. I was going to create a new issue but I encountered this link.

The question remains same. How to connect to the local database file mydb.db which is located inside a folder which have spaces in it.

For example:

%sql sqlite:////c/Users/MyUsername/OneDrive - MyCompany/myfolder/subfolder/mydb.db

How to escape the whitespaces in One drive folder?

Note: I am working on Windows Platform.

bhishanpdl avatar Mar 14 '22 20:03 bhishanpdl