Skip to main content

All Questions

Tagged with
0 votes
1 answer
60 views

scala skunk Multiple parameter Query: Passing List as Parameter to prepared statement

I would like to query a db table using the following sql val ALL_BY_ID: Query[List[String] *: Int *: EmptyTuple, Store] = sql"""SELECT id, name, description, account, enterdate ...
Bate's user avatar
  • 23
0 votes
0 answers
31 views

scala load json data from postgres sql into the domain object error ArrayIndexOutOfBoundsException

I am writing scala code to load data from db (postgres) using following sql. SELECT a.id, a.act_type_id AS actTypeId COALESCE(json_agg(x.procedure_id), '[]'::json) as actProcIds FROM ...
Laodao's user avatar
  • 1,649
4 votes
1 answer
262 views

WIth doobie, how do I map Scala case class to postgresql column with type tstzmultirange?

So e.g. I create the table vacations in postgres: create table if not exists vacations ( person text primary key, vacations tstzmultirange not null ) And on the Scala side, I have: case class ...
David Herskovics's user avatar
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 ...
Developus's user avatar
  • 1,462
0 votes
1 answer
267 views

Returning a Stream of Entities using a Transactor inside a Resource in Doobie

I'm trying to implement a query that returns the extracted information inside a fs2.Stream. I defined the Jobs algebra: trait Jobs[F[_]] { def all(): fs2.Stream[F, Job] } Then, I implemented an ...
riccardo.cardin's user avatar
0 votes
1 answer
444 views

Testing Doobie Interpreter Using Testcontainers

I'm trying to test some SQL statements developed with doobie using Testcontainers libraries. In detail, I'm using the following dependencies: "org.testcontainers" % "testcontainers"...
riccardo.cardin's user avatar
0 votes
1 answer
2k views

Use UUID in Doobie SQL update

I have the following simple (cut down for brevity) Postgres table: create table users( id uuid NOT NULL, year_of_birth smallint NOT NULL ); Within a test I have seeded data. When I run ...
D Ainslie's user avatar
1 vote
1 answer
885 views

Mapping a Many-to-Many Releationship Using Doobie

I have two tables in Postgres. The first contains generic information about movies, whereas the latter contains actors. CREATE TABLE "MOVIES" ( "ID" uuid NOT NULL, "TITLE&...
riccardo.cardin's user avatar
3 votes
2 answers
2k views

How I can insert case object as JSONB format via Doobie?

I use scala 2.13 and doobie 0.12.1 For example, I have case class case class UserInfo(name: String, age: Int, hobbies: Vector[String]) I want insert user info in column info as jsonb sql""&...
John's user avatar
  • 103
0 votes
1 answer
551 views

Syntax error at or near "order" (Scala with Quill, Doobie and PostgreSQL)

I am using Quill with Doobie and PostgreSQL (org.tpolecat.doobie-quill artifact with version 0.13.1). This code case class SomeRecord(id: Int, order: Int, name: String) val record = SomeRecord(0, 0, &...
DenisNovac's user avatar
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 ...
javier_orta's user avatar
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, ...
Nikita's user avatar
  • 2,934
0 votes
1 answer
1k views

How to read JSON out of Doobie Scala PostgreSQL Database with Circe?

I've tried creating the below implicit so that I can GET/read data from the postgreSQL database. I've tried add in the recommended implicits but they turn grey and seem to be unused. implicit val get: ...
Ry2254's user avatar
  • 991
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 ...
Ry2254's user avatar
  • 991
1 vote
1 answer
235 views

Could not find or construct Param[shapeless.::[String,shapeless.::[io.circe.Json,shapeless.HNil]]]

I am working on a basic job-board app for practice and when trying to compile my Scala code I am getting the following error. [warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/...
Ry2254's user avatar
  • 991

15 30 50 per page