I arrived here with the same question and needed for data generation tool for my integration tests. I decided to accept the challenge with Groovy, which is my language of choice for tests because of its compactness and power assert.
I've just written a small helper https://gist.github.com/pgaertig/9502960 called FactoryGrill ;) which allows you to write data scripts like below.
insert('MyTable', ID: 1, CREATED_AT: new Date(), NAME: 'Example text')
above is equivalent to:
INSERT INTO MyTable(ID, CREATED_AT, NAME) VALUES (1, ..current date here.., 'Example text')
You can do more with Groovy:
import org.apache.commons.lang3.RandomStringUtils;
for ( i in 0..9 ) {
insert('USERS', CREATED_AT: new Date(), EMAIL: "test${i}@mydomain.com",
SALT: RandomStringUtils.randomAlphanumeric(32));
}
load(new File('usersettings.groovy').text) //script nesting etc
It is not factory really because factories are quite straight forward in Groovy with map constructor or expandos.
References and other stuff from FactoryGirl is not available currently because above is achieved only with ~30LOC. However if there is an interest in my solution I will add make a dedicated project on Github.