lapaygroup/doctrine-cockroachdb

Doctrine CockroachDB Driver (Symfony supports)

0.2.0 2021-08-01 12:35 UTC

This package is auto-updated.

Last update: 2024-07-13 17:33:48 UTC


README




Latest Stable Version Total Downloads License

CockroachDB Driver

Driver for supports CockroachDB in Doctrine DBAL. This library fixes errors related doctrine:migrations when using PostgreSQL driver.

Serverless connection URL format: //clouduser:cloudpass@free-tier7.aws-eu-west-1.cockroachlabs.cloud:26257/clustername.dbname

Symfony configuration example:

# doctrine.yaml
doctrine:
    dbal:
        user: root
        port: 26257
        host: localhost
        dbname: database_name
        platform_service: LapayGroup\DoctrineCockroach\Platforms\CockroachPlatform
        driver_class: LapayGroup\DoctrineCockroach\Driver\CockroachDriver
        
    # Serverless example
    dbal:
        user: wildtuna
        password: password
        port: 26257
        host: free-tier7.aws-eu-west-1.cockroachlabs.cloud
        dbname: lapaygroup-test-869.defaultdb
        platform_service: LapayGroup\DoctrineCockroach\Platforms\CockroachPlatform
        driver_class: LapayGroup\DoctrineCockroach\Driver\CockroachDriver

Connection url style:

# doctrine.yaml
doctrine:
    dbal:
        url: //root:@localhost:26257/database_name
        platform_service: LapayGroup\DoctrineCockroach\Platforms\CockroachPlatform
        driver_class: LapayGroup\DoctrineCockroach\Driver\CockroachDriver
        
    # Serverless example    
    dbal:
        url: '//wildtuna:password@free-tier7.aws-eu-west-1.cockroachlabs.cloud:26257/lapaygroup-test-869.defaultdb'
        platform_service: LapayGroup\DoctrineCockroach\Platforms\CockroachPlatform
        driver_class: LapayGroup\DoctrineCockroach\Driver\CockroachDriver     
# services.yaml
services:
  LapayGroup\DoctrineCockroach\Platforms\CockroachPlatform:
    autowire: true

  LapayGroup\DoctrineCockroach\Driver\CockroachDriver:
    autowire: true

  LapayGroup\DoctrineCockroach\Schema\CockroachSchemaManager:
    autowire: true