Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Unable to open db file when db file is in a different disk partition than application path #7

Open
J-F-Liu opened this issue Jan 7, 2013 · 0 comments

Comments

@J-F-Liu
Copy link

J-F-Liu commented Jan 7, 2013

For example, application runs on "d:/website/app", db file is in "e:/data/erp_development.db"
then the connection string becomes:

sqlite3:e/data/erp_development.db?scheme=sqlite3&user=&pas
sword=&host=e&port=&query=&fragment=&adapter=sqlite3&path=/data/erp_development.db

I fixed this issue by add the following line into dm-sqlite-adapter/adapter.rb file inside normalize_options(options) method:

#added code
if options[:host]
  path = options[:host] + ':' + path
end

#orginal code
options.update(:adapter => 'sqlite3', :path => path)

Then the connection string becomes:

sqlite3:ee:/data/erp_development.db?scheme=sqlite3&user=&pas
sword=&host=e&port=&query=&fragment=&adapter=sqlite3&path=e:/data/erp_development.db

and it works!

So do you think the added code will break other scenarios or it fixes a general issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant