Skip to content

Make Multiple Connections Share the Main Settings #100

@mikkoi

Description

@mikkoi

I have the following parameters in development.yml:

plugins:
    Database:
        connections:
            rw:
                driver: SQLite
                database: 'db.sqlite'
                dbi_params:
                    RaiseError: 1
                    AutoCommit: 1
                    ReadOnly: 0
                    TaintIn: 1
                    TaintOut: 1
                    RaiseError: 1
                    PrintError: 1
                    printWarn: 1
                on_connect_do: [ "PRAGMA foreign_keys = ON" ]
                log_queries: 1
            r:
                driver: SQLite
                database: 'db.sqlite'
                dbi_params:
                    RaiseError: 1
                    AutoCommit: 1
                    ReadOnly: 1
                    TaintIn: 1
                    TaintOut: 1
                    RaiseError: 1
                    PrintError: 1
                    printWarn: 1
                log_queries: 1

I would instead like to share the common parameters, like this:

plugins:
    Database:
        driver: SQLite
        database: 'db.sqlite'
        dbi_params:
            RaiseError: 1
            AutoCommit: 1
            TaintIn: 1
            TaintOut: 1
            RaiseError: 1
            PrintError: 1
            printWarn: 1
        log_queries: 1
        connections:
            rw:
                dbi_params:
                    ReadOnly: 0
                on_connect_do: [ "PRAGMA foreign_keys = ON" ]
            r:
                dbi_params:
                    ReadOnly: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions