Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7028467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:23:26+00:00 2026-05-28T00:23:26+00:00

I already have some simple project with one migration script: # — !Ups create

  • 0

I already have some simple project with one migration script:

# --- !Ups

create table user (
  name        varchar(255) not null primary key,
  password    varchar(255) not null
);

insert into user values ('demo', 'demo');
insert into user values ('kuki', 'pass');


# --- !Downs

drop table if exists user;

Database which I’m using is H2 in memory:

db.default.driver=org.h2.Driver
db.default.url=jdbc:h2:mem:play

Then I obviously want to query some data. When I’m using anorm everything is working properly:

case class User(name: String, password: String)
object User {

  val simple = {
    get[String]("user.name") ~/
    get[String]("user.password") ^^ {
      case name~password => User(name, password)
    }
  }

  def findByName(name: String): Option[User] = {
    DB.withConnection { implicit connection =>
     SQL("select * from user where name = {name}").on(
        'name -> name
      ).as(User.simple ?)
    }
  }
}

unlucky when I try to do the same with ScalaQuery:

object User extends Table[(String, String)]("user") {

  lazy val database = Database.forDataSource(DB.getDataSource())

  def name = column[String]("name", O PrimaryKey, O NotNull)
  def password = column[String]("password", O NotNull)
  def * = name ~ password

  def findByName(name: String) = database withSession {
    implicit db: Session =>
      (for (u <- this if u.name === name) yield u.name ~ u.password).list
  }
}

I always get the same error:

[JdbcSQLException: Tablela "user" nie istnieje Table "user" not found; 
SQL statement: SELECT "t1"."name","t1"."password" FROM "user" "t1" WHERE ("t1"."name"='input_name') [42102-158]]

Is there anything which I’m doing wrong?
I think I strictly follow guide from there: https://github.com/playframework/Play20/wiki/ScalaDatabase

——————— EDIT ———————–

Looks like it’s some kind of incompatibility between Play’s evolutions and ScalaQuery.
When I created table using:

database withSession {
  implicit db: Session =>
    User.ddl.create
    User.insert("demo", "demo")
}

everything seems to work fine.
Maybe later I’ll create some simple MySQL database and check what really happens inside.

——————— EDIT 2 ———————–

So I more or less know what is going on (but I don’t know why).
When I’m creating db structure with evolutions then table name and column names are written down with all uppercase letters.
And since I’m on linux then it matters.
If I would change table and columns names in the code to be uppercase also then everything works.

I’m only curious if it’s a bug or if it’s any way to enforce proper case on migrations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:23:27+00:00Added an answer on May 28, 2026 at 12:23 am

    Most likely, the problem is that the Play! Framework quotes the identifier names (table names, column names) in the query, so that you need to quote the table name in the ‘create table’ statement as well:

    create table "user" (
      "name"        varchar(255) not null primary key,
      "password"    varchar(255) not null
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want the user to be able to have some data already in the
I have already search for some time over the net on how to create
I have a data table which already has some values, plus it is getting
I have an ASP.NET project which has already some custom fields in it's web.config
I have already implemented some AJAX pagination in my Rails app by using the
I already have an enterprise Java EE application. I want expose some of the
This is uni assignment and I have already done some stuff. Please go to
I've been into this problem for a while already, and have asked some questions
I'm stuck with this already for some weeks and I don't have the faintest
I'd like some help from the community, if possible. We have a project at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.