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
1
vote
0 answers

PhoneGap + Database How save a result in the database & how use data stock in a page

My uderstanding of Javascript is really limited. I have a simple calculation to make. A B and C are 3 inputs numbers and I need the result D in the database iOS for future use, using Phonegap and jQuery. [ (A-10) / (200/B) ] + [ (C/10) x…
louminsk
  • 99
  • 1
  • 1
  • 6
1
vote
1 answer

Assertion Failure when trying to create OneToMany Relation using Squeryl

I have two classes in a database, and wish to set up a one to many relation. Nothing complicated. However, I'm getting an assertion failure in squeryl's _splitEquality (on line 576). Squeryl is version 0.9.5 So I have a schema object Tables extends…
Squidly
  • 2,707
  • 19
  • 43
1
vote
2 answers

DDL equivalence

Is there a way to check the equivalence of two DDLs? To describe the problem, I'm facing: Got a mysql db and a squeryl-based app, that works with it. I want to check, if the db is in the correct state (according to the DDL, genereted by…
George
  • 8,368
  • 12
  • 65
  • 106
0
votes
2 answers

Scala timestamp/date zero argument constructor?

Squeryl requires a zero argument constructor when using Option[] in fields. I realized how I could create such a constructor for Long like 0L but how do I create such a thing for a Timestamp or Date? Essentially I need to finish this: def this() =…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
0
votes
1 answer

Stubborn ExceptionInInitializerError after manytoManyRelation added

I'm doing a simple authentication on an app built on Play! and Scala. Up until recently, simple authentication was working just fine until I created a manyToManyRelation in our DB object. The error: ExceptionInInitializerError occured : null The…
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
0
votes
1 answer

Automatically set the created and updated date with squeryl?

I remember seeing a trait that will automatically add the created and updated dates when using either lift's Record or Mapper ORMs. The question is, is there a similar thing for Squeryl to automatically set the date/time the record was inserted and,…
user1043466
  • 333
  • 1
  • 3
  • 10
0
votes
0 answers

Using Squeryl transform a subquery which return rows in a list

Let's say I have this tables in MySQL: Courses: id, name Students: id, name CoursesStudents: idCourse, idStudent I can do: SELECT c.id, cs.idStudent FROM Courses C, CoursesStudents cs WHERE c.id = cs.idCourse For every course I will get some…
M.G.
  • 369
  • 1
  • 14
0
votes
0 answers

in Squeryl can i use string interpolation in where clause?

I have a question lets say i have a record in this form: case class BlahInfoRecord( id: Long, lvl: Int, /*possible values 1,2,3,4*/ id1: Long, id2: Long, id3: Long, id4: Long, parentId: Long ) and in schema I have object blahSchema extends…
Алексей
  • 1,847
  • 12
  • 15
0
votes
1 answer

How I can reuse a SQUERYL order by clause?

I'm currently sorting rows in Squeryl (0.9.9) on various field using this quite terrible pattern matching: sortBy match { case Some("checkId") => orderBy.getOrElse("DESC") match { case "ASC" => where(whereClause(chk)) select(chk) orderBy…
maborg
  • 435
  • 5
  • 24
0
votes
1 answer

select from a table with a list of case class values in where clause

I have a val employees: List[Employee] and I need to query a table in a performant way, around these lines: employees.foreach(employee => Select etable.id from employees_salary etable where etable.id == employee.id and etable.salary < 50000) I…
Scala S
  • 1
  • 1
0
votes
1 answer

what is the correct syntax for squeryl to write or and?

What is the correct syntax to write sql like this squeryl: select * from table where (colA = 'value1' or colA = 'value2' ) and colB = 'value3' ???
AI Joes
  • 69
  • 11
0
votes
1 answer

Squeryl utf8mb4 support

I'm using Squeryl to work with a MySQL database. The tables are in utf8mb4 encoding. Now I want to insert some utf8 (4 byte) strings into the db through Squeryl. How do I do that? I tried to set ?useUnicode=yes&characterEncoding=UTF-8 to my…
Minh Thai
  • 568
  • 6
  • 18
0
votes
1 answer

How to sort list in Scala by specific values

I'm using squeryl and I have a list (query.toList) of classes. The classes have a property ("status") I want to sort on, but I want to sort on an ordering I decide that is not alphabetical or numerical. For example if there was a list of 3 classes:…
Oscar Godson
  • 31,662
  • 41
  • 121
  • 201
0
votes
0 answers

How to store Scala's ADT using Squeryl?

I have this code: sealed abstract class VehicleType case object Bus extends VehicleType case object Trolleybus extends VehicleType case object Tram extends VehicleType case object Metro extends VehicleType //…
0
votes
2 answers

Selecting from relations on squeryl

I am testing(trying) squeryl's relations modeling feature class Foo(val id: Long, val foBar: Long) extends KeyedEntity[Long]{ //Many Foo's can have one Bar. lazy val fbar: ManyToOne[Bar] = myschema.barToFoo.right(this) } class Bar(val id:…
Marcelo Lacerda
  • 847
  • 1
  • 15
  • 30