Questions tagged [slick]

Slick acronym for Scala Language-Integrated Connection Kit, is a modern database query and access library for Scala by Lightbend.

Slick

Slick is a modern database query and access library for Scala. It allows you to work with stored data almost as if you were using Scala collections while at the same time giving you full control over when a database access happens and which data is transferred. You can write your database queries in Scala instead of SQL, thus profiting from the static checking, compile-time safety and compositionality of Scala. Slick features an extensible query compiler which can generate code for different backends.

Slick (Scala Language-Integrated Connection Kit) is Lightbend‘s Functional Relational Mapping (FRM) library for Scala that makes it easy to work with relational databases. It allows you to work with stored data almost as if you were using Scala collections while at the same time giving you full control over when a database access happens and which data is transferred. You can also use SQL directly. Execution of database actions is done asynchronously, making Slick a perfect fit for your reactive applications based on Play and Akka.

2469 questions
1
vote
1 answer

I run the typesafe activator example play-slick

I run typesafe activator example play-slick https://www.typesafe.com/activator/template/play-slick but I compile it by sbt instead of activator command. even I delete all javascript in views, there is still errors. the error as below: when I run it,…
user504909
  • 9,119
  • 12
  • 60
  • 109
1
vote
2 answers

Scala Slick 2.0 and SQlite3 insert speed and PRAGMA

This questions is similar to these: SQLite insert speed slows as number of records increases due to an index Improve INSERT-per-second performance of SQLite? I have to index certain features from the Wikipedia XML dump. The parsing is fast.…
Karsten
  • 882
  • 6
  • 18
1
vote
1 answer

Difficult with Scala's implicit parameter resolution

I have the following code, which is resulting in a compilation error because the compiler (2.10.3) is unable to find an implicit parameter for a method call: package (...).construcao.light import scala.slick.jdbc.{ GetResult, StaticQuery => Q…
Matheus Moreira
  • 2,338
  • 4
  • 24
  • 31
1
vote
1 answer

slick: how to get rows without knowing number of columns

I am running a stored procedure as plain sql in scala slick. This means that number of columns are determined at runtime based on paramters passed to stored procedure. Since the schema is not known before hand, I cant map to a class. Is there anyway…
Rahul
  • 903
  • 8
  • 16
1
vote
1 answer

Slick Lifted Embedding: working with CURRENT_DATE (from PostgreSQL)?

I am struggling to use CURRENT_DATE from PostgreSQL with Slick lifted embedding. I want to use it as a default value for a column, and to use it for calculating delays: CREATE TABLE Test(id serial PRIMARY KEY, updated date DEFAULT…
scand1sk
  • 1,114
  • 11
  • 25
1
vote
0 answers

Scala/Play/Slick: select database name in DB.withSession

I'm using Slick in my Scala/Play project. In the config I've defined my database URL like this: db.default.url="jdbc:mysql://localhost" I have this simple method that runs a query. I need it to work on multiple databases(that cannot be defined in…
Caballero
  • 11,546
  • 22
  • 103
  • 163
1
vote
1 answer

slick mapping an array of records for postgres

Could someone help me out by showing me how to map these two types : case class forumQuote( index: Int, startOffset: Int, endOffset: Int, isDirect: Boolean, …
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
1
vote
1 answer

NPE when accessing val that is not lazy

EDIT2: So another heads up on this: I still have no idea why this happens, but I have now a similar problem with jOOQ and the Dialect I have to it. My code here looks like this: object MyDB { private lazy val dialect = SQLDialect.POSTGRES …
Cola Colin
  • 233
  • 1
  • 2
  • 10
1
vote
0 answers

Updating a Table With More than 22 Columns

Many of us that have used Slick have come across the issue of having a table with more than 22 columns. Thankfully, the following post in the Slick Google group has saved many of us a lot of trouble.…
Andrew Jones
  • 1,382
  • 10
  • 26
1
vote
1 answer

Sharing common queries across models in slick?

I have just started using slick and have found myself writing duplicate code for common queries. What techniques have people used to share common queries across Models? For example, in the MyModel object that extends Table[SomeOtherType], I might…
mushroom
  • 6,201
  • 5
  • 36
  • 63
1
vote
2 answers

Does the Play-Slick plugin support Slick 2.0 at all?

I was trying to get a simple Play 2.2/Slick 2.0.0-M3/Postgres 9.2 test app going, being new to Slick and only so experienced with Play. I noticed Slick's been making great progress with simplifying the API, so I prefer 2.0. However, I don't see…
sdanzig
  • 4,510
  • 1
  • 23
  • 27
1
vote
2 answers

Summarizing/aggregating a Scala Slick object into another

I'm essentially trying to recreate the following SQL query using Scala Slick: select labelOne, labelTwo, sum(countA), sum(countB) from things where date > 'blah' group by labelOne, labelTwo; As you can see, it takes what a table of labeled things…
Mike Cialowicz
  • 9,892
  • 9
  • 47
  • 76
1
vote
0 answers

Understanding scala slick

Now, I'm writing sample for learning scala slick. I'm using some github projs and stackoverflow (Q&A)s. Below my sample code: import scala.slick.driver.PostgresDriver.simple._ import Database.threadLocalSession object TestApp extends App{ case…
Bob
  • 1,351
  • 11
  • 28
1
vote
1 answer

Play! JSON conversion of scala Slick one-to-many relations

After reading this question I'm wondering how you can generate the JSON value of a Directorate and its collection of ServicesAreas. If we're using the new inception mecanism provided by Play! 2.2 we are only formatting the case class Directorate.…
Archange
  • 397
  • 5
  • 21
1
vote
2 answers

Set IGNORECASE and other options for H2 in a Play! Framework test

I've setup my Play! (with Slick) application to use H2 when running tests, and it has worked great so far. I'm getting an error now, because of a plain-SQL query that uses lower-case column and table names, and H2 complains that the TABLE (all…
jbnunn
  • 6,161
  • 4
  • 40
  • 65
1 2 3
99
100