statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 71 forks source link

Make it possible to save to specific columns instead of `data` #272

Closed ryanmitchell closed 3 days ago

ryanmitchell commented 2 months ago

Thread on discord for context: https://discord.com/channels/489818810157891584/1228264236191322193

It would be nice to allow Entries (at least) to specify columns they want to save data to for indexing, eg you may want a content column or a date column or something else.

This would mean changing the makeModelFromContract and fromModel methods to pull from / merge to data, and it would mean updating the EntryQueryBuilder to allow the extra columns to be specified. We would need to provide a config or a public property/method somewhere to allow the columns to be defined.