Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (40 sloc) 2.04 KB

Here are some questions that have a potential to become frequently asked.

  1. I have plenty of time, I don't want to use any timeout for any of my queries. What can I do?

    Declare implicit Timeout instance of infinite duration — io.rdbc.sapi.Timeout.Inf.


  2. How do I build SQL dynamically using sql interpolator?

    Use special #$ prefix for the dynamic parts. See this paragraph for details.


  3. How to pass Timeout explicitly to ExecutableStatement's executeForKey method? I keep getting compilation errors.

    executeForKey method's declaration is

    :::scala def executeForKeyK: ClassTag(implicit timeout: Timeout): Future[K]

    Under the hood, this declaration really means this:

    :::scala def executeForKeyK(implicit classTag: ClassTag[K], timeout: Timeout): Future[K]

    So you can't really execute this method like this:

    :::scala executeForKeyInt(timeout)

    Instead, you have to do this:

    :::scala executeForKey()(timeout, classOf[Int])


  4. I'm executing insert statement and trying to get auto-generated key from the DB but nothing is returned. What am I doing wrong?

    You probably forgot to set a generatedKeyCols statement option accordingly. See this paragraph for details.