-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Create php.md * Create .gitignore * Add files via upload * Update composer.json * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update composer.json * Update Compiler.php * Update prql-php/.gitignore Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> * Add composer lock file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Create test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update composer.json * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update composer.json * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Uncomment unit tests * Pass test dir as args * Bootstrap the autoloader * Build library and copy library file * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Update test-php.yaml * Add more unit tests * Update CompilerTest.php * Update test-php.yaml * Update CompilerTest.php * Update test-php.yaml * Add test-php * Add concurrency thing Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> * Remove php-actions/phpunit * Update .github/workflows/test-php.yaml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Co-authored-by: Maximilian Roos <m@maxroos.com>
- Loading branch information
1 parent
cab50cc
commit 4a8b915
Showing
11 changed files
with
1,846 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,42 @@ | ||
name: test-php | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "prql-php/**" | ||
- ".github/workflows/test-php.yaml" | ||
workflow_call: | ||
|
||
concurrency: | ||
# See notes in `pull-request.yaml` | ||
group: ${{ github.workflow }}-${{ github.ref }}-php | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: 📂 Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- run: cargo build | ||
working-directory: prql-lib | ||
- run: | | ||
mv ../target/debug/libprql_lib.so ../prql-php/src/libprql_lib.so | ||
ls -l ../target/debug/ | ||
uname -a | ||
ls -lR ../prql-php/ | ||
working-directory: prql-lib | ||
- name: 📦 Install dependencies using Composer | ||
uses: php-actions/composer@v6 | ||
with: | ||
args: --working-dir=prql-php | ||
php_extensions: FFI | ||
- name: 🧪 Run tests using PHPUnit | ||
run: vendor/bin/phpunit tests | ||
working-directory: prql-php |
This file contains 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 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 @@ | ||
{{#include ../../../prql-php/README.md}} |
This file contains 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 @@ | ||
/vendor |
This file contains 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,25 @@ | ||
# prql-php | ||
|
||
`prql-php` offers PHP bindings through FFI. | ||
|
||
It provides the `Compiler` class which contains the `toJson` and `toSql` | ||
methods. | ||
|
||
It's still at an early stage, and isn't published to Composer. Contributions are | ||
welcome. | ||
|
||
## Installation | ||
|
||
The [PHP FFI extension](https://www.php.net/manual/en/book.ffi.php) needs to be | ||
enabled. Set `ffi.enable` in your php.ini configuration file to `"true"`. | ||
|
||
## Usage | ||
|
||
```php | ||
<?php | ||
|
||
use Prql\Compiler\Compiler; | ||
|
||
$prql = new Compiler(); | ||
$result = $prql->toSql("from employees"); | ||
``` |
This file contains 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,37 @@ | ||
{ | ||
"name": "prql/compiler", | ||
"description": "PRQL compiler bindings.", | ||
"keywords": [ | ||
"prql", | ||
"sql" | ||
], | ||
"homepage": "https://prql-lang.org/", | ||
"type": "library", | ||
"license": "Apache-2.0", | ||
"autoload": { | ||
"psr-4": { | ||
"Prql\\Compiler\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Prql\\Tests\\": "tests/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Jonathan" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/PRQL/prql/issues", | ||
"source": "https://github.com/PRQL/prql", | ||
"docs": "https://prql-lang.org/book/" | ||
}, | ||
"require": { | ||
"ext-ffi": "*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^10" | ||
} | ||
} |
Oops, something went wrong.