AdvancedBan icon indicating copy to clipboard operation
AdvancedBan copied to clipboard

Use HSQLDB's MySQL compatibility mode to simplify SQLQuery enum

Open A248 opened this issue 5 years ago • 1 comments

Each enum entry in SQLQuery has 2 queries, one for MySQL and one for HSQLDB. However, HSQLDB has a MySQL compatibility mode which can cover all these differences, and therefore allow a single query for each entry.

In MySQL compatibility mode with HSQL:

  • Backticks are permitted. This is an optional MySQL feature anyway.
  • AUTO_INCREMENT PRIMARY KEY is supported.

Also of note:

  • BIGINT is part of the SQL standard and is supported by MySQL. I'm not sure why AdvancedBan uses LONG.

A248 avatar Oct 17 '20 16:10 A248

I guess I just used LONG because AdvancedBan uses java long for timestamps :D Not sure if we can just migrate to using a different datatype but if both can be extracted into longs then I suppose it shouldn't be a problem.

Thanks for the research on this 👍

DevLeoko avatar Oct 17 '20 16:10 DevLeoko