[6.x] Add SQLite production support#19149
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands Craft CMS 6’s SQLite support beyond the test suite into production-facing flows (installer, setup commands, requirement checks), by centralizing SQLite-specific connection normalization and DSN/requirements-checker configuration.
Changes:
- Added
ConnectionConfigto normalize SQLite connection configs (paths, pragmas, env-var cleanup, DSN generation) and to configureRequirementsChecker. - Updated installer + CLI DB credential flows to support SQLite (including creating the DB file when appropriate and removing server-only env vars).
- Updated install UI to allow selecting SQLite/MariaDB and to use driver-specific defaults.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yii2-adapter/tests/unit/helpers/FileHelper/FileHelperTest.php | Adjusts a Windows path test case to align with updated absolute-path handling. |
| tests/Unit/Database/ConnectionConfigTest.php | Adds unit coverage for SQLite config normalization, path normalization, and DSN generation. |
| tests/Unit/Console/DatabaseCredentialsCommandTest.php | Adds a test ensuring SQLite credentials don’t persist server env vars. |
| tests/TestCase.php | Normalizes configured DB connections in tests and ensures SQLite DB files exist when needed. |
| tests/Feature/Http/Controllers/InstallControllerTest.php | Expands installer tests for SQLite defaults, validation, and file creation behavior. |
| src/Utility/Utilities/SystemReport.php | Switches requirements DSN/config generation to ConnectionConfig::requirementsChecker(). |
| src/Support/File.php | Treats lowercase Windows drive letters as absolute paths. |
| src/Http/Middleware/CheckRequirements.php | Uses ConnectionConfig::requirementsChecker() instead of manually building DSNs. |
| src/Http/Controllers/Updates/UpdaterController.php | Uses ConnectionConfig::requirementsChecker() for server checks. |
| src/Http/Controllers/InstallController.php | Adds SQLite to supported drivers; adds driver defaults; validates/creates SQLite DB files; writes SQLite-appropriate env vars; handles db2 behavior for SQLite. |
| src/Database/DatabaseServiceProvider.php | Normalizes configured DB connections at registration; routes SQLite bulk ops to the default connection via ConnectionConfig. |
| src/Database/ConnectionConfig.php | New helper for SQLite normalization, path handling, DB file creation, requirements checker setup, and db2 bulk-ops wiring. |
| src/Console/Commands/Setup/DatabaseCredentialsCommand.php | Adds SQLite support to db-creds setup flow (prompts/env writing/testing/db2 handling). |
| src/Console/Commands/Install/InstallCommand.php | Uses the migration command class when invoking initial migrations. |
| resources/js/pages/install/Install.vue | Updates install form model to use driver defaults and pass them to DB fields. |
| resources/js/modules/install/components/InstallingScreen.vue | Switches install request to usePost + uses server-provided redirect URL. |
| resources/js/modules/install/components/DbFields.vue | Adds SQLite/MariaDB drivers and driver-specific field visibility/placeholders. |
| CHANGELOG.md | Notes addition of SQLite database support. |
…ion-support # Conflicts: # tests/Unit/EditionTest.php # tests/Unit/Element/ElementWrites/PropagateElementTest.php
…t' into feature/sqlite-production-support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We've had SQLite running the full Unit & Feature suite alongside MySQL and Postgres for a bit now, this brings SQLite support to the remaining parts of the codebase like the installer.
I'd still consider it experimental support, but this at least allows people to experiment with it