graphula
graphula copied to clipboard
Does graphula support persistent-mongoDB?
I think the answer is no. I ran into this error:
/home/cody/smurf/test/ITProTV/Database/Particle/Models/HostSpec.hs:49:27-51: error:
• Couldn't match type ‘Database.MongoDB.Query.MongoContext’
with ‘Database.Persist.Sql.Types.Internal.SqlBackend’
arising from a use of ‘node’
• In a stmt of a 'do' block:
Entity _ hostVal <- node @Host.Host () mempty
In the second argument of ‘($)’, namely
‘do Entity _ hostVal <- node @Host.Host () mempty
Host.hostBio hostVal
`Test.shouldBe` Just (Gluon.HostBio "Some Texan.")’
In a stmt of a 'do' block:
runGraphulaT Nothing _runDB
$ do Entity _ hostVal <- node @Host.Host () mempty
Host.hostBio hostVal
`Test.shouldBe` Just (Gluon.HostBio "Some Texan.")
I'm assuming this means that you must be using the SqlBackend which persistent-mongoDB does not use.
Any way to make this work, ideas on how feasible implementing it is, etc?
Yes, it is currently bound to SqlBackend, though I'm not sure if that is from convenience or necessity. @cdparks do you see a viable path to abstracting persistent backends away and removing the dependence on SqlBackend?
@eborden there's a few layers of abstraction around what a "backend" is in persistent, so I suspect this is possible, but I'll need to study it