use of org.sql2o.Connection in project runelite by runelite.
the class ConfigService method get.
@RequestMapping
public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException {
SessionEntry session = auth.handle(request, response);
if (session == null) {
return null;
}
List<ConfigEntry> config;
try (Connection con = sql2o.open()) {
config = con.createQuery("select `key`, value from config where user = :user").addParameter("user", session.getUser()).executeAndFetch(ConfigEntry.class);
}
return new Configuration(config);
}
Aggregations