Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Populate database on plugin initialization

Diego Pena-Stein
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 5, 2023

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:

  1. 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.
  2. 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!

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events