How to sync image template data with a mysql database?

Hello, in order to make a system to search through a lot of photo’s. I think that’s a good idea when a file template for a photo is updated it writes to the mysql database, how can i do this? Where to start? Below the layout of the fields.

- width: 3/4
 sections:
   meta:
     type: fields
     fields:
       image_title:
         label: Image Title
         type: text
       image_description:
         label: Image description
         type: textarea
         size: small
       subject:
         label: Subject
         type: text
       person:
         label: Person
         type: text
       tags:
         label: Tags
         type: text
       photographer:
         label: Creator
         type: text
       location:
         label: Location
         type: text
       technique:
         label: Technique
         type: text


- width: 1/4
 sections:
   content:
     type: fields
     fields:
       id_link_album:
         label: Album
         type: text
         width: 1/3
       date_created:
         label: Created Date
         type: date
         time: false
         width: 2/3
       date_acquisition:
         label: Acquisition Date
         type: date
         width: 2/3```

mysql tabel kirby_images

"id","id_image","id_link_album","slug","title","status","image_title","image_description","subject","photographer","person","file","name","template","sort","content","tags","location","technique","date_created","date_acquisition"

You can do that in a file.update:after hook.