question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

table `tenderentry` does not exist in the current database: table names case problem

See original GitHub issue

Bug description

I use @prisma/client on it’s own, in my applications, like an ORM, with my own migration system and all other stuff. Till 2.26.0 everything was fine. On 2.28.0 (skipped 2.27.0) all was broken: client now tries to query tables named in lowercase, not in case like models are named. E.g. :

model TenderEntry {
  id String @id @default(cuid())  
}

previously requests like prisma.tenderEntry.findFirst() queried table name TenderEntry, now — tenderentry.

If this is a bug (what I hope it is) — please fix asap.

If not — it is a HUGE breaking change that must be only in major version (besides WHY change this??) and there is even nothing about this in changelogs! You’ve broke all old apps at once or locked them to old client version without possibilty to upgrade client without rewriting migrations and changing tables!

How to reproduce

create any studly cased model, e.g.:

model TenderEntry {
  id String @id @default(cuid())  
}

and a table:

CREATE TABLE `TenderEntry` (
  `id` varchar(25) NOT NULL,
  PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

run any query (e.g. prisma.tenderEntry.findFirst()) and see “table tenderentry does not exist in the current database”

Expected behavior

query should run over TenderEntry table

Prisma information

@prisma/client@2.28.0

Environment & setup

  • OS: Mac OS
  • Database: MySQL
  • Node.js version: v14.13.1

Prisma Version

n/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Aug 13, 2021

That makes me happy any confused at the same time.

I’ll close this for now then, but as soon as you see something like this again (or anyone else!) please comment here again and we will reopen and happily investigate. Weiiiiird.

0reactions
terion-namecommented, Aug 13, 2021

@janpio the most weird thing that I’ve rolled back, after new install 2.29.0 kicked in, and with it everything worked fine. set resolution to 2.27.0 — works set resolution to 2.28.0 — works

Tried different combos and variants — no luck to reproduce.

Maybe this was a heisenbug during client generation that time… Strange 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are table names in MySQL case sensitive? - Stack Overflow
In general: Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. In MySQL, databases...
Read more >
MySQL 8.0 Reference Manual :: 9.2.3 Identifier Case Sensitivity
Although database, table, and trigger names are not case-sensitive on some platforms, you should not refer to one of these using different cases...
Read more >
ODBC error, “table or view does not exist,” is returned by the ...
This article addresses the ODBC error that is returned as a result of adding quotes around a table name or column names of...
Read more >
How to make MySQL table name case insensitive in Ubuntu?
Open terminal and edit /etc/mysql/my.cnf sudo nano /etc/mysql/my.cnf. Underneath the [mysqld] section.add: lower_case_table_names = 1.
Read more >
CREATE TABLE - Snowflake Documentation
If there is no existing table of that name, then the grants are copied from ... a value is not explicitly specified via...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found