We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have two configurations for database connections! In all configurations host, dbname, username and password are same value!
//Yii::$app->db return [ 'class' => 'yii\db\Connection', 'dsn' => 'pgsql:host=***;dbname=***', 'username' => '***', 'password' => '***', 'charset' => 'utf8', 'schemaMap' => [ 'pgsql' => [ 'class' => 'yii\db\pgsql\Schema', 'defaultSchema' => 'public' //specify your schema here, public is the default schema ] ], // PostgreSQL ];
and
//Yii::$app->db2 return [ 'class' => 'yii\db\Connection', 'dsn' => 'pgsql:host=***;dbname=***', 'username' => '***', 'password' => '***', 'charset' => 'utf8', 'schemaMap' => [ 'pgsql' => [ 'class' => 'yii\db\pgsql\Schema', 'defaultSchema' => 'public', //specify your schema here, public is the default schema 'columnSchemaClass' => [ 'class' => yii\db\pgsql\ColumnSchema::class, 'disableJsonSupport' => true, 'disableArraySupport' => true, 'deserializeArrayColumnToArrayExpression' => false, ], ] ], // PostgreSQL ];
In second configuration I disable disableJsonSupport and disableArraySupport! And I used like this:
$result1 = CountriesModel::find()->where(["id" => 1])->one(); $result2 = CountriesModel::find()->where(["id" => 1])->one(Yii::$app->db2); print_variable($result1->attributes); print_variable($result2->attributes);
Lonely result:
Array ( [id] => 1 [name] => Array ( [en] => Aruba [ru] => Aruba [uz] => Aruba ) [long_name] => Array ( [en] => Aruba [ru] => Aruba [uz] => Aruba ) [slug] => Array ( [en] => aruba [ru] => aruba [uz] => ) [iso2] => AW [iso3] => ABW [status] => 1 [created_at] => 2018-11-07 10:47:00 [updated_at] => 2018-11-19 12:27:26 )
Sorry my english! I use Google uncle :)
The text was updated successfully, but these errors were encountered:
@SilverFire looks like it's connected to the feature you've introduced. Mind taking a look?
Sorry, something went wrong.
No branches or pull requests
I have two configurations for database connections! In all configurations host, dbname, username and password are same value!
and
In second configuration I disable disableJsonSupport and disableArraySupport!
And I used like this:
Lonely result:
and
Sorry my english! I use Google uncle :)
The text was updated successfully, but these errors were encountered: