Where are attachment references saved in the database?

I know the attachments are saved in following directory:

/home/frappe/frappe-bench/sites/erpnext.vm/private/files

However, where are the attachment filenames saved in the database for a particular customer?

How would one implement a python code to automatically attach files from OneDrive for a Customer record in the database?

My guess is the File doctype?

For example if you do a ‘desc tabFile’ or query its contents.

Or look in ./apps/frappe/frappe/utils/file_manager.py