statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

FR: allow sqlite db location to be set in .env. #2343

Closed edalzell closed 5 years ago

edalzell commented 5 years ago

Is your feature request related to a problem? Please describe. Making an addon that uses a local sqlite db. Statamic will only "find" the db if it's in a hardcoded location, namely 'database' => storage_path().'/database.sqlite',

Describe the solution you'd like I'd like to be able to set the location, as the local directory is outside the site folder and often wiped.

Describe alternatives you've considered Made a Service Provider and hacked this in:

        app('config')->set(
            'database.connections.sqlite.database',
            Path::assemble(site_storage_path(), 'database.sqlite')
        );

Would you be willing to sponsor this feature? Nope

jasonvarga commented 5 years ago

That's a good workaround for v2. 👍 In v3 you can just edit the config.