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
2
votes
4 answers

SBT not resolving Squeryl dependency

I recently started a new project with the Play! Framework and Scala. I'm used to using Squeryl for my ORM, but for some reason it cannot resolve my dependency this time (Although it will resolve others, just not squeryl). The only thing I'm doing…
damian
  • 1,419
  • 1
  • 22
  • 41
2
votes
1 answer

how to understand the following scala call

I have a quite puzzling question. I am playing with squeryl, and found when I used: package models import org.squeryl.{Schema, KeyedEntity} object db extends Schema { val userTable = table[User]("User") on(userTable)(b => declare( …
user1096734
2
votes
2 answers

How do I use Squeryl's KeyedEntity?

The only information I could find relating to KeyedEntity was: Objects that extend KeyedEntity[K] where K is a numeric type will have their id field assigned their newly created primary key value (the mechanism for generating keys is specific to…
Mark
  • 5,286
  • 5
  • 42
  • 73
2
votes
1 answer

Squeryl partial update does not compile

I'm not sure what squeryl is trying to tell me here: Error: Cannot prove that org.squeryl.dsl.fsm.Unconditioned =:= org.squeryl.dsl.fsm.Conditioned. On: inTransaction { update(AppDB.postTable) { p => where(p.id === postId) set(p.upVotes :=…
Eugene Cheipesh
  • 373
  • 1
  • 9
2
votes
1 answer

How to unique Indexes in combination of columns in Squeryl

How can i define unique constraints in combination of columns in squeryl schema? A | B 2 1 allow 2 3 allow 3 1 allow 2 1 don't allow same with row one
weakwire
  • 9,284
  • 8
  • 53
  • 78
2
votes
1 answer

Squeryl 0.9.5 (with Lift 2.4) not releasing database connections/pools

Following the recommended transaction setup for Squeryl, in my Boot.scala: import net.liftweb.squerylrecord.SquerylRecord import org.squeryl.Session import org.squeryl.adapters.H2Adapter SquerylRecord.initWithSquerylSession(Session.create( …
Grant
  • 221
  • 2
  • 7
2
votes
1 answer

How to do something on delete in Squeryl

I have A and B(a_id:Long) entities. B depends on A. So I've set constrainReference(onDelete cascade). Everything works fine. But when I delete A I want to free some resources depending on B. Can somehow intercept B's onDelete() and perform…
weakwire
  • 9,284
  • 8
  • 53
  • 78
2
votes
1 answer

Select all with Squeryl scala

I'm trying to select ALL of some table in a query. I have to specify a where clause (or so I tihnk), so what goes in there? def all() = transaction { from(AppDB.users)(s => where(WHAT GOES HERE?) select(s)).toIndexedSeq }
LuxuryMode
  • 33,401
  • 34
  • 117
  • 188
2
votes
1 answer

Error "java.util.Date does not take parameters" in Squeryl's where "clause"

I'm fairly new to Scala and currently using an ORM called Squeryl against our MySQL database. What I'm trying to do is looking up plural records that fall within a time range. For example, in plain SQL, I think it would be something like: SELECT…
Hongweng
  • 129
  • 1
  • 8
2
votes
3 answers

Dynamically generate case class in Scala

I want to read a rather large csv file and process it (slice, dice, summarize etc.) interactively (data exploration). My idea is to read the file into a database (H2) and use SQL to process it: Read the file: I use Ostermiller csv parser Determine…
teucer
  • 6,060
  • 2
  • 26
  • 36
2
votes
1 answer

What's Squeryl syntax for exclusion (i.e. != )?

Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried: j.id not jobExclude and j.id != jobExclude however the first triggers a compiler error and the second triggers a runtime error. The whole transaction: from(DB.jobs)(j…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
1
vote
1 answer

Squeryl NullPointerException on simple database Insert?

Using Play! 1.2.4, Scala, and Squeryl with Postgres Performing a simple DB insert like usual and all of the sudden the database has started throwing NullPointerExceptions like crazy. All started when I created an email invite handler that could…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
1
vote
1 answer

Store long strings with Squeryl

I'd like to use VARCHAR(255) or TEXT MySQL data type to store a name of scientific article. Squeryl creates VARCHAR(128) fields to store strings. How do I configure it to use larger fields?
Basilevs
  • 22,440
  • 15
  • 57
  • 102
1
vote
1 answer

Play! issue with @Before, traits, and Squeryl throwing closed connections?

Updated Question After some further debugging I've updated this question to be more accurate on the actual problem. I have a trait I've defined to do a basic security check but every time I want to run a DB query it throws a Cannot operate on a…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
1
vote
2 answers

How to properly set value of an object in Scala?

I've got a Scala def that takes parameters from an HTTP POST and parses the data. I'm pulling a "job" object from the database (the query was successful as verified in the debugger, and parameters are just as they need to be) and I'm trying to…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140