// Create context.

        Settings settings = new Settings()
                .withRenderQuotedNames(RenderQuotedNames.ALWAYS);

        DSLContext ctx = DSL.using(SQLDialect.SQLITE, settings);

        // Insert statement.

        Continent continent = new Continent();
        continent.setId("europe");
        continent.setCode("eu");
        continent.setName("Europe");
        continent.setDemonym("European");

        String insert = ctx
                .insertInto(CONTINENT)
                .set(ContinentMapper.INSTANCE.unmap(continent))
                .getSQL(ParamType.INLINED);

        println(insert);

but this generates:

insert into continent (id, code, name, demonym) values ('europe', 'eu', 
'Europe', 'European')

(without quoted identifiers)


Note: the schema was generated using DDLDatabase but I assume that should 
not matter.


PS: for SQLite itself is does not matter that much that identifiers are not 
quoted (although SQLite DOES support this)..
But in my scenario I'm trying to generate SQL files with inserts that are 
database independent as possible.
I e.g. want to double quote the identifiers as I have fields with name year 
which otherwise cause problems.
Although MySQL and MariaDB do not support double quotes without SET 
sql_mode='ANSI_QUOTES'; I could make it work.
I'm basically looking for a ANSI dialect.

Cheers,
Marcel

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/32f9b489-1bc2-4e60-8c45-91a29163db82n%40googlegroups.com.

Reply via email to