22 questions
0
votes
0
answers
25
views
Does slick-pg support this PostgreSQL feature?
Using the PostgreSQL-specific slick-pg extension of slick, which supports multi-upsert. Let's consider a small example.
CREATE TABLE foo (id INT PRIMARY KEY, name TEXT DEFAULT 'foo');
The ...
1
vote
2
answers
67
views
slick-pg filter rows by column with specific array_length
According to https://www.postgresql.org/docs/8.4/functions-array.html, there is an array_length PG Oper/Function. Then, according to https://github.com/tminglei/slick-pg/tree/master/core/src/main/...
0
votes
1
answer
118
views
How can I add a query by array index in scala slick?
Using scala slick, how would you generate a query filter using plain text?
Context -
I'm trying to filter on an array position column, doesn't appear to be supported by the slick extensions provided ...
1
vote
0
answers
104
views
Trait for composite primary keys in Slick tables?
I have 2 tables
case class SimplePKDB(id: Long = 0L)
object SimplePKDB {
final class SimplePKTable(tag: Tag) extends Table[SimplePKDB](tag, "simple_table") {
def id: Rep[Long] = ...
1
vote
1
answer
335
views
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 ...
2
votes
0
answers
97
views
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....
1
vote
0
answers
97
views
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 ({&...
0
votes
1
answer
107
views
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 ...
0
votes
1
answer
653
views
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 ...
0
votes
1
answer
530
views
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 ...
0
votes
2
answers
330
views
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 ...
1
vote
0
answers
689
views
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
...
0
votes
1
answer
1k
views
Cannot run tests on h2 in-memory database, rather it runs on PostgreSQL
(I have multiple related questions, so I highlight them as bold)
I have a play app.
play: 2.6.19
scala: 2.12.6
h2: 1.4.197
postgresql: 42.2.5
play-slick/play-slick-evolutions: 3.0.1
slick-pg: 0.16.3
...
2
votes
0
answers
588
views
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 ...
2
votes
1
answer
1k
views
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'...