-
Notifications
You must be signed in to change notification settings - Fork 3
Database configuration and migration #42
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
Draft
JanJakes
wants to merge
36
commits into
develop
Choose a base branch
from
driver-migration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6a641f9
Implement a database configurator service for DB initialization and m…
JanJakes 12d3063
Implement more robust plugin version definition and CI check
JanJakes 9a6da9d
Load AST classes for tests in test bootstrap
JanJakes 7727cfa
Implement information schema reconstructor
JanJakes 23331b3
Reconstruct WordPress tables using "wp_get_db_schema" function
JanJakes ed959fb
Avoid race conditions when configuring the SQLite database
JanJakes 287f4f4
Improve docs
JanJakes 907be69
Fix identifier unquoting
JanJakes b178b97
In WordPress, make sure the "wp_get_db_schema()" function is defined
JanJakes 5edd7f7
Filter out reserved tables using LIKE
JanJakes 5dddd50
Improve the clarity of primary key reconstruction
JanJakes 95b1a19
Document SQLite column affinity inline
JanJakes 51b22fa
Do not acquire an exclusive lock for every version check, lock only c…
JanJakes d904064
Fix $wpdb dependency loop when using schema reconstructor in WP
JanJakes 69381d8
Add support for multi-query parsing
JanJakes cde7da8
Store and expose byte start and length in tokens and nodes
JanJakes 0283884
Parse queries from "wp_get_db_schema()"
JanJakes e657ad0
Pass input in tokens and get token values lazily
JanJakes 30c8212
Move multi-query parsing to WP_MySQL_Parser, improve naming and docs
JanJakes 6a3b370
Return parser instance rather than a generator
JanJakes 1121fcc
Refactor and document key column definition inference
JanJakes 231bab2
Refactor and document key definition inference
JanJakes be2841d
Improve and document default column value detection
JanJakes fd55809
Extract WP schema to a method, improve naming and docs
JanJakes baa22c3
For multisite installs, reconstruct WP schema for all sites
JanJakes c67f6c4
Refactor default value handling, add escaping and tests
JanJakes 959505e
Fix schema inference for WordPress tables
JanJakes d1dfd2c
Fix removing schema records for non-existent tables
JanJakes 859fb9f
Improve CI job name
JanJakes 94e582c
Always quote identifiers in driver and reconstructor
JanJakes b0009d6
Extract SQLite connection management to WP_SQLite_Connection
JanJakes 1d284e6
Consolidate SQLite identifier escaping in WP_SQLite_Connection, impro…
JanJakes 4df273e
Fix and refactor test setup
JanJakes 838967a
Always quote identifiers in information schema builder
JanJakes c745a66
Unify quoting also for $wpdb->blogs table name
JanJakes 9b21ab3
Fix parser API, explicitly disable multi-queries in WP_SQLite_Driver:…
JanJakes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Verify plugin version | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
verify-version: | ||
name: Assert the WordPress plugin header declares the same version as the SQLITE_DRIVER_VERSION constant | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract version from "load.php" | ||
id: load_version | ||
run: | | ||
VERSION=$(grep "Version:" load.php | sed "s/.*Version: \([^ ]*\).*/\1/") | ||
echo "load_version=$VERSION" >> $GITHUB_OUTPUT | ||
|
||
- name: Extract version from "version.php" | ||
id: const_version | ||
run: | | ||
VERSION=$(php -r "require 'version.php'; echo SQLITE_DRIVER_VERSION;") | ||
echo "const_version=$VERSION" >> $GITHUB_OUTPUT | ||
|
||
- name: Compare versions | ||
run: | | ||
if [ "${{ steps.load_version.outputs.load_version }}" != "${{ steps.const_version.outputs.const_version }}" ]; then | ||
echo "Version mismatch detected!" | ||
echo " load.php version: ${{ steps.load_version.outputs.load_version }}" | ||
echo " version.php constant: ${{ steps.const_version.outputs.const_version }}" | ||
exit 1 | ||
fi |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit – how about heredoc or nowdoc to make it a bit more readable for humans?