Skip to content
#

jdbc

Here are 2,961 public repositories matching this topic...

ebyhr
ebyhr commented Jan 31, 2022

The current test TestCassandraConnectorTest has some issues:

  • Unrelated types in a table
    • It reduces maintainability when we want to add test cases to a type
  • The definition and data are managed in the different class
    • We need to look for the different class when we want to check the expected values
  • Less coverage in a type
    • Should test min, max, null
    • Should test DST, juli
deusaquilus
deusaquilus commented Oct 26, 2021

The .forall pattern is a great way to create an optional filter for a field that could be defined or not:

case class Person(name: String, age: Int)
val nameOpt: Option[String] = Some("Joe")
run { query[Person].filter(p => lift(nameOpt).forall(_ == p.name)) }
// SELECT p.name, p.age FROM Person p WHERE ? IS NULL OR ? = p.name
// (i.e. when nameOpt := None then the `WHERE ? IS NULL`
du-stripe
du-stripe commented Dec 7, 2021

When using UNION, with ORDER BY or LIMIT within a subexpression's SELECT statement, PostgreSQL requires the SELECT statement be enclosed in parentheses: https://stackoverflow.com/a/24024639 However, the following QueryDSL code causes a syntax error against Postgres because it doesn't generate those parentheses:

val i = Item.syntax("i")
selectFrom(Item.as(i)).orderBy(i.id).u

Improve this page

Add a description, image, and links to the jdbc topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the jdbc topic, visit your repo's landing page and select "manage topics."

Learn more