Questions tagged [slick-pg]

Slick extensions for PostgreSQL, to support a series of pg data types and related operators/functions.

extensions for , to support a series of pg data types and related operators/functions.

Currently supported pg types:

  • ARRAY
  • Date/Time
  • Enum
  • Range
  • Hstore
  • LTree
  • JSON
  • Inet/MacAddr
  • text Search
  • postgis Geometry

Currently supported pg features:

  • inherits
  • composite type (basic)

More info in GitHub: https://github.com/tminglei/slick-pg

19 questions
7
votes
0 answers

Scala Slick Strategies For Composing Compiled Queries of various shapes

I am using postgresql 9.6, slick 3.2 and have slick-pg wired up. I'm implementing a graphql backend in Scala and I need to implement queries to resolve GraphQL cursors of various shapes. The shapes of the input are enumerable. Some of the inputs…
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
2
votes
0 answers

Changing stored JSON's field's value with slick-pg

I'm using slick-pg with circe-json and I'm a bit stuck. I wonder is it possible to modify not the whole JSON, but only the value of a field? I can update JSON like this: db.run { questQuery.filter(_.json.+>>("name") === name.bind) …
Akechik
  • 21
  • 1
2
votes
0 answers

How Slick update JSONB column in PG?

I try to update column attrs (JSONB type) in this way, it compiles failed. table .filter(_.sn === param.sn) .map(_.attrs) .update(param.attrs) But if I update a INTEGER column in the same way, it succeed. How should I update a JSONB column…
Z fp
  • 562
  • 5
  • 20
2
votes
1 answer

Scala Slick compose column type mappers

I'm using slick-pg which adds support(with implicits) for the List and DateTime types in slick. Unfortunately I cannot use List[DateTime] - slick does not understand composition of those types, but I've checked that both work correctly on their…
fr3ak
  • 493
  • 3
  • 16
2
votes
0 answers

Slick Query jsonb - cannot be cast to slick.ast.OptionType

I'm trying to build a query that returns a few selected columns using slick-pg for as my slick driver but I'm having issues trying to map on the json column MyValueObject. The error I am getting at runtime is... A client error occurred:…
a11hard
  • 1,904
  • 4
  • 19
  • 41
1
vote
0 answers

Force postgres to escape all values in response

Is there a way to make postgres escape all the values in the response to a query? Especially for cases like ({xx(yy)zz}) (a text value in an array field of a composite type) which would escape as ({"xx(yy)zz"}) (or something like that).
kag0
  • 5,624
  • 7
  • 34
  • 67
1
vote
0 answers

Slick-pg: How to use arrayElementsText and overlap operator "?|"?

I'm trying to write the following query in scala using slick/slick-pg, but I don't have much experience with slick and can't figure out how: SELECT * FROM attributes a WHERE a.other_id = 10 and ARRAY(SELECT…
protetore
  • 11
  • 2
1
vote
2 answers

scala + slick-pg + implicit

I tried to add column based on example [slick-pg example][1] Also added to the class table implicite implicit val pointFormat = MyFormats.geometryFormat[Point] but have a compile error could not find implicit value for parameter tt:…
initmax
  • 395
  • 2
  • 10
1
vote
1 answer

Missing implicit TypedType[JsonString] with slick-pg

I am using slick-pg 0.8.2 with Slick 2.1.0 and am having problems with a JSON-typed column. My Driver is defined as follows: trait PgsqlDriver extends PostgresDriver with PgJsonSupport with…
Mario Camou
  • 2,303
  • 16
  • 28
0
votes
0 answers

Array aggregate subquery with Slick-pg for postgres

I am trying to use an aggregate function from slick-pg in a query with subquery but I am getting an Exception slick.SlickException, with message: No type for symbol s5 found for Ref s5.. This is the SQL I want to translate: select id, customer_id,…
Benjamin Maurer
  • 3,602
  • 5
  • 28
  • 49
0
votes
1 answer

Scala-Slick Array Column

I'm using scala slick + slick-pg (v0.21.1) for my db integration with my play application. Following the documentation: https://github.com/tminglei/slick-pg/tree/v0.21.1 I set up MyPostgresProfile as shown in the documentation. However, I still…
CJC
  • 21
  • 2
0
votes
1 answer

Cannot run slick queries on postgis with slick-pg

In my project I ha ve the necessity to save location data on a table, so I created the following table create table if not exists public.person( email varchar(255) not null primary key, name varchar(255) not null, surname varchar(255) not…
Luca
  • 1,116
  • 2
  • 15
  • 24
0
votes
1 answer

Slick:Insert into a Table from Raw SQL Select

Insert into a Table from Raw SQL Select val rawSql: DBIO[Vector[(String, String)]] = sql"SELECT id, name FROM SomeTable".as[(String, String)] val myTable :TableQuery[MyClass] // with columns id (String), name(String) and some other columns Is there…
Larry
  • 71
  • 5
0
votes
1 answer

Slick PostgreSQL Integration

I'm new to scala and I'm trying to integrate a PostgreSQL database to a Lagom application written in scala.I'm trying to utilise the persistence API of Lagom. Lagom has inbuilt support for slick. My table has 3 fields id of type int, name of type…
Voodoo
  • 349
  • 3
  • 11
0
votes
2 answers

slick codegen with custom profile

I'm trying to use a custom profile in my sbt slickCodeGen task but I keep hitting a ClassNotFoundException. The sbt task look like this: lazy val slickCodeGen = taskKey[Unit]("Slick: generate Table") slickCodeGen := { val dir =…
samidarko
  • 590
  • 7
  • 20
1
2