Skip to content

lapaygroup/doctrine-cockroachdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation




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:[email protected]: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:[email protected]: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