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

PDO driver support #252

Open
boesing opened this issue Sep 26, 2024 · 0 comments · May be fixed by #253
Open

PDO driver support #252

boesing opened this issue Sep 26, 2024 · 0 comments · May be fixed by #253

Comments

@boesing
Copy link
Member

boesing commented Sep 26, 2024

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

PDO extensions (i.e. MySQL driver) do have dedicated extensions which need to be enabled.
These can be required using composer.json ext- notation, i.e.:

  • pdo_mysql
  • pdo_sqlite
  • etc.

We do not properly support these as of now within the CI container:

Extension "ctype" is already enabled.
Extension "intl" is already enabled.
Extension "mbstring" is already enabled.
Installing packaged extensions: php8.2-gd php8.2-pdo_mysql php8.2-mysql 
[...]
Fetched 14.9 MB in 2s (8465 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
181 packages can be upgraded. Run 'apt list --upgradable' to see them.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php8.2-pdo_mysql

I only had ext-pdo_mysql as requirement within composer.json and added mysql via .laminas-ci.json as I was wondering if that actually allows me to have the module detection (pdo_mysql is available once mysql extension is installed) to skip the installation of pdo_mysql but that did not work as mysql is appended to the list we parsed from composer.json.

It seems there are several packages available from sury which provide the appropriate PDO drivers:

php8.2-mysql - MySQL module for PHP
php8.2-odbc - ODBC module for PHP
php8.2-pgsql - PostgreSQL module for PHP
php8.2-sqlite3 - SQLite3 module for PHP

MySQL, ODBC and Postgres do actually create 1:1 the same mods-available file as expected. Only SQLIte does not match... its sqlite3 vs pdo_sqlite (there is no such pdo_sqlite3 which is really annoying).

Extension Name Sury Package Name Extension Config
ext-pdo_mysql php8.2-mysql pdo_mysql.ini
ext-pdo_odbc php8.2-odbc pdo_odbc.ini
ext-pdo_pgsql php8.2-pgsql pdo_pgsql.ini
ext-pdo_sqlite php8.2-sqlite3 pdo_sqlite.ini

I was thinking of adding support for MySQL, Postgres and SQLIte for now to the container so that we have the most common (?) drivers for postgres so that this is properly installed.

@boesing boesing linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant