> Well, all the software I saw in my life allowed me to make it use any
> database I like as a source. I am surprised jooq doesn't offer an easy way
> to do that.

How can I improve this to make it more "easy" for you?
http://sourceforge.net/apps/trac/jooq/wiki/Manual/ADVANCED/SchemaMapping

> There is also a notion of some default database in mysql, which is setup by
> "USE" SQL statement and after it you may completely omit database name from
> queries. In this case if there is no database name in SQL query, it will be
> defaulted to the one, ереф has been setup by 'USE' statement.

I can put the "use" statement on the roadmap. Factory.use(Schema) will
then execute the USE statement on the underlying database and install
a SchemaMapping for the null Schema:

void use(Schema schema) {
    this.mapping.add(schema, (Schema) null);
}

https://sourceforge.net/apps/trac/jooq/ticket/546

I understand that you are used to the "MySQL way" of developing
databases, where applications are often not the owners of their
database instances, catalogues or even schemata. But in large business
applications (usually running on DB2, Oracle, or SQL Server), dozens
of schemata may be used in parallel and there is no need to exchange
their names at run time. Au contraire, it is important to fully
qualify objects in SQL, including schemata. I think the current
SchemaMapping provides a viable solution for both "worlds".

Feel free to read the full rationale in this discussion:
http://groups.google.com/group/jooq-developer/browse_thread/thread/c600b0642f3e63d3

While we're discussing this, do you think you might need a
TableMapping as well, in case some of your tables cannot be named the
same way in production as in your development environments? If yes,
what are the use cases? Prefixing? Or mapping table-by-table?

Reply via email to