Skip to content

[Proposal Solution] Exception: SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute Could not analyze class Modules\Pdm\Models\PickingList\PickingListItem #25

@ijpatricio

Description

@ijpatricio

Hello @mpociot

Hope to find you well!

So, with DBAL, for SQL server, is needed to set some option. Already solver this before.
For such connections, to work out of the box, something similar to this will work.

protected function setNeededPdoSettings()
    {
        $connectionsSqlServer = [
            'x3db_v11',
            'roots_sql_server',
            'imos',
        ];

        collect($connectionsSqlServer)
            ->each(function ($item, $key) {
                config()->set("database.connections.{$item}.options",[
                    \PDO::ATTR_PERSISTENT => true
                ]);
            });

    }

It puts that option on the fly, for the current execution.
I could rewrite above snipper to apply such setting to every SQL Server connection, and make a PR.
What do you think?

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