We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This plugin is also very helpful for end users if they want to execute SQL command in a pipeline
As example I created this pipeline script (could perhaps be added as example to the documentation):
node { stage('Verify') { getDatabaseConnection(type: "GLOBAL") { def resultCount = sql(sql: "SELECT count(*) FROM identifier i1, identifier i2 WHERE i1.value = i2.value AND i1.product_id < i2.product_id"); def duplicates = resultCount.get(0).get('count'); if (duplicates > 0) { if (duplicates < 201) { echo "Found ${duplicates} duplicates:"; def duplicateIds = sql(sql: "SELECT i1.product_id id FROM identifier i1, identifier i2 WHERE i1.value = i2.value AND i1.product_id < i2.product_id"); for(duplicateId in duplicateIds) { def id = duplicateId.get('id'); echo "${id}"; } } error "Found ${duplicates} duplicates ..."; } } } }
But this only works if I configure a database in Jenkins / Configure system
I was not able to find an example how to configure the database in the pipeline or in a stage of the script.
EDIT: Yes, I have seen the "This plugin is not meant to be used by end users by itself" but why not make a plugin helpful for many users?
The text was updated successfully, but these errors were encountered:
@basil @jetersen @timja Could someone answer this question please?
Sorry, something went wrong.
you can't configure a database in the pipeline itself currently, only via global configuration
Ok. Would it be possible to support the id field in the global database setup to allow multiple databases?
id
yes that would be fine if someone implemented it
No branches or pull requests
Describe your use-case which is not covered by existing documentation.
This plugin is also very helpful for end users if they want to execute SQL command in a pipeline
As example I created this pipeline script (could perhaps be added as example to the documentation):
But this only works if I configure a database in Jenkins / Configure system
I was not able to find an example how to configure the database in the pipeline or in a stage of the script.
EDIT: Yes, I have seen the "This plugin is not meant to be used by end users by itself" but why not make a plugin helpful for many users?
The text was updated successfully, but these errors were encountered: