Using GRDBCombine to obtain unique items and display them in a list with SwiftUI

I have a sample test project at https://github.com/EricG-Personal/grdb_test.git


In ContentView.swift, I currently have one list that shows all of the items in the Database.


Below that, I would like another list that shows all of the unique 'names' from the test table.


I am getting lost in the details between GRBD, Combine, and SwiftUI and am not sure what the code would look like to provide the second list with the data it needs from the database while using GRDBCombine.

Replies

I was able to figure out an answer. If anyone wanted to take a look at it and recommend any improvements to it as it is likely there are better ways to use the various frameworks involved.


At least one flaw I can see with my solution is I believe I am making more requests on the database than are strictly necessary, but I am not sure what the solution to this potential problem is.


The commit is at: EricG-Personal/grdb_test@79cc048