Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native support #5011

Open
CanRau opened this issue Nov 7, 2019 · 59 comments
Open

React Native support #5011

CanRau opened this issue Nov 7, 2019 · 59 comments
Assignees
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/feature A request for a new feature. topic: mobile topic: react native topic: runtime

Comments

@CanRau
Copy link

CanRau commented Nov 7, 2019

Is or will React Native be supported?

@schickling
Copy link
Member

Can you please elaborate a bit @CanRau? Do you mean using Prisma on an iOS/Android device using SQLite as a database?

@CanRau
Copy link
Author

CanRau commented Nov 7, 2019 via email

@janpio janpio transferred this issue from prisma/prisma Dec 13, 2019
@ConnerNovicki
Copy link

Any update on this? I would love it.

@wanseob
Copy link

wanseob commented Jun 14, 2020

These look related to this issue
prisma/prisma1#4525
prisma/prisma1#3719

I'm planning to use prisma client in react native application if it's possible :) Prisma + React SQLite will extremely help us a lot to build applications that need some secure local environments. Something like end-to-end encrypted messengers or blockchain light nodes on mobile.

@janpio
Copy link
Member

janpio commented Jun 15, 2020

These look related to this issue
prisma/prisma1#4525
prisma/prisma1#3719

Prisma 1 PRs and issues are totally unrelated to this repository, as Prisma 2 shares very little with Prisma 1 - sorry.

@wanseob
Copy link

wanseob commented Jun 16, 2020

Prisma 1 PRs and issues are totally unrelated to this repository, as Prisma 2 shares very little with Prisma 1 - sorry.

Gocha, thanks! But I think the voice of the community may not be unrelated :)

@ahmedsmae
Copy link

ahmedsmae commented Sep 1, 2020

Any updates ?
I want to build react-native app and it's gonna be very useful if i can use Prisma to CRUD on the mobile build-in SQLite DB

@pantharshit00 pantharshit00 transferred this issue from prisma/prisma-client-js Jan 13, 2021
@pantharshit00 pantharshit00 added kind/feature A request for a new feature. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. labels Jan 13, 2021
@unix
Copy link

unix commented Jun 12, 2021

Prisma's support for SQLite is perfect and would be the first choice for developers if it could support mobile. Not sure if there is a very large migration cost to add client-side support, any contributors willing to talk about that?

@ImAbhishekTomar
Copy link

😲 This is awesome!! If you provide prisms for react-native!!!!

@ikapo
Copy link

ikapo commented Jan 29, 2022

any update on this?

@VladimirHybriun
Copy link

I'm looking forward to this update as well.

@vladimiremi
Copy link

I'm looking forward to this update as well

@apperside
Copy link

It would be amazing if we could share and use the data model both on the server and the client, it would be a killer feature for Prisma!

@Jmg-21
Copy link

Jmg-21 commented Mar 2, 2022

prisma is one of the best choice for react/nextjs. it will be great if will be supported react-native/expo as well <3

@ansh
Copy link

ansh commented Mar 15, 2022

@expo and @prisma should work together to make this happen or @vercel will eat y'all lunch

@alexn-s
Copy link

alexn-s commented Apr 1, 2022

would love the functionality. it would make things easier

@TalinTheDev
Copy link

Are there any updates yet? Would love to use prisma with rn...

@WilliamPeralta
Copy link

i nees prisma for react native :/

@ansh
Copy link

ansh commented Jul 2, 2022 via email

@moishinetzer
Copy link

Bump. Any updates re this?

There's still a huge want for this!

@WalissonPires

This comment was marked as spam.

@AdityaPainuli
Copy link

Hey guys , I had a web application which uses prisma , planetscale(SQL DB) in next js . I am thinking to make an application for andriod/IOS for the same userbase . Does it possible to do that ? Like can we use planetscale in react native environment ? also prisma

@janpio
Copy link
Member

janpio commented Sep 24, 2022

@AdityaPainuli The mobile application would need to talk to an API on your server that uses Prisma for now.

@moishinetzer
Copy link

The mobile application would need to talk to an API on your server that uses Prisma.

What would you recommend for type safety in that case?

@janpio
Copy link
Member

janpio commented Sep 24, 2022

No recommendation, whatever works with your mobile framework. If it benefits from know about the models in your database, you can create a Prisma generator that outputs some files you can use. But usually the mobile app would be coupled closer to your API, so e.g. the types from the GraphQL API or REST API.

@AvIsBeastMC
Copy link

Any updates?

@vladimiremi
Copy link

Sometimes I wonder what I would need to do and what knowledge I would need to be able to contribute with a feature like that.

@janpio
Copy link
Member

janpio commented Mar 21, 2023

A simple start to help could be a React native application that uses some other Node based ORM or query builder to talk to a database. That could then help us understand how this actually works, and then see if Prisma can achieve the same - or not.

@allandiego
Copy link

allandiego commented Mar 29, 2023

@janpio
Im using react native with expo and typeorm
https://typeorm.io/supported-platforms#expo

example project
https://github.com/typeorm/expo-example

I think this example is with an older version of typeorm, if you need I can create an example with newer version

but basically they adapted a package run in the browser outside the node environment
and have support for sqlite drivers

https://docs.expo.dev/versions/latest/sdk/sqlite/
https://github.com/andpor/react-native-sqlite-storage

import { DataSource } from 'typeorm/browser';
import * as SQLite from 'expo-sqlite';

@arasrezaei
Copy link

++1 for this
Prisma is great

@gabrielrfmendes
Copy link

I believe it is possible to implement this feature for prisma, well now I know what to work on in my spare time hee hee

@vladimiremi
Copy link

How can this be done? Let me join? @gabrielrfmendes

@ansh
Copy link

ansh commented Apr 17, 2023

This is not trivial since Prisma’s core is written in Rust or Go or something. It’s not in JS or C so it’s hard to use on a mobile device without shipping a large binary.

Check out https://github.com/drizzle-team/drizzle-orm which is just TypeScript. I haven’t tested it out with React Native but it’s probably a lot easier to get it to work.

@arasrezaei
Copy link

arasrezaei commented Apr 17, 2023

This is not trivial since Prisma’s core is written in Rust or Go or something. It’s not in JS or C so it’s hard to use on a mobile device without shipping a large binary.

Check out https://github.com/drizzle-team/drizzle-orm which is just TypeScript. I haven’t tested it out with React Native but it’s probably a lot easier to get it to work.

Prisma syntaxe is a lot better.
And if they can compile it to wasm, react native can use wasm

@RyanLarge13
Copy link

Currently prisma has no way of running on Android OS.

As useful as client side ORM's are and despite "Client" in "Prisma Client", Prisma CRUD operations should be ran on a server instead of on client for many reasons, mainly security, this does not exclude React Native.

Ship your backend code and Prisma Client ORM with any deployed Node.js server and run front end React Native requests to your API. Until a full fledged framework is built over React Native, this is how it should be done.

At the end of the day, even a full fledged framework such as Next.js will deploy your Prisma project in this way. No need, and not safe to run Prisma Client ORM on the actual client, respectively.

@allandiego
Copy link

Currently prisma has no way of running on Android OS.

As useful as client side ORM's are and despite "Client" in "Prisma Client", Prisma CRUD operations should be ran on a server instead of on client for many reasons, mainly security, this does not exclude React Native.

Ship your backend code and Prisma Client ORM with any deployed Node.js server and run front end React Native requests to your API. Until a full fledged framework is built over React Native, this is how it should be done.

At the end of the day, even a full fledged framework such as Next.js will deploy your Prisma project in this way. No need, and not safe to run Prisma Client ORM on the actual client, respectively.

Some apps dont need that level of security or a dedicated backend, its just for local database operations using sqlite for example, It already works with others ORMs but prisma is much easier to use compared to others

@Chasty
Copy link

Chasty commented Jun 12, 2023

Any update on this?

@dimonnwc3
Copy link

would like to use prisma with react native as well

@Hareesh-S-T
Copy link

Currently prisma has no way of running on Android OS.
As useful as client side ORM's are and despite "Client" in "Prisma Client", Prisma CRUD operations should be ran on a server instead of on client for many reasons, mainly security, this does not exclude React Native.
Ship your backend code and Prisma Client ORM with any deployed Node.js server and run front end React Native requests to your API. Until a full fledged framework is built over React Native, this is how it should be done.
At the end of the day, even a full fledged framework such as Next.js will deploy your Prisma project in this way. No need, and not safe to run Prisma Client ORM on the actual client, respectively.

Some apps dont need that level of security or a dedicated backend, its just for local database operations using sqlite for example, It already works with others ORMs but prisma is much easier to use compared to others

This also doesn't consider usecases such as building React Native Windows applications, where you might not be needing a server application whatsoever

@AvIsBeastMC
Copy link

yall can go for the create-t3-app turbo stack.
https://github.com/t3-oss/create-t3-turbo/tree/414aff131ca124573e721f3779df3edb64989fd4/

@jcubic
Copy link

jcubic commented Dec 6, 2023

Currently prisma has no way of running on Android OS.

As useful as client side ORM's are and despite "Client" in "Prisma Client", Prisma CRUD operations should be ran on a server instead of on client for many reasons, mainly security, this does not exclude React Native.

Ship your backend code and Prisma Client ORM with any deployed Node.js server and run front end React Native requests to your API. Until a full fledged framework is built over React Native, this is how it should be done.

At the end of the day, even a full fledged framework such as Next.js will deploy your Prisma project in this way. No need, and not safe to run Prisma Client ORM on the actual client, respectively.

React Native client is not the same as a web app client run in the browser. React Native is more like a desktop app. If the app is offline only you should be able to use the Database stored on the device (and being able to Prisma would be great). This is not the same as having SQLite (or IndexeDB) run in the browser tab and having Prisma use that. React Native is more like Electron if you would like to compare it.

I would love to have Prisma run with SQLite on Android via React Native.

@darkartur
Copy link

darkartur commented Feb 9, 2024

I am writing an mobile app and initially I went with the prisma for DB. I liked prisma a lot, but then I needed to make my app to work offline in offline-first manner. I wanted a find a way how I can have the same schema for client and backend, so for this purpose it was necessary to migrate from Prisma to TypeOrm. Didn't liked it much, it felt like downgrade comparing to prisma. I would love to migrate back to prisma if there will be any way to run it on client for offline-first applications.

@HunteRoi
Copy link

Any recent update on the topic from Prisma contributors? I would be very grateful to have such an easy way to communicate with my SQLite database through my React Native app.

@jcubic
Copy link

jcubic commented Apr 15, 2024

I'm not sure if I would be able to do this, but maybe someone can create a PoC of Prisma on React Native. You only need to give the green light that this is something you want to have in the project. Any feedback would be great. Just say:

  • "This will never happen"
  • "Yes we want that in the future"

If you decide, maybe someone will be able to make it work. But saying "yes", someone that would like to try to play with it, will not waste time.

@arasrezaei
Copy link

It's already happening
#23637

@jcubic
Copy link

jcubic commented Apr 15, 2024

It's great news.

@janpio
Copy link
Member

janpio commented May 6, 2024

To learn more about Prisma for Expo and React Native, join us at App.js in Krakow, or keep an eye on the Prisma Blog end of May.

Our CEO will be speaking there:

image

@octalpixel
Copy link

To learn more about Prisma for Expo and React Native, join us at App.js in Krakow, or keep an eye on the Prisma Blog end of May.

Our CEO will be speaking there:

image

Is the Prisma direction heading towards realtime sync as well ? Something to do with Pulse ?

@apperside
Copy link

To learn more about Prisma for Expo and React Native, join us at App.js in Krakow, or keep an eye on the Prisma Blog end of May.

Our CEO will be speaking there:

image

If Prisma will integrate in react native apps with a reasonable price, it will be a huge player in the market, maybe the biggest competitor of mongodb with its "recently" acquired Realm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/feature A request for a new feature. topic: mobile topic: react native topic: runtime
Projects
None yet
Development

No branches or pull requests