Skip to content

fix: [SQLite3] getFieldData() returns incorrect primary_key values - #8460

Merged
kenjis merged 4 commits into
codeigniter4:developfrom
kenjis:fix-sqlite3-getFieldData-primary_key
Jan 30, 2024
Merged

kenjis merged 4 commits into
codeigniter4:developfrom
kenjis:fix-sqlite3-getFieldData-primary_key

Conversation

@kenjis

@kenjis kenjis commented Jan 26, 2024

Copy link
Copy Markdown
Member

Description
The return type is integer, not boolean.

primary_key - integer 1 if the column is a primary key (all integer 1, even if there are multiple primary keys), otherwise integer 0 (This field is currently only available for MySQL and SQLite3)
See https://codeigniter4.github.io/CodeIgniter4/database/metadata.html#retrieve-field-metadata

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 26, 2024
@kenjis kenjis added the database Issues or pull requests that affect the database layer label Jan 26, 2024
Comment thread system/Database/SQLite3/Connection.php Outdated
@kenjis
kenjis force-pushed the fix-sqlite3-getFieldData-primary_key branch from 284ac97 to 4a949b3 Compare January 26, 2024 23:49
@kenjis
kenjis merged commit 057bcbd into codeigniter4:develop Jan 30, 2024
@kenjis
kenjis deleted the fix-sqlite3-getFieldData-primary_key branch January 30, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants