Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

collang/gda-ispyb-api

 
 

Repository files navigation

Build Status

GDA ISPyB API

This is a Java library for accessing a Diamond-flavour ISPyB database. It's designed for server-side-only usage, utilising stored procedures to access the database tables. A key benefit of this apporach is the ability to modify the behaviour of the library methods without downtime and without building and deploying a new version of the library itself. A simple change to a stored procedure is very quick and runs in a transaction without disrupting access to the database.

The stored procedures are maintained in a separate repository: ispyb-database.

Documentation

The javadocs are currently hosted at https://alfred.diamond.ac.uk/documentation/javadocs/gda-ispyb-api/.

Examples

For example usage, see the integration tests, e.g. PlateIntegrationTest.

Tests

To create the database user, run e.g. these SQL commands:

CREATE USER maven@localhost IDENTIFIED BY 'password_here';

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `maven\_%`.* TO 'maven'@'localhost';

To build and test the JARs:

mvn -Dispyb.url={jdbc_url} -Dispyb.user={user} -Dispyb.pw={password} -Dispyb.host={host} package

Example:

mvn -Dispyb.url='jdbc:mariadb://localhost:3306' -Dispyb.user=maven -Dispyb.pw='password_here' -Dispyb.host=localhost package

To run a particular test class:

mvn -Dispyb.url={jdbc_url} -Dispyb.user={user} -Dispyb.pw={password} -Dispyb.host={host} -Dtest={TestClassName} test

To generate javadocs:

mvn -Dispyb.url={jdbc_url} -Dispyb.user={user} -Dispyb.pw={password} -Dispyb.host={host} install

The javadocs will then appear in a folder called target/apidocs/.

Release

To release, use the script release.sh. You need to supply this with the argument major, minor, or bugfix, and this script will handle updating the version. The result will be added to GitHub as a release by Travis.

About

Library for writing acquisition metadata into an ISPyB database

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 99.6%
  • Shell 0.4%