I'm trying to populate my plugin's database with predefined values when the server is initialized on 'atlas-run'. I haven't been able to figure out exactly how to do this but have identified two possible ways:
- Edit the JVM arguments to include datasource.data and datasource.schema:
This documentation explains how to setup a schema.sql and data.sql files to run at program startup and populate tables. I'm able to find the JVM arguments that are used with atlas-run, but I cannot find where to add my own. - Add a @sql annotation to run code on startup: This tutorial explains how to run an SQL statement in the database. I've identified that the SQL statement <RUNSCRIPT FROM '../../../classes/data.sql';> will run my data.sql file containing the startup script. However, I'm unable to find the library the @sql annotation comes from, or any other way to execute raw SQL code.
If anyone know how to add JVM arguments or run SQL statements on the database, any help would be appreciated. Thank you!