slick-2.0 Questions
3
I've a table user_permissions which has 46 permission columns along with id and created_date. This table has a corresponding UserPermissions class:
class UserPermission(val id: Long,
val createdD...
Customs asked 9/7, 2015 at 14:37
1
I know as of slick 2.1. one can use ConstColumn for take and drop in precompiled Query's using "Compiled".
private val findXXXCompiled = Compiled {
(someId:Column[Long], sortBy:???, drop:ConstC...
2
I'm doing things with Addresses, and the member subpremise(apartment/condo #) causes retrieves to miss. I also have concerns about subpremise being a part of my unique index constraint, given it ca...
Nee asked 24/6, 2014 at 15:39
2
Solved
I'm stuck with a slick query and I unfortunately can't find a similar example.
Config:
scalaVersion := "2.11.7"
libraryDependencies += "com.typesafe.play" %% "play-slick" % "2.1.0"
Heres the sc...
Parry asked 19/12, 2018 at 9:11
2
Solved
I am completely new to Slick. I am trying to create a basic table type, but it just doesn't compile. Here's my code:
import scala.slick.driver.PostgresDriver._
import scala.slick.lifted.Tag
import...
2
I'm having some difficulties querying/filtering in Slick 2.1.0 when using a custom column type.
A simplified version of my problem:
import scala.slick.driver.MySQLDriver.simple._
sealed class Sta...
2
I am trying to print an interpolated Slick2 SQL statement for debugging and all I get is the one with question marks e.g.
def query(name: String) = sql"SELECT MAX(age) FROM users WHERE name = $nam...
Student asked 23/10, 2015 at 16:48
2
I currently have a set of Data Access Objects named with the convention *SlickRepo. So for instance, UserSlickRepo, DistributionSlickRepo, ContentSlickRepo, etc...
Each of these Repos have methods...
2
Solved
I want to use DateTime in Slick 2.0 model. I use jodatime:
I added the dependencies in Build.scala:
"joda-time" % "joda-time" % "2.3",
"org.joda" % "joda-convert" % "1.6"
I then do:
class C...
1
Solved
How do I filter rows in Slick if a column is null?
val employees = Queryable[Employees]
// Error
val query = employees.filter( _.terminationDate == Nil )
Might be important to note that
termi...
1
I am working on a sbt plugin that generates Scala models given a database using Slick code generator
I would ofcourse want users to override the code generator so my plugin needs to support this:
...
Cinda asked 19/11, 2014 at 19:6
1
Looking at the <> method in the following scala slick class, from http://slick.typesafe.com/doc/2.1.0/api/index.html#scala.slick.lifted.ToShapedValue, it reminds me of that iconic stackoverfl...
1
Solved
I have these case classes:
case class PolicyHolder(id : String, firstName : String, lastName : String)
case class Policy(address : Future[Address], policyHolder : Future[PolicyHolder], created : ...
1
Solved
I want to do this SELECT MAX(age), MIN(age) FROM users WHERE name = 'Rick'. The best I came up with involves 2 queries: Users.filter(_.name === 'Rick').map(_.age).max
1
Solved
In slick we can use
query.filter( m => (m.state === state1 && m.status === status1) || (m.state === state2 && m.status == status2))
for an "OR" condition in where clause. Ho...
Handtomouth asked 8/11, 2014 at 10:5
2
Solved
Looking for a way to do a batch update using slick. Is there an equivalent updateAll to insertALL? Goole research has failed me thus far.
I have a list of case classes that have varying status. Ea...
1
Suppose I have a table with a number of small columns, and a large (say BLOB) column:
case class Thing(id: Int, small1: String, small2: String, small3: String, large: String)
class ThingMapping...
1
In the following code I can insert my records just fine. But I would really like to get back the ID of the inserted value so that I can then return the object as part of my response.
def postEntry...
Faints asked 29/8, 2014 at 21:4
1
Solved
For example I have this case class:
case class User(
var identityId: IdentityId, //Its a user created class
var firstName: String,
var lastName: String,
var fullName: String,
var email: Optio...
Garvy asked 16/8, 2014 at 12:7
2
Solved
I know I can update two columns in Slick 2.0 with:
val q = for (user <- Users if user.id === id) yield (user.name, user.city)
q.update((newName, newCity))
But I've seen something like this wo...
Ancona asked 12/6, 2014 at 0:40
1
Solved
I am using slick 2.0.1 (and can upgrade if required) and I want to retrieve the auto incrementing value from the database (postgresql).
I have seen a few questions on SO on this already, but they ...
Commie asked 29/5, 2014 at 2:10
1
Solved
I have a table with an Int column TIME in it:
def time = column[Int]("TIME")
The table is mapped to a custom type. I want to find a maximum time value, i.e. to perform a simple aggregation. The ...
3
Solved
According to the Slick 2.0 documentation,
to get the count of rows in a table:
val q1 = coffees.length
// compiles to SQL (simplified):
// select count(1) from "COFFEES"
However, it turns out t...
1
Solved
I use slick 2.0 and I have a simple case class :
case class Message(id: Option[Long], userId: Option[Long], body:String, creationDate:Date)
And the following mapping :
class Messages(tag: Tag...
1
Solved
I've been looking around on how to implement a generic trait for commons CRUD and other kinds of operations, I looked at this and this and the method specified are working well.
What I would like ...
Alton asked 28/4, 2014 at 15:37
1 Next >
© 2022 - 2024 — McMap. All rights reserved.