Hi Lukas, I'm working on this issue. Thanks to Greg for starting his conversation. I switched from:
context.mergeInto(table(tableName), columnNames) to context.mergeInto(table(*name*(tableName)), columnNames) And it seems to be working now! Is there a reason table() would not do a name()? Two things: 1. There is actually no schema set by default. So the replacement was trying to match "empty", is there a better way of doing this? 2. Is this the best way to get support? We have a licence and are using SQLServer and I'm having issues around temp tables. Thanks so much for your help, Megan On Wednesday, October 7, 2020 at 12:48:33 AM UTC-7 [email protected] wrote: > Hi Greg, > > Thanks for your message. There's nothing wrong with your setup. This > should work for DDL and DML alike. There is one caveat I can think of, > though. How do you create your DML statements? If you're using plain SQL > templating API ( > https://www.jooq.org/doc/latest/manual/sql-building/plain-sql-templating/), > then schema mapping does not apply, because we don't parse the templates. > You can recognise plain SQL templating API as it is annotated with > org.jooq.PlainSQL. In that case, you probably should use DSL.name() to > construct your identifiers instead. > > Note, I would recommend using "^.*$" as a pattern to prevent generating > MY_SCHEMAMY_SCHEMA as can be shown here: > > > jshell> "abc".replaceAll(".*+", "xyz") > $1 ==> "xyzxyz" > > jshell> "abc".replaceAll("^.*$", "xyz") > $2 ==> "xyz" > > > Thanks, > Lukas > > On Wed, Oct 7, 2020 at 7:03 AM Greg Nielsen <[email protected]> wrote: > >> Hello, >> >> Using jOOQ Professional, we are writing to a SQL Server instance. We're >> finding that only the DDL statements (eg create tables) seem to honor the >> MY-SCHEMA mapped schema, while the DML (eg inserts) is not. >> >> We're initializing our Settings object with: >> >> >> @Bean >> public Settings settings() { >> return new Settings() >> .withRenderCatalog(true) >> .withRenderSchema(true) >> .withRenderMapping(new RenderMapping() >> .withSchemata(new MappedSchema() >> .withInputExpression(Pattern.compile(".*+")) >> .withOutput("MY_SCHEMA")) ); >> } >> I believe we're runing 3.13 - is there an additional setting we need to >> be configuring? >> >> Let me know what other info might be helpful. >> >> Thanks, >> Greg >> >> -- >> 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/f1597c43-6dc6-41d8-afc5-a957d9cd4b76n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jooq-user/f1597c43-6dc6-41d8-afc5-a957d9cd4b76n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/e5ce7303-78c4-4066-b618-1d2ef1123ad7n%40googlegroups.com.
