-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev] Refactoring roadmap #1804
Comments
Putting another pending refactor here. We had an issue where |
|
To do the above, ApiRequest should remove its dependency on DbStructure - which is needed by the variadic logic introduced on #1603. postgrest/src/PostgREST/Request/ApiRequest.hs Line 135 in 6398dd2
After that findProc and others can be moved to I tried to do this on #2496 but it turned out difficult bc I'm not familiar with the variadic logic. @wolfgangwalther Would be great if you could help with that. Ideally the proc logic shouldn't be where the body processing is done. Like on postgrest/src/PostgREST/Request/ApiRequest.hs Line 343 in 6398dd2
That logic should happen after, on the Plan module. |
The challenge is, that |
I've been thinking about how we transform requests, and seeing the The Internals of PostgreSQL query processing chapter here:
It seems:
|
This comment was marked as outdated.
This comment was marked as outdated.
Continuing the above idea. Our These ideas can be used to structure our modules and to improve the ARCHITECTURE.md. |
There are still some pending refactors but overall the structure now is in line with the original comment. Will unpin this issue as it's not urgent anymore. We can now grow the codebase in a more maintainable manner. |
Congratulations — great job!
As a (current) non-contributer I'm willing to help test this. |
With #1793, we've started the process of streamlining the codebase. This is a purely internal concern that will yield no additional features. It will, however:
Next steps include (in no particular order and to be completed - please feel free to edit)
CLI
andConfig
modules (Carve CLI out of Config #1806)main/Main.hs
, minimizing code under CPP conditional compilation (refactor: carve out modules fromMain.hs
#1814)plan :: DbStructure -> Request -> Either PlanError QueryPlan
reponse :: Plan -> QueryResult -> Wai.Response
Request
modules behind one API (refactor: Split Request, Query and Response interfaces from App #1831)Query
modules behind on API (refactor: Split Request, Query and Response interfaces from App #1831, refactor: add Query.hs module #2488)Response
concerns fromApp
, i.a. (refactor: Split Request, Query and Response interfaces from App #1831, refactor: add Response.hs module #2484)Error
type alongRequest
,Query
andResponse
GHC.Show
instances for string conversion (Refactor: Remove (mis)uses of GHC.Show instances #2016)Protolude.Conv
,unsafeHead
etc.)Protolude.Conv.toS
(Refactor: Remove uses of Protolude.Conv.toS #2017)decodeUtf8
et. alunsafeHead
doctest
for unit testing within modules where needed (Add doctests #2019)ARCHITECTURE.md
or similar to guide newcomers to the codebase, explaining how the major modules fit togetherAppState
as a monad (tbd)Other:
The text was updated successfully, but these errors were encountered: