flexic / doctrine-pg-similarity
Provides Doctrine DQL function for similarity in Postgres DB's.
Installs: 5 448
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- doctrine/orm: ^2.14
Requires (Dev)
- ergebnis/php-cs-fixer-config: ^4.9.0
README
Install
1.) Run
composer require flexic/doctrine-pg-similarity
to install flexic/doctrine-pg-similarity
package.
2.) Enable extension in your Postgres database by running
CREATE EXTENSION pg_trgm;
3.) Configure DQL
function for doctrine:
Configuration for Symfony:
doctrine: orm: dql: string_functions: SIMILARITY: \Flexic\DoctrinePGSimilarity\SimilarityFunction
Configuration for Standalone Doctrine:
$config->addCustomStringFunction('SIMILARITY', \Flexic\DoctrinePGSimilarity\SimilarityFunction::class);
Minimum requirements
PostgreSQL > 9.1
doctrine/orm > 2.14