Questions tagged [doobie]
Doobie is a pure functional JDBC layer for Scala and Cats.
doobie
30
questions with no upvoted or accepted answers
5
votes
0
answers
630
views
PostgreSQL Error with Doobie: PSQLException: The column index is out of range: 3, number of columns: 2
I am practicing with Scala, Doobie and PostgreSQL. The database is within a Docker container. I am able to post and update jobs but unable to GET all posts. I keep getting the below error.
I have ...
4
votes
0
answers
330
views
Doobie: create constant table with values
Postgres allows creation of constant tables for use in queries with this syntax:
WITH names (id, name) AS (VALUES (1, 'ABC'), (2, 'BCD'))
SELECT id FROM names
or the inlined version:
SELECT id ...
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: ...
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 ...
2
votes
0
answers
623
views
Doobie streaming query causes invalid operation
Doobie
Without much experience in either Scala or Doobie I am trying to select data from a DB2 database. Following query works fine and prints as expected 5 employees.
import doobie.imports._, ...
1
vote
0
answers
374
views
Create clickhouse temporary table with doobie
I want to create clickhouse temporary table with doobie, but i don't know how to add session_id parameter in query
I tried
val sql =
sql"CREATE TEMPORARY TABLE " ++ Fragment.const(...
1
vote
1
answer
324
views
Scala, Doobie, PostgreSQL - how to select from array/jsonb column?
I have a simple db table:
create table if not exists players
(
id bigint,
name text,
results text[]
);
Now I would like to create select query, where I want only rows with passed results. So I ...
1
vote
1
answer
53
views
Refactor function to remove unsafe .get calls when making doobie database queries
My DAO method types are:
ProductDao.getById(..): ConnectionIO[Option[Product]]
InventoryDao.getById(..): ConnectionIO[Option[Inventory]]
The function I need to refactor to make it safe is below:
def ...
1
vote
2
answers
3k
views
Simba JDBC Driver and Read timed out error BigQuery
I'm using Simba JDBC driver for bigquery in a scheduled job. Many times the job works and sometimes it fails because of:
sept. 08 12:40:38.307 TRACE 677 com.simba.googlebigquery.googlebigquery.client....
1
vote
0
answers
154
views
akka message wrtite into a doobie as a sink to postgres
I Have an issue when i try to write into a postgres table from an akka actor when it receives the message data.
I dont't know exactly the real probem i think that is the async context, because when i ...
1
vote
0
answers
290
views
Is it possible to push values to Kafka asynchronously using cats.effect.IO and FS2 Streams while returning an HTTP response immediately?
The problem that I'm trying to solve can be described as follows:
A k8s scheduler calls each Monday morning an HTTP endpoint of my Finagle/Finch application
The HTTP endpoint will handle the request ...
1
vote
0
answers
706
views
Postgresql array encoding in Doobie – text[] vs varying[]
Suppose we have this postgresql schema:
CREATE TABLE "temp" (id int, fields text[]);
INSERT INTO "temp" VALUES
(1, array['abc', 'def']),
(2, array['abc', 'def', 'jkl']),
(3, ...
1
vote
0
answers
356
views
ZIO [Declarative] Transactional Management
I spent a lot of time figuring out transactions on my otherwise well running ZIO+HTTP4S+Doobie-project.
How can I have proper [declarative] transaction management? Something like Spring @Transactional....
1
vote
1
answer
214
views
Proper usage of Monix 3.2.2 Observable with Doobie 0.9.0
I would like to use Monix Observable with Doobie (fs2) stream, but can't seem to get it working properly. Without streaming, my test app exits just fine but after using streaming, my TaskApp seems to ...
1
vote
1
answer
614
views
Try to update postgresql database using Doobie but no update happening
I'm trying to update table in postgresql database passing dynamic value using doobie functional JDBC while executing sql statement getting below error.Any help will be appreciable.
Code
Working code
...