Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Multiple Connections Share the Main Settings #100

Open
mikkoi opened this issue Apr 4, 2020 · 0 comments
Open

Make Multiple Connections Share the Main Settings #100

mikkoi opened this issue Apr 4, 2020 · 0 comments

Comments

@mikkoi
Copy link

mikkoi commented Apr 4, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant