Skip to content

Provide column info #190

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

Open
JanJakes opened this issue Jun 2, 2025 · 0 comments
Open

Provide column info #190

JanJakes opened this issue Jun 2, 2025 · 0 comments

Comments

@JanJakes
Copy link
Collaborator

JanJakes commented Jun 2, 2025

WPDB exposes a get_col_info() method that retrieves column metadata from the last query using mysqli_num_fields and mysqli_fetch_field.

PDO statement provides analogous methods columnCount and getColumnMeta, but in the case of the SQLite driver, we may sometimes execute multiple queries for a single MySQL query, so the column info may need to be reconstructed more manually in some cases.

It may also happen that the returned column info needs to be "translated" from SQLite data to MySQL data using the information stored in the information_schema tables.

This also relates to Automattic/sqlite-database-integration#7 regarding how the column info should be exposed.

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