How does one create a DataStoreSnapshot for a custom data store ?

The WWDC2024 custom data store example doesn't provide any details on how one would go about creating a DataStoreSnapshot. The example uses a DefaultSnapshot for persisting the data in the DefaultSnapshot format directly in the JSON file.

There appears to be no documentation or examples of how one might create a DataStoreSnapshot from data from another database.

The Apple documentation for DefaultSnapshot provides no examples of how one might create such a snapshot from data retrieved elsewhere.

Can anyone provide a simple example of how one might create such a snapshot from a remote database such that it can be returned as part of the response to a fetch request.

For the purpose of this example let's assume I have a CSV file with rows of data and code to read the data from this file. How would I create a snapshot or snapshots for each of the rows of data.

IMHO, the plan to support Custom Data Stores is a welcome enhancement that should enable a diverse ecosystem of stores (SQL, NOSQL, etc.). That said, a brief search of the internet finds a surprising lack of implementations. Fundamentally, it appears this capability is NOT ready for general adoption. Documentation is extremely sparse (or missing) and it appears important key properties are not accessible (e.g. in DefaultSnapshot and BackingData). As a next step, I'd like to propose the Apple team implement an actual custom DataStore using an actual SQL DB, enhance the documentation and code based on the experience, and publish so the broader community can help cary this forward.

How does one create a DataStoreSnapshot for a custom data store ?
 
 
Q