Compare commits
7 Commits
v2.2.0
...
03a4eccf85
| Author | SHA1 | Date | |
|---|---|---|---|
| 03a4eccf85 | |||
| 300e57a8f8 | |||
| ce45b8f697 | |||
| 07c46fe668 | |||
| 472fde5a9a | |||
| f9326c272a | |||
| 46b079b237 |
14
README.md
14
README.md
@@ -1,21 +1,17 @@
|
|||||||
# PDODocument
|
# PDODocument
|
||||||
|
|
||||||
This library allows SQLite and PostgreSQL to be treated as document databases. It is a PHP implementation of the .NET [BitBadger.Documents](https://relationaldocs.bitbadger.solutions/dotnet/) library.
|
This library allows SQLite and PostgreSQL to be treated as document databases. It is a PHP implementation of the .NET [BitBadger.Documents](https://git.bitbadger.solutions/bit-badger/BitBadger.Documents) library.
|
||||||
|
|
||||||
## Add via Composer
|
## Add via Composer
|
||||||
|
|
||||||
[
|
[
|
||||||
](https://packagist.org/packages/bit-badger/pdo-document#v1.2.0) [
|
](https://packagist.org/packages/bit-badger/pdo-document#v1.1.0-rc1) [
|
||||||
](https://packagist.org/packages/bit-badger/pdo-document#v2.2.0)
|
](https://packagist.org/packages/bit-badger/pdo-document)
|
||||||
|
|
||||||
`composer require bit-badger/pdo-document:^2`
|
`composer require bit-badger/pdo-document`
|
||||||
|
|
||||||
_(Version 2 requires PHP 8.4 or greater.)_
|
|
||||||
|
|
||||||
For the v1 series, the `DocumentList` type's members `hasItems` and `items` are functions; in the v2 series, they are properties. Additionally, the `Option` and `Result` types included in the project have a similar difference; see the [v1 README](https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp/src/branch/v1/README.md) for PHP 8.2 or 8.3 and the [v2 README](https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp/src/branch/main/README.md) for PHP 8.4. Both versions are supported; the v1 / v2 distinction helps composer make the right choice based on the target PHP version of your project.
|
For the v1 series, the `DocumentList` type's members `hasItems` and `items` are functions; in the v2 series, they are properties. Additionally, the `Option` and `Result` types included in the project have a similar difference; see the [v1 README](https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp/src/branch/v1/README.md) for PHP 8.2 or 8.3 and the [v2 README](https://git.bitbadger.solutions/bit-badger/inspired-by-fsharp/src/branch/main/README.md) for PHP 8.4. Both versions are supported; the v1 / v2 distinction helps composer make the right choice based on the target PHP version of your project.
|
||||||
|
|
||||||
v1.2 and v2.2 add a `Field->andQualifier()` function to modify the qualifier for a field and return the same instance.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
### Connection Details
|
### Connection Details
|
||||||
|
|||||||
662
composer.lock
generated
662
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -121,18 +121,6 @@ class Field
|
|||||||
: $fieldPath . ' ' . $this->op->toSQL() . $criteria;
|
: $fieldPath . ' ' . $this->op->toSQL() . $criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a qualifier for the field, returning the modified field
|
|
||||||
*
|
|
||||||
* @param string $qualifier The table qualifier to use for the field
|
|
||||||
* @return Field The field instance with the qualifier set
|
|
||||||
*/
|
|
||||||
public function andQualifier(string $qualifier): Field
|
|
||||||
{
|
|
||||||
$this->qualifier = $qualifier;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create parameter names for an IN clause
|
* Create parameter names for an IN clause
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export PDO_DOC_PGSQL_HOST=localhost:8301
|
export PDO_DOC_PGSQL_HOST=localhost:8301
|
||||||
PG_VERSIONS=('14' '15' '16' '17' 'latest')
|
PG_VERSIONS=('13' '14' '15' '16' 'latest')
|
||||||
|
|
||||||
for PG_VERSION in "${PG_VERSIONS[@]}"
|
for PG_VERSION in "${PG_VERSIONS[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -192,12 +192,6 @@ describe('->toWhere()', function () {
|
|||||||
})->group('sqlite');
|
})->group('sqlite');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('->andQualifier()', function() {
|
|
||||||
test('adds a qualifier', function () {
|
|
||||||
expect(Field::equal('that', '82')->andQualifier('this'))->qualifier->toBe('this');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('::equal()', function () {
|
describe('::equal()', function () {
|
||||||
test('creates Field w/o parameter', function () {
|
test('creates Field w/o parameter', function () {
|
||||||
$field = Field::equal('my_test', 9);
|
$field = Field::equal('my_test', 9);
|
||||||
|
|||||||
Reference in New Issue
Block a user