Skip to content

💡 Feature Request: Add insertable and updatable attributes #113

@edson-nascimento

Description

@edson-nascimento

Currently, the cycle/annotated library doesn’t 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’s 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’m happy to help with a PR if the maintainers agree on the approach.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions