Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider explicit support for sqlite as database type #6147

Open
rfay opened this issue May 2, 2024 · 6 comments
Open

Consider explicit support for sqlite as database type #6147

rfay opened this issue May 2, 2024 · 6 comments

Comments

@rfay
Copy link
Member

rfay commented May 2, 2024

Is your feature request related to a problem?

There are folks that use sqlite3 as the database type right in the web container.

This is especially common in testing in the Drupal world.

We could support it directly, just by managing the settings and proposing a location for the sqlite file.

Describe your solution

Add database: sqlite and then provide default settings for it, for example, settings.ddev.php

Describe alternatives

No response

Additional context

No response

@rfay rfay changed the title Consider support for sqlite as database type Consider explicit support for sqlite as database type May 13, 2024
@alexb7217
Copy link
Sponsor

I found this looking for DDEV sqlite support for a plain old PHP project.

I saw the Drupal specific answer here for non-explicit sqlite support: https://stackoverflow.com/questions/74811671/how-to-install-drupal-9-using-sqlite-on-ddev

It would be pretty cool if DDEV had built in sqlite support.

@rfay
Copy link
Member Author

rfay commented Jun 7, 2024

Since sqlite is just a file, it's already easy to use for any project, but having DDEV consider it as an actual database type has potential as well.

What would you be using it for in the end? I'm always suspicious of sqlite because it basically has no place in production...

@alexb7217
Copy link
Sponsor

@rfay literally just for development and testing quick things. :)

@rfay
Copy link
Member Author

rfay commented Jun 7, 2024

You can already do that so very easily; it's just that you're the one that has to create the settings. What CMS or Framework would you be using?

DDEV does have sqlite support built in. It just doesn't create settings files for you that include that database type, so you're responsible for your own settings.

@alexb7217
Copy link
Sponsor

I'm probably just a little daft when it comes to DDEV settings. It is easy to set up sqlite as is. Right now I'm just making stuff with PHP, no CMS.

@rfay
Copy link
Member Author

rfay commented Jun 8, 2024

For explicitly supported CMSs, DDEV tries to create relevant settings files. For you, that's not the case. You'll use PHP's facilities and use PHP as shown in the manual, https://www.php.net/manual/en/book.sqlite3.php - The target is just a file, but its location is inside the container. It's this easy: https://stackoverflow.com/questions/5041737/how-to-connect-to-a-sqlite3-db-with-php

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

No branches or pull requests

2 participants