yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
75 stars 39 forks source link

postgres scaffold not compatible with current persistent library #210

Open schoettl opened 1 year ago

schoettl commented 1 year ago

The yesodweb/postgres scaffold doesn't compile with persistent >= 2.13.0.0 (since about mid of 2021).

They removed the function connEscapeTableName which is used in the scaffold, see ChangeLog.

I tried for an hour to get it going again but I failed. The problematic code is here: https://github.com/yesodweb/yesod-scaffold/blob/postgres/test/TestImport.hs#L59

For now, I fall back to loading every *Spec module individually and only those that do without Yesod's TestImport.

snoyberg commented 1 year ago

@parsonsmatt any recommendations on the easiest way to migrate the scaffold?

parsonsmatt commented 1 year ago

I think that getEscapedRawName ought to do it

-    let escapedTables = map (connEscapeName sqlBackend . DBName) tables
+    let escapedTables = map (getEscapedRawName sqlBackend) tables