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

Test/Fix SQLite Implementation #2

Open
DoggySazHi opened this issue Mar 15, 2024 · 3 comments
Open

Test/Fix SQLite Implementation #2

DoggySazHi opened this issue Mar 15, 2024 · 3 comments

Comments

@DoggySazHi
Copy link
Member

Report from Altiami/@yoshiweegee that the creation of the SQLite schema no longer works properly - my guess is that it's related to the syntax differing between MySQL and SQLite.

Goals for resolving this issue:

  • Have a better way to separate SQL commands that are MySQL variant and SQLite variant (possibly in a YAML file)
  • Implement the above for database migration versioning
  • Actually have a way to test both, possibly automated
@DoggySazHi
Copy link
Member Author

Copying relevant information here
kosuzu.db has been created at this point, but

[09:22:36 ERROR]: [Kosuzu] Failed to get user languages!
[09:22:36 ERROR]: [Kosuzu] [SQLITE_ERROR] SQL error or missing database (no such table: language)

@yoshiweegee
Copy link
Contributor

Full error log and stack trace

[09:22:36 ERROR]: [Kosuzu] Failed to get user languages!
[09:22:36 ERROR]: [Kosuzu] [SQLITE_ERROR] SQL error or missing database (no such table: language)
[09:22:36 ERROR]: Error occurred while enabling Kosuzu v1.1.0-SNAPSHOT (Is it up to date?)
net.gensokyoreimagined.motoori.KosuzuException: Failed to get languages!
	at net.gensokyoreimagined.motoori.KosuzuRemembersEverything.getLanguages(KosuzuRemembersEverything.java:383) ~[Kosuzu-1.1.0-SNAPSHOT-dev-all.jar:?]
	at net.gensokyoreimagined.motoori.KosuzuHintsEverything.<init>(KosuzuHintsEverything.java:33) ~[Kosuzu-1.1.0-SNAPSHOT-dev-all.jar:?]
	at net.gensokyoreimagined.motoori.Kosuzu.onEnable(Kosuzu.java:70) ~[Kosuzu-1.1.0-SNAPSHOT-dev-all.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:188) ~[paper-1.20.4.jar:git-Paper-451]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.4.jar:git-Paper-451]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.4.jar:git-Paper-451]
	at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.4.jar:git-Paper-451]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:671) ~[paper-1.20.4.jar:git-Paper-451]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.20.4.jar:git-Paper-451]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:309) ~[paper-1.20.4.jar:git-Paper-451]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1131) ~[paper-1.20.4.jar:git-Paper-451]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-451]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

@DoggySazHi
Copy link
Member Author

Partially resolved by 542c31f with separated migration files for sqlite and mysql - an implementation may be needed for query/setters as well, e.g., in a separate YAML file like how translations are implemented. At least for schema builds, language selection, translation, and cache, it works in both SQLite and MySQL.

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