我可以将我的反应式应用程序与 Mysql 数据库连接吗 [英] Can i connect my reactive app with Mysql database

查看:30
本文介绍了我可以将我的反应式应用程序与 Mysql 数据库连接吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在互联网上搜索了所有内容.我对reactnative和react很陌生.所以我想知道如何将我的应用程序与 Mysql 连接并执行 CRUD 操作.

I've searched all over the internet. I'm very new to reactnative and react. So i'm wondering how to connect my app with Mysql and perform CRUD operations.

推荐答案

如果您指的是机载数据库,您的最佳选择可能是 Realm,根据他们的 gitHub 页面,在常见操作上甚至比原始 SQLite 还要快,同时保持极其丰富的功能集",react-native-sqlite-storagereact-native-local-mongodb.

If you're referring to an on-board database, your best options are probably Realm, which as per their gitHub page is "faster than even raw SQLite on common operations, while maintaining an extremely rich feature set," react-native-sqlite-storage, or react-native-local-mongodb.

对于设备外,对我有用的方法是使用 react-native-meteor(在此存储库中) 执行 使用 MongoDB 进行 CRUD 操作.当我专门在 Android 中工作时,我使用 MySQL,但 Meteor 和 MongoDB 与 RN 的跨平台部署是一个很好的结合.否则你可以在 React Native 中使用 Fetch,使用 REST API服务器交互,为您提供 JSON 响应(可以使用您熟悉的任何服务器语言),然后从那里开始.祝你好运!

For off-device, what has worked for me--though it was a long road to get there--is using react-native-meteor (at this repository) which does CRUD operations with MongoDB. I used MySQL when I was working exclusively in Android, but Meteor and MongoDB is a nice marriage to RN for cross-platform deployment. Otherwise you can just use Fetch in React Native, use a REST API server interaction that gives you a JSON response (which can use any server language you're comfortable with), and go from there. Good luck!

这篇关于我可以将我的反应式应用程序与 Mysql 数据库连接吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆