doctrs / stored-procedure-bundle
Symfony bundle for work with red-defender/pgfunc
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.6
- red-defender/pgfunc: >=0.2.0
- symfony/config: >=3.0
- symfony/dependency-injection: >=3.0
- symfony/event-dispatcher: >=3.0
- symfony/http-kernel: >=3.0
This package is not auto-updated.
Last update: 2025-03-22 05:55:16 UTC
README
Symfony bundle for pgfunc lib
Bundle for work with stored procedure through https://github.com/red-defender/pgfunc
You may create many connection and execute stored procedure throught one of them
Install
composer require doctrs/stored-procedure-bundle
Configuration
Create file config/packages/stored_procedure.yaml
and configure connections
stored_procedure:
connections:
api_master:
dbname: '%env(API_DB_MASTER_DBNAME)%'
host: '%env(API_DB_MASTER_HOST)%'
port: '%env(API_DB_MASTER_PORT)%'
user: '%env(API_DB_MASTER_USER)%'
admin_master:
dbname: '%env(ADMIN_DB_MASTER_DBNAME)%'
host: '%env(ADMIN_DB_MASTER_HOST)%'
port: '%env(ADMIN_DB_MASTER_PORT)%'
user: '%env(ADMIN_DB_MASTER_USER)%'
any_connection: ~
any_second_connection: ~
List of all configure variables
application_name
client_encoding
connect_timeout
dbname
fallback_application_name
gsslib
host
hostaddr
keepalives
keepalives_count
keepalives_idle
keepalives_interval
krbsrvname
options
passfile
port
requirepeer
requiressl
service
sslcert
sslcompression
sslcrl
sslkey
sslmode
sslrootcert
target_session_attrs
tty
Execute procedure
Procedure::execute(string $connectionName, \PgFunc\Procedure $procedure); ... $procedure = new Procedure('any_procedure_name'); $procedure->addParameters(...$parameters); ... return $container->get('doctrs.stored_procedure')->execute('api_master', $procedure);
Events
- stored_procedure.connection_name - Change connection name.
- stored_procedure.connection - Change connection class, and change Procedure class
- stored_procedure.result - Change result