Once connected to database, Acolyte Studio formats query result in Acolyte row syntax. Thus recorded rows can be used anytime you want as fixtures.
Download
- Platform independent: standalone JAR
Requirements:
- Java 1.6+
Usage
General use case is following one.
- Configure JDBC access.
- Prepare SQL query.
- Test SQL query.
- Define column mappings, then extract rows with that (using previous query).
- Convert extracted rows to Acolyte syntax.
Command-line interface
Row formatter can be called from CLI:
java -jar STUDIO.jar acolyte.RowFormatter <arguments>
If second argument is a path to JDBC driver, then arguments are expected to be:
- JDBC URL,
- path to JAR of JDBC driver,
- name of database user,
- character set of database,
- user password,
- output format (Java or Scala),
- SQL query,
- type of first column,
- type of second column,
- …
Otherwise, arguments #1 to #4 are omitted, values loaded from configuration file $USER_HOME/.acolyte/studio.properties
:
- User password,
- output format (Java or Scala),
- SQL query,
- type of first column,
- type of second column,
- …
Column mappings editor
Column mappings can be defined either adding mapping one after another in table, or using expert editor, with a pseudo CSV syntax:
columntype1;Name_of_col
columntype2;Column_name
Column types
bigdecimal
bool
- byte
- short
- date
- double
- float
int
- long
- time
timestamp
- string
Configuration file
File studio.properties
uses Java properties syntax, with following keys:
jdbc.url
: JDBC URLjdbc.driverPath
: Path to JDBC driver JARdb.user
: Name of database userdb.charset
: Database character set