Lift and Photon search for database in different folders
See original GitHub issueGiven a schema
datasource db {
provider = env("PRISMA_PROVIDER")
url = env("PRISMA_URL")
}
generator photon {
provider = "photonjs"
}
model Role {
id String @default(cuid()) @id
role String @unique
}
and package.json
{
"private": true,
"scripts": {
"dev": "PRISMA_PROVIDER=sqlite PRISMA_URL=file:./dev.db prisma2 dev",
"seed": "PRISMA_PROVIDER=sqlite PRISMA_URL=file:./dev.db ts-node prisma/seed.ts"
},
"dependencies": {
"prisma2": "^2.0.0-preview-6.1",
"ts-node": "^8.3.0",
"typescript": "^3.5.3"
}
}
and seeding script
import Photon from "@generated/photon";
new Photon().roles
.create({
data: {
role: "DEFAULT"
}
})
.then(console.log)
.catch(console.error)
.finally(() => process.exit());
when I run prisma2 dev and seed script
yarn dev
yarn seed
I see an error
Invalid `photon.()` invocation in /Users/roman.paradeev/workspace/photon-tslint-bug/prisma/seed.ts:4:4
Reason: Error in connector: Error querying the database: no such table: dev.Role
and I see two databases created.
<project root>/prisma/dev.db
created byprisma2 dev
<project root>/dev.db
created byts-node prisma/seed.ts
When I change PRISMA_URL
for seed script
"dev": "PRISMA_PROVIDER=sqlite PRISMA_URL=\"file:./dev.db\" prisma2 dev",
"seed": "PRISMA_PROVIDER=sqlite PRISMA_URL=\"file:./prisma/dev.db\" ts-node prisma/seed.ts"
seeding script runs without errors.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Type-safe Database Access & Declarative Migrations | Prisma 2 ...
We are excited to share the Prisma 2 Preview today. It features a type-safe database client (Photon) and a declarative migration system (Lift)....
Read more >How to use Find and Locate in Linux - Cyber Photon
Is much faster, but uses an 'older' database and searches only names or parts of them. ... But each of them work in...
Read more >Prisma 2.0.0-preview-11 Release - GitClear
237 Diff Delta ... Browse Other Releases ... Lift and Photon search for database in different folders · Upload introspection engine binary to...
Read more >Building a Habit Tracker with Prisma 2, Chakra UI, and React
Prisma unifies access to multiple databases at once (coming soon) and therefore ... We find the habit by calling ctx.photon.habits.
Read more >Getting Started with Databricks SQL Analytics
You can put loads of just interesting data in there, which you can't really do if you're working in relational environment. And so...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My apologies, a package wasn’t updated properly. It’s fixed now in
prisma2@2.0.0-alpha.185
.Yes, I agree with this