Giter Site home page Giter Site logo

Comments (3)

seratch avatar seratch commented on August 23, 2024

Thanks. I've not checked Hibernate's solution yet but does the library modify WOEID IN(?)part? I have met the need in my Scala library like this: https://github.com/scalikejdbc/scalikejdbc/blob/92176eb2ff4b64f2e0ca20bb49ab228ca7354f0b/scalikejdbc-core/src/main/scala/scalikejdbc/interpolation/SQLSyntax.scala#L88-L94

from kotliquery.

pierrelucveilleux avatar pierrelucveilleux commented on August 23, 2024

Nice to have or at least to document it.

use woeidList.joinToString()

override fun get(woeidList: List<Int>): List<WeatherInfo> { return using(sessionOf(datasource)) { session -> session.run(queryOf(GET_BY_LIST, woeidList.joinToString()).map(toWeatherInfo).asList) } }

from kotliquery.

ar-tama avatar ar-tama commented on August 23, 2024

@seratch
Hi,
I'm also stuck in same situation. woeidList.joinToString() will be string, so PreparedStatement.setParam seems to decide it as String.

Of course we have a workaround, "Add placeholders as much as we needed"... but I think we can be more lazy :P Could you tell me your opinions?

Actual generated:

SELECT woeid
FROM monitors_history
WHERE woeid in ('1, 2, 3')

Expected:
like DBIx::Sunny in Perl

SELECT woeid
FROM monitors_history
WHERE woeid in (1, 2, 3) // <- Removed quote

FYI my environment:

HikariCP 3.4.5
kotliquery: 1.3.1
kotlin: 1.3.72
MySQL: 5.6, 8.x

Thanks for your time!

from kotliquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.