ScalikeJDBC is a tidy SQL-based DB access library for Scala developers. This library naturally wraps JDBC APIs and provides you easy-to-use and very flexible APIs.
Questions tagged [scalikejdbc]
97 questions
1
vote
1 answer
Difference between $param and ${param} in scalikejdbc
When using scalikejdbc, is there any difference between:
val test = "test"
sql"""SELECT $test from mytable"""
and
val test = "test"
sql"""SELECT ${test} from myable"""
E.g. will both use prepared-statement-like variable replacement?
All the…

Dreamer
- 13
- 2
1
vote
2 answers
scalike-jdbc - How to specify column alias in query?
I defined an object to help to convert result set into POJO.
// an object, that help to map from query result to POJO,
object Dummy extends SQLSyntaxSupport[Dummy] {
override val tableName = "dummy"
def apply(rs: WrappedResultSet) = new…

Eric
- 22,183
- 20
- 145
- 196
1
vote
1 answer
Monitoring JDBC connection pool
I sometimes get the following exception
SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
While using play framework and scalikeJDBC to connect to a MariaDB instance
Googling around showed it can either be that…

JSelser
- 3,510
- 1
- 19
- 40
1
vote
1 answer
Play framework 2.5: ScalikeJDBC: Connection pool is not yet initialized on start
After upgrading to 2.5 version of Play I'm facing this problem when I try to run project in production mode. It seems like in this version I need to initialize pool manually ScalikeJDBC: Connection pool is not yet initialized.(name:'default)
I can't…

sergeda
- 2,061
- 3
- 20
- 43
1
vote
1 answer
Connection pool is not initialized in unit test with scalikejdbc 2.4.1
I have a problem when running unit test using specs2with scalikejdbc 2.4.1, scalikejdbc-config2.4.1
Here is my code:
object PostDAOImplSpec extends Specification{
sequential
DBs.setupAll
implicit val session = AutoSession
"resolveAll…

Meo Beo
- 474
- 2
- 7
- 17
1
vote
2 answers
ScalikeJDBC, raw SQL failing to map or return a valid result set
I posted this to the scalikejdbc user group, and should also cross post to github issues.
I've seen in the docs examples of running raw queries against a table, i'm trying to get list of IndexEntry with the following code, and while the query is…

ekydfejj
- 339
- 2
- 14
1
vote
1 answer
Why does ScalikeJdbc require an Execution Context when it has a Thread Pool?
In this example an Execution Context is used to process the future.
Why is this used when Scalike has a built in connection pool?
Shouldn't the Future use one of the pool threads to execute? It seems like a real waste to ForkJoin a thread just…

BAR
- 15,909
- 27
- 97
- 185
1
vote
2 answers
batch insert in scalikejdbc is slow on remote computer
I am trying to insert to a table in bulk of 100 ( i heard it's the best size to use with mySQL), i use scala 2.10.4 with sbt 0.13.6 and the jdbc framework i am using is scalikejdbc with Hikaricp , my connection settings look like this:
val…

user1120007
- 268
- 3
- 13
1
vote
1 answer
How to Generating SQL dynamically
I would like to use this library only for generating sql without executing it.
Can you please let me see good example how can i use SQLSytax in order just to generate.
for example :
val query:String = //Use SQLSyntax
println(query)
res1:…

David H
- 1,346
- 3
- 16
- 29
1
vote
0 answers
value withSQL not found
still new in the scalikeJDBC usage,
im having this error when compiling my code which was generated from the "reverse engineering" of mysql Db with scalikejdbc 1.7.7
"not found: value withSQL"
any idea?
def find(id: String)(implicit session:…

binkabir
- 144
- 1
- 6
0
votes
0 answers
What is the best way to do the same as a postgresql "select exists"?
I'm used to doing select exists (select whatever from wherever) to test for existence.
What is the corresponding scalikejdbc idiom?
I can do limit 1 and compare the count to 1 but it seems there must be a better way.

user3416742
- 168
- 1
- 1
- 7
0
votes
0 answers
Need help reusing ScalikeJDBC caller's transaction in method returning Akka stream
I am not able to reuse ScalikeJDBC caller's session in a method that returns Akka stream.
I am trying to write a class for database access that returns Source for use in Akka streaming application.
The following code works:
def retrieveMembers():…

user6722996
- 1
- 2
0
votes
0 answers
Reducing time querying Scalikejdbc
I own an amount about 80 000 rows on 3 tables of database, every time I execute my code, it can take 4-5 minutes to display the result. Do you know if it's possible to reduce this time by adding whatever ?
def findAirportAndRunwayByCountry(code:…

Kev74
- 103
- 7
0
votes
0 answers
How to use SQLSyntaxSupport with a case class containing other case classes
I'm trying to use Scalikejbdc's ORM with SQLSyntaxSupport
The table layout is as follows:
create table samples (
id text
event_name text
event_data text
created_at timestamp
scope text
)
The classes in Scala are as follows
case…

Seddiki Anass
- 306
- 2
- 19
0
votes
1 answer
scalikejdbc: Query/Result caching
I am using the scalikejdbc library to access my Postgres database. The driver I am using is the default org.postgresql.Driver. I am trying to introduce query/result caching but I cannot find any evidence whether scalalike does this by default or if…

Niko
- 616
- 4
- 20