#table does not exist in bdd but does exist
12 messages · Page 1 of 1 (latest)
main here is potentially the schema, in pg it's usually public by default
and how can I change it to public or private using sqlite it was telling me that schemas was not a known property ?
also try mapping each model by adding an @@map(“nameModel”) at the end.
and I get this error :
PrismaClientKnownRequestError:
0|bundle | Invalid `prisma.configurations.findMany()` invocation:
0|bundle | The table `main.Configurations` does not exist in the current database.
code: 'P2021',
0|bundle | clientVersion: '5.17.0',
0|bundle | meta: { modelName: 'Configurations', table: 'main.Configurations' }
is adding the word main
Can you connect to your sqlite db with a tool like dbeaver so you can see the schemas and such? I only looked quickly, but I didn't see any config value where you could set a different schema. You can think of schemas here as a separate set of tables on the same database similar to how I have many databases on my local pg server. You don't see it often anymore (mostly in data lakes), but in theory From waa-db I could query the jared database with select * from jared.public.table (don't do this in practice please), but cross schema queryies/addressing can be done.
https://www.prisma.io/docs/orm/prisma-schema/overview/data-sources
On the very top of this article it shows a way to designate which schema to use in the connection url for postgres. There may be something similar for sqlite. I haven't needed sqlite for anything in years though.
I use the sqlite viewer extension to view my database and tables
my tables exist and have content but when generating and in the connection string I use :
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}```
the problem comes when I pack all my backend and I want to use pm2 to build the bundle it tells me that the table main.configurations does not exist and it is only called configurations.
Ok, can you connect to that remote database and see if say your migrations applied, in this case at all?