Skip to content

馃挕 Feature Request: Add insertable and updatable attributes#113

Description

@edson-nascimento

Currently, the cycle/annotated library doesn鈥檛 support insertable and updatable column attributes, which are useful for preventing specific fields from being included in INSERT or UPDATE queries (e.g., auto-incremented IDs, database-managed timestamps, or read-only fields).

In Doctrine, these are implemented as:

#[Column(insertable: false, updatable: false)]  
private $id;  

Proposal:
Add similar attributes to Cycle\Annotated鈥檚 Column

#[Column(insertable: false)]  // Excludes from INSERT  
#[Column(updatable: false)]   // Excludes from UPDATE  

Use Cases:

  • Auto-increment fields that should not be manually inserted.
  • Database-managed fields (e.g., created_at, updated_at).
  • Read-only fields fetched from triggers or views.

Would this be feasible to implement? I鈥檓 happy to help with a PR if the maintainers agree on the approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions