Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.php'
- 'composer.json'
- 'packages/*/composer.json'
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
Expand All @@ -14,6 +15,7 @@ on:
paths:
- '**.php'
- 'composer.json'
- 'packages/*/composer.json'
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
Expand Down Expand Up @@ -55,6 +57,12 @@ jobs:
- name: Validate Composer installation
run: composer validate --no-check-all

- name: Validate Composer packages
run: |
composer --working-dir=packages/mysql-on-sqlite validate --strict --no-check-lock
composer --working-dir=packages/mysql-parser validate --strict --no-check-lock
composer --working-dir=packages/mysql-proxy validate --strict --no-check-lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/mysql-proxy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
php-version: '7.4'
coverage: none

- name: Configure monorepo dependency
run: >-
composer config repositories.mysql-on-sqlite
'{"type":"path","url":"../mysql-on-sqlite","options":{"versions":{"wordpress/mysql-on-sqlite":"3.0.0"}}}'
working-directory: packages/mysql-proxy

- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
Expand Down
339 changes: 339 additions & 0 deletions packages/mysql-on-sqlite/LICENSE

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions packages/mysql-on-sqlite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ At a glance:
Load the package and create a connection using a `mysql-on-sqlite` DSN:

```php
require_once __DIR__ . '/vendor/autoload.php';

// Use a PDO-like constructor.
$pdo = new WP_MySQL_On_SQLite(
'mysql-on-sqlite:path=/path/to/database.sqlite;dbname=app'
Expand Down Expand Up @@ -131,10 +133,10 @@ composer run test -- --filter testName
## Requirements

- **PHP:** 7.2+
- **PHP extensions:** `pdo`, `pdo_sqlite`, `pcre`
- **PHP extensions:** `pdo`, `pdo_sqlite`
- **SQLite:** 3.37.0+

## License

MySQL on SQLite is licensed under the
[GNU General Public License v2 or later](../../LICENSE).
[GNU General Public License v2 or later](LICENSE).
40 changes: 34 additions & 6 deletions packages/mysql-on-sqlite/composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
{
"name": "wordpress/mysql-on-sqlite",
"type": "library",
"name": "wordpress/mysql-on-sqlite",
"type": "library",
"description": "A PDO MySQL drop-in for running MySQL-based PHP applications on SQLite.",
"keywords": [ "database", "mysql", "pdo", "sql", "sqlite" ],
"homepage": "https://github.com/wordpress/sqlite-database-integration",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Contributors",
"homepage": "https://github.com/wordpress/sqlite-database-integration/graphs/contributors"
}
],
"support": {
"issues": "https://github.com/wordpress/sqlite-database-integration/issues",
"source": "https://github.com/wordpress/sqlite-database-integration"
},
"require": {
"php": ">=7.2",
"ext-pdo": "*",
"ext-pdo_sqlite": "*"
},
"autoload": {
"files": [
"src/load.php"
]
},
"require-dev": {
"phpunit/phpunit": "^8.5"
},
"config": {
"lock": false,
"sort-packages": true
},
"scripts": {
"test": "phpunit",
"bench-lexer": [
"@php tests/tools/run-lexer-benchmark.php",
"@php -d opcache.enable_cli=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing tests/tools/run-lexer-benchmark.php"
]
},
"require-dev": {
"phpunit/phpunit": "^8.5"
}
}
}
2 changes: 1 addition & 1 deletion packages/mysql-on-sqlite/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

require_once __DIR__ . '/wp-sqlite-schema.php';
require_once __DIR__ . '/../src/load.php';
require_once __DIR__ . '/../vendor/autoload.php';

// When on an older SQLite version, enable unsafe backward compatibility.
$sqlite_version = ( new PDO( 'sqlite::memory:' ) )->query( 'SELECT SQLITE_VERSION();' )->fetch()[0];
Expand Down
Loading
Loading