react-native-my-sql-connection
v1.0.4
Published
Simple way to connect direct from react-native and execute SELECT, UPDATE and DELETE commands for MySql database(only for Android for now), dont use this to connect a remote database outside your LAN network
Downloads
24
Maintainers
Readme
react-native-my-sql-connection
Getting started
$ npm install react-native-my-sql-connection --save
Mostly automatic installation
$ react-native link react-native-my-sql-connection
Usage
import MySqlConnection from 'react-native-my-sql-connection';
let config = {
host:'hostname',
database:'mydatabase',
user:'myUser',
password:'myPassword',
port:3306 \\ optional default 3306
params:'?zeroDateTimeBehavior=convertToNull' \\ optional
};
try{
const connection = await MySqlConnection.createConnection(config);
let res = await connection.executeQuery('SELECT * FROM myTable');
connection.close();
}catch(err){
// handle error
}