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

Docs: Set config name to :memory: in docs example #2335

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

piotr-cz
Copy link
Contributor

@piotr-cz piotr-cz commented Dec 10, 2024

Without this:

  $configArray['environments']['test'] = [
      'adapter'    => 'sqlite',
      'connection' => $pdo,
+     'name' => ':memory:',
  ];

I'm getting error: Undefined array key "name" in vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php:207 here:

if ($options['name'] === self::MEMORY) {
return '';
}

as mentioned here:

... It is also important to pass the database name too, as Phinx requires this for certain methods such as hasTable():

and here:

... However remember to also pass the database name as Phinx cannot infer this from the PDO connection.

@MasterOdin MasterOdin merged commit fa2b585 into cakephp:0.x Dec 14, 2024
12 checks passed
@piotr-cz piotr-cz deleted the bugfix/set-db-name branch December 15, 2024 09:45
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

Successfully merging this pull request may close these issues.

2 participants