Open hyochan opened 5 months ago
Hi Hyo,
Just to be sure - did you implement this step in your app?
import '@prisma/react-native';
import { PrismaClient } from '@prisma/client/react-native';
const baseClient = new PrismaClient();
async function initializeDb() {
try {
baseClient.$applyPendingMigrations();
} catch (e) {
console.error(`failed to apply migrations: ${e}`);
throw new Error(
'Applying migrations failed, your app is now in an inconsistent state. We cannot guarantee safety, it is now your responsibility to reset the database or tell the user to re-install the app'
);
}
}
I removed prisma
folder and move files to root
of the project and made it work!
However, app.db
rows are not updated but strangely, the new row data is readable in app 🤔
Thank you for the update!
That's an understandable confusion. The app.db
file in your repository is different from the app.db
on the device or simulator. We should clear that up somehow. And we need to introduce a way to view the data on the device during development. Perhaps Prisma Studio could connect to the app over the network and red the on-device db that way. We'll figure something out.
Are we good to close this issue for now?
I removed
prisma
folder and move files toroot
of the project and made it work! However,app.db
rows are not updated but strangely, the new row data is readable in app 🤔
+1 on @hyochan's solution. I moved the scheme file, db, and migrations folder to the root (not the src) directory and got it working. This should be clarified in the readme.
Does @prisma/react-native work with mongodb
I have followed the tutorial and face below issue while creating user.
Migration done correctly, and
extendedClient.user.useFindMany()
is working. However, when I try to create user, it shows above error.Below is my current sqlite status.