Hi everyone,

We are using jOOQ in most of our projects (Java + Maven) of Test 
Engineering. Some of our projects need to execute their test scripts for 
different environments (QA, staging, prod). Having said that, the challenge 
we have been facing lately is the following:  

Every db schema is already created (qa, staging and prod) and located in 
different paths by environment (e.g: 
db.model.dbschema-{environment}.dbname.table). 

We have a layer for managing all our queries but the problem comes up when 
changing the environment because the imports are different according to the 
DB: 

//Prod
import db.model.dbschema-prod.dbname.table1
import db.model.dbschema-prod.dbname.table2

//Staging
import db.model.dbschema-staging.dbname.table1
import db.model.dbschema-staging.dbname.table2 

//QA
import db.model.dbschema-qa.dbname.table1
import db.model.dbschema-qa.dbname.table2

So if we want to run our tests against prod we have to comment staging and 
QA imports. 

We have thought to split up the DB layer in 3 classes, each for environment 
and then add a new layer to initialize one of those classes according to 
the environment. I do not like the idea of having repeated code in 3 
classes since the only thing that change is the db-schema. That's why I am 
creating this topic, I know there might be a fancy solution out there. 

Has anyone of you faced the same "problem"?  How do you solve it? 

Just let me know I wasn't clear enough and I will be happy to explain it in 
a better way. 

Thanks, 

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to