As mentioned here:
http://stackoverflow.com/questions/10264001/instantiating-a-jooq-field-by-name
I am using jOOQ in some generic code, without using jOOQ's code
generation. The table names and field names are not known until runtime.

To create a SQL query, I can use
  Factory.field("somefield")
and
  factory.select(fields).from("sometable")
but both those strings are just arbitrary SQL, not specifically field or
table names. It would be great if I could specify these explicitly, to
get the benefit of quoting, escaping, the "parent.field" syntax, and
some protection against SQL injection. And I think that would be healthy
for the API overall.

This would be nice, for instance:
  Factory.field("someparent", "somefield")
where the parent parameter would be either the table name or an alias
for the table, or an alias (such as an alias to a join to another
table).
Maybe it would need a DataType parameter too.

And this would be nice too:
  Factory.tableByName("sometable")
(There is already a table("SQL") method.)
where the name would be either a table or an alias.

By the way, it looks like jOOQ strongly assumes that we will use its
code generation. So much so that the documentation pages uses
database-specific API (BOOK, BOOKSTORE, etc) that must have been
generated, without explicitly mentioning that. In case people arrive at
a page without reading the previous pages, it might be helpful to add a
link to a description of the code generation, to each place where it is
implicitly used.

-- 
[email protected]
www.murrayc.com
www.openismus.com

Reply via email to