Take a look at my pms intergration
Although allot could be done using graphql rather than the direct sql as that wasn’t available when I did it.