-
-
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
Extensibility through HsLua #2299
Comments
I think the tasks for this one would be(in order of increasing difficulty):
|
Operators and query fragments can actually be done with static config, so Lua wouldn't be really needed here. Customizing the URL structure and the OpenAPI generation does require compute and dynamic config, so here Lua would be a must. By using pllua, this process could be made transparent to the database as well. |
As long as we keep "simple features" working without special SQL all is good. But having to resort to yet another scripting language and yet another place to put those scripts for advanced use cases is actually a step back. We are long past the point, we'd just write arbitrary SQL and then hope for PostgREST to expose that nicely magically. We do write the exposed schemas according to how PostgREST works with them to achieve a certain effect. We went a long way by including a lot of the configuration options inside the database, because we now have a single source of truth. If we were to extend PostgREST with lua scripts, suddenly we'd have two sources again, SQL code and lua code. And we would need to make sure to always deploy them together, which is a real challenge for deployments. Optionally allowing advanced configurations via SQL seems much more useful. |
I had more ideas about this. If we forget about the idea that hitting
And if that db function is written in Edit: closing as this is too complex and fuzzy. |
Proposing HsLua to solve:
The main point against providing extensibility through SQL functions(for example for OpenAPI) is:
(From #1511 (comment))
The text was updated successfully, but these errors were encountered: