Skip to content

Compound primary-key not supported #1991

Description

@diegoldev

Describe the bug
Trying to set a model with compound primary-key (two or more columns) is not supported by Codeigniter Model and DB Builder

CodeIgniter 4 version
4.0.0.beta.3

Affected module(s)
Codeigniter Model and DB Builder

Expected behavior, and steps to reproduce if appropriate

  1. Define a compound primary-key table. (E.g. book_author which pk be: book_id,author_id)
  2. Set $this->primaryKey as array ['book_id', 'author_id']
  3. Try to get a row with $this->find()
  4. An Exception is thrown because 'array cannot be parsed as a string'

Context

  • OS: Debian 9
  • Web server: Apache 2
  • PHP version 7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementPRs that improve existing functionalities

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions