Add Field->addQualifier() function; update deps; update README
This commit is contained in:
10
README.md
10
README.md
@@ -1,12 +1,16 @@
|
|||||||
# 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://git.bitbadger.solutions/bit-badger/BitBadger.Documents) library.
|
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.
|
||||||
|
|
||||||
## Add via Composer
|
## Add via Composer
|
||||||
|
|
||||||
[](https://packagist.org/packages/bit-badger/pdo-document)
|
[](https://packagist.org/packages/bit-badger/pdo-document#v1.2.0)
|
||||||
|
|
||||||
`composer require bit-badger/pdo-document`
|
`composer require bit-badger/pdo-document:^1`
|
||||||
|
|
||||||
|
This version requires PHP 8.2 or greater.
|
||||||
|
|
||||||
|
v1.2 adds a `Field->andQualifier()` function to modify the qualifier for a field and return the same instance.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
|||||||
655
composer.lock
generated
655
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -121,6 +121,18 @@ 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=('13' '14' '15' '16' 'latest')
|
PG_VERSIONS=('14' '15' '16' '17' 'latest')
|
||||||
|
|
||||||
for PG_VERSION in "${PG_VERSIONS[@]}"
|
for PG_VERSION in "${PG_VERSIONS[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -192,6 +192,12 @@ 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