Questions tagged [squeryl]

Squeryl is a strongly typed, declarative and SQL like DSL for manipulating database objects from within the Scala language.

Squeryl is a strongly typed, declarative and SQL like DSL for manipulating database objects from within the Scala language.

201 questions
4
votes
1 answer

Schema definition in Squeryl using Scala Case Classes

While reading http://squeryl.org/schema-definition.html page of Squeryl project, I noticed case classes are rarely use in the schema definitions. I was wondering if using case classes to model schema definitions is not recommended ? I would use case…
Ali Salehi
  • 6,899
  • 11
  • 49
  • 75
4
votes
1 answer

Persisting Collections with Squeryl

How can I persist a collections field (e.g. List[String] or Set[Int]) with Squeryl? What's the best way to encode it such that Squeryl won't create an association table?
notnoop
  • 58,763
  • 21
  • 123
  • 144
4
votes
3 answers

Support of PostgreSQL specific array_agg function in scala frameworks?

Is there some scala relational database framework (anorm, squeryl, etc...) using postgres-like aggregators to produce lists after a group-by, or at least simulating its use? I would expect two levels of implementation: a "standard" one, where at…
arivero
  • 777
  • 1
  • 9
  • 30
4
votes
3 answers

REST (Squeryl/Akka/Spray) - Very low throughput

I am currently building my first REST API, based around an RSS aggregator. I have it implemented using one of two traits, either a MemoryBasedDB or PostgresDB. On each access to the root url, it will make an asynchronous call out to the feed to grab…
Joseph Sawyer
  • 463
  • 3
  • 11
4
votes
1 answer

Prevent Mixin overriding equals from breaking case class equality

Squeryl defines a trait KeyedEntity which overrides equals, checking for several conditions in an if and calling super.equals in the end. Since super is Object, it will always fail. Consider: trait T { override def equals(z: Any):Boolean =…
Alexy
  • 1,520
  • 2
  • 16
  • 30
3
votes
1 answer

Can I auto generate Squeryl data objects to reflect an existing MySql schema?

I have an existing Schema definition in MySql database. I created the schema using MySql Workbench. I wish to access the schema from my Lift-Scala-Squeryl code. I know that a simple way would be to manually define the schema structure using Squeryl…
David Raviv
  • 397
  • 3
  • 10
3
votes
2 answers

Setting a transaction isolation level in Squeryl

How can I set a transaction isolation level using Squeryl? For instance, right now I am using Postgresql and need serializable isolation for specific single transactions. I use both plain Squeryl and Squeryl-Record with the Lift web…
Dr.Haribo
  • 1,778
  • 1
  • 31
  • 43
3
votes
3 answers

Do any of the Scala ORM's implement code generation from SQL -> Scala?

I am using Squeryl as an ORM with MySQL. This is a new project working with existing schemas that contain several hundred tables. As far as I can tell, neither Squeryl nor any of the available Scala ORMs can generate the O (Scala classes) from the…
Adam Pingel
  • 681
  • 4
  • 19
3
votes
1 answer

Can a Scala method from a base-class be renamed?

I'm rather new to Scala, and I am trying to use lift-squeryl-record in Lift. Scala is 2.8.1 and Lift is 2.3. My problem is that I wanted to use (Mega)ProtoUser from Record, but it conflicts with lift-squeryl-record. I followed the instruction…
Sebastien Diot
  • 7,183
  • 6
  • 43
  • 85
3
votes
3 answers

Best approach to reading Scala DSL code?

On Squeryl getting started page there is a Scala code sample: import sbt._ class Project(info: ProjectInfo) extends DefaultProject(info) { val squeryl = "org.squeryl" % "squeryl_2.8.1" % "0.9.4-RC3" } I'm puzzled because % is not a method…
3
votes
1 answer

What does the SQueryL tilde operator do?

I was reading the SQueryL documentation on updating and I saw: update(songs)(s => where(s.title === "Watermelon Man") set(s.title := "The Watermelon Man", s.year := s.year.~ + 1) ) I had a hard time finding the ~ method from the SQueryL…
Y.H Wong
  • 7,151
  • 3
  • 33
  • 35
3
votes
1 answer

Scala immutability in persistent storage with Squeryl

So as I am reading the Play for Scala book, I came across something odd that was explained in the book. This is the relevant snippet: There's something strange going on, though. If you're using immutable classes—which vanilla case classes are—you…
smac89
  • 39,374
  • 15
  • 132
  • 179
3
votes
0 answers

Apply Play framework's downs evolution after test

I try to test my play 2 application with scalatest. To test the model I use test database. Each time I run tests the data inserts again. So I need to delete data after test or even drop all the tables. My code is: import models.User import…
pimezone
  • 113
  • 1
  • 1
  • 5
3
votes
1 answer

Squeryl fails to reflect in debug mode only

I can't debug (simple run works fine) my unit tests. Squeryl fails with the following exception: error while reflecting on metadata for (Some(private scala.Option com.company.play.model.db.mapping.Position.orgUnit2id),Some(public…
Alexander
  • 452
  • 6
  • 15
3
votes
2 answers

Squeryl: how to compare Option[T] objects in where clause?

I got stuck with the following problem. I have a class, say Post, that looks like: case class Post ( id: Int, slug: String, title: String, @Column("postText") text: String, isVisible: Boolean, created: Timestamp, lastUpdated:…
Mike G.
  • 700
  • 5
  • 22
1
2
3
13 14