atk4 / schema

Few classes built on top of Agile Data that can take care of your SQL database schema
https://agiletoolkit.org/
MIT License
4 stars 5 forks source link

add default mapping for binary/blob #24

Open mvorisek opened 4 years ago

mvorisek commented 4 years ago

Add mapping for blob to/from persistence

DarkSide666 commented 4 years ago

Currently atk4/data don't support blob field type.

Array and object types are almost the same in atk/data. They both store somehow serialized (as text - json, php serialize or any other textual conversion) structure. So on DB side it's a huge text - longtext or cblob in some engines. It's not binary lob. Blob could be useful if we wanted to store files (for example, user profile avatar image) in DB table field. Yes, then it could be useful, but currently we don't support that in atk4/data by default. As workaround it's possible to use bin2hex in custom serialize callback to convert binary data to textual before saving in db.

But if we look into future, then probably atk/data should have at least one such binary field type.

mvorisek commented 4 years ago

implement once BLOB field is added, see https://github.com/atk4/data/issues/506