LuckPerms

LuckPerms

41.4k Downloads

Sql storage rewrite

XakepSDK opened this issue ยท 2 comments

commented

Current storage impl. is really bad. Bad relational model, no cascades, no joins, many sql requests, where can be only one.(loadUser, saveUserm, many more), no transactions.
This will be breaking change.

Also, i can do this if i have free time.(like with cassandra storage impl).

commented

The core Storage model can't really change, because all storage backings need to implement the same interface.

As for the SqlDao implementation, yes that can change.

The model isn't perfect, but I think it's a long way from being "bad". "many sql requests" - by that you mean, two? The loadUser method literally executes 2 queries.

I'd be happy to see improvements, but I don't think the current impl is "really bad" as you say it is.

commented

It's ok for core, but SqlDao is bad.
Look at transactions: https://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html
Cool feature.
Also, joins can save sql executions(make just 1 query to take data from different tables and 'join' it).(more performance)
Relations can save update/delete operations queries.(deleting in 1 table removes in another table by foreign key)