using pydal to connect to app in standalone mode

63 views
Skip to first unread message

Ron Chatterjee

unread,
Apr 17, 2015, 6:47:42 PM4/17/15
to web...@googlegroups.com

from pydal import DAL, Field


db = DAL('sqlite://storage.sqlite',folder='C:....\web2py\applications\my_app_name\databases',auto_import=True);

in my application models/db.py I have my database definition.

I can't connect through pydal. I get an error:

  return self.driver.Connection(dbpath, **driver_args)
OperationalError: unable to open database file


Am I missing something? Basically trying to use pydal as a standalone to load existing database. If it is even possible.  

Massimo Di Pierro

unread,
Apr 17, 2015, 10:33:11 PM4/17/15
to web...@googlegroups.com
This should be possible. This is the purpose of pydal. Perhaps the file truly corrupted or the folder is missing/incorrect?

Ron Chatterjee

unread,
Apr 17, 2015, 11:31:38 PM4/17/15
to web...@googlegroups.com
Found the issue:

Its about having the folder location in windows way as oppose to linux/unix. If I use fwd slash, instead backwards. It works.

Sorry.
Reply all
Reply to author
Forward
0 new messages