Skip to main content

Questions tagged [doobie]

Doobie is a pure functional JDBC layer for Scala and Cats.

1 vote
0 answers
423 views

org.postgresql.util.PSQLException: The column index is out of range

The exception org.postgresql.util.PSQLException: The column index is out of range: 2, number of columns: 1. ... only occurs if a string interpolation is added to the query below, for example: [...](...
user3642813's user avatar
2 votes
2 answers
2k views

Save Doobie stream from database to file

Doobie select returns an fs2.Stream(doobie.ConnectionIO, String). If we need to write it to file the obvious option is to call stream.compile.toList.transact(transactor) and then save this list to ...
Lev Denisov's user avatar
  • 2,111
1 vote
1 answer
401 views

Doobie example complains about column index mismatch

Trying out the stock Doobie example, and getting an exception complaining about an "Invalid column index". My query is extremely simple: it selects two columns from one Oracle table, and I expect ...
radumanolescu's user avatar
2 votes
1 answer
649 views

Scala Doobie does not return anything when using OR WHERE

I am trying to select from database with several filters. Code: // name is List("Denis", "Semen") val query = name.map(_ + "%").mkString(" OR name LIKE ") sql"SELECT * FROM phonebook WHERE name ...
DenisNovac's user avatar
1 vote
1 answer
674 views

Issues when using Doobie library with Oracle and Timestamp

I am trying to use Doobie with oracle and I am getting some type issues: I have a table: create table TEST ( CREATED_ON TIMESTAMP(6) not null, A VARCHAR2(50) not null, B ...
user avatar
3 votes
1 answer
928 views

How to generate SQL statements dynamically using Doobie (scala)

I have the query: val sql = """select id, clientName from partnerClients where partnerName = ? ...
Alex Spektr's user avatar
2 votes
4 answers
866 views

Scala Doobie PSQLException: ERROR: syntax error at end of input when use "Like %"

I am using PostgreSQL 12.1 with Scala and Doobie. Getting exception when trying to do query with LIKE % syntax. It works without %. My code: implicit val cs = IO.contextShift(ExecutionContexts....
DenisNovac's user avatar
3 votes
0 answers
553 views

Doobie. Set connection timeout

How to set connection timeout using Doobie? For now, I am creating a new hikari transactor, and then configuring it: def buildTransactor(driver: String, uri: String, user: ...
Oleg's user avatar
  • 941
6 votes
4 answers
4k views

Doobie - lifting arbitrary effect into ConnectionIO

I'm trying to send an email in the same transaction as inserting user into a database with Doobie. I know that I can lift IO into ConnectionIO by using Async[ConnectionIO].liftIO(catsIO) where catsIO: ...
Leonti's user avatar
  • 10.8k
3 votes
0 answers
238 views

Getting Error while querying to mysql with doobie

I have transactor below val transactor: Resource[IO, HikariTransactor[IO]] = for { ce <- ExecutionContexts.fixedThreadPool[IO](32) // our connect EC be <- Blocker[IO] // our ...
Joshi Srikanth Rao's user avatar
4 votes
1 answer
545 views

provide Get instance for Seq

For instance, I have some entities with some params, and two database tables, representating this entities: entity param ╔════╦═════════╗ ╔═══════════╦════════╗ ║ id ║ name ║...
Oleg's user avatar
  • 941
2 votes
2 answers
1k views

How to configure transactor in doobie?

Recently I started learning doobie but I couldn't create a hikari transactor without error. I'm using mysql, Intellij-Idea. This is my build.sbt file name := "doobie" version := "0.1" //scalaVersion ...
NzDush's user avatar
  • 175
12 votes
1 answer
5k views

Doobie cannot find or construct a Read instance for type T

I'm using doobie to query some data and everything works fine, like this: case class Usuario(var documento: String, var nombre: String, var contrasena: String) def getUsuario(doc: String) = ...
santiromf's user avatar
  • 123
4 votes
1 answer
228 views

How to pass complete query as a parameter

I get a query from gitlab ci and I want to execute it. If I hardcode the query is the sql"""""" syntax it works. But I want to pass it as a variable(the whole query). the SqlInterperator doesn't ...
Sam's user avatar
  • 517
0 votes
1 answer
712 views

jdbc - HikariCP: Seeing low insert thoughput while DB/App cpu % is still low

I've set up doobie + hikaricp with settings similar to the default. With debug logging I can see how many connections are active / idle and this also reflects what pg_stat_activity returns with this ...
irregular's user avatar
  • 1,537

15 30 50 per page
1
3 4
5
6 7