Skip to content
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

[FEATURE] Move SQL-Queries To Stored Functions #399

Open
ip6li opened this issue May 25, 2024 · 1 comment
Open

[FEATURE] Move SQL-Queries To Stored Functions #399

ip6li opened this issue May 25, 2024 · 1 comment

Comments

@ip6li
Copy link

ip6li commented May 25, 2024

Is your feature request related to a problem? Please describe.
UserHideRepository, UserInterestRepository, and UserRepository contains MariaDB/MySQL specific SQL queries. This makes is difficult to adapt Alovoa to other database platforms, e.g. PostgreSql.
Problem may be solved by moving that queries into stored functions, so Alovoa code @Query needs a simple select call, only. An init interface and its implementations for each supported database platform is needed to set up stored functions if a new Alovoa installation is started for the first time.

Describe the solution you'd like

  1. Classes mentioned above should be adapted for use of stored functions.
  2. In a first step an initSql interface should be defined and an implementation of that interface should set up required stored functions for MariaDB/MySQL.
  3. For each class it should be possible to use different databases, especially for classes regarding binary blobs.

According to application.properties the right implementation is selected for used database.

Describe alternatives you've considered
Unfortunately @Query cannot parametrized at runtime, so that is not an option to select a @Query based on application.properties.

Additional context
This feature may be also useful if Alovoa is considered to be used on high volume installations, because it opens the possibility to use distributed databases and even some types of NoSQL databases like Apache Cassandra. This would be useful for e.g. big binary blobs like images or videos.

If you need help to implement this, please let me know.

@Nonononoki
Copy link
Contributor

Nonononoki commented May 25, 2024

I don't see any issue here, @Query uses JPQL and translates to native SQL for any database supported by Hibernate, which includes PostgreSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants