codecentric / gatling-jdbc

JDBC support for Gatling
Apache License 2.0
23 stars 18 forks source link

Multiple jdbc connections #12

Closed Aftogen closed 3 years ago

Aftogen commented 3 years ago

Hi @rbraeunlich, I have to execute SQL queries from different DBs during scenario. Tell me please, is it possible to create multiple jdbc connections? Like first:

val jdbcConfig1 = jdbc
  .url("jdbc:h2:db:1")
  .username("sa")
  .password("sa")
  .driver("org.h2.Driver")

And second:

val jdbcConfig2= jdbc
  .url("jdbc:postgresql://db:another")
  .username("sa")
  .password("sa")
  .driver("org.postgresql.Driver")

If it possible, how can I specify database to make request?

exec(
  jdbc("selection").db("jdbcConfig2") // ???
  .select("*")
  .from("bar")
  .where("abc=4")
)
rbraeunlich commented 3 years ago

Hey @Aftogen this repository is actually discontinued. You should open issues here: https://github.com/rbraeunlich/gatling-jdbc Anyways, what you describe is currently not possible, since internally, the default connection is set on scalikejdbc. Named configs aren't supported.

Aftogen commented 3 years ago

Ok, thank you