npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-mssql

v0.1.4

Published

MSSQL bindings for React Native (Android)

Downloads

115

Readme

react-native-mssql

MSSQL Native Plugin for React Native for Android

This is a basic implementation of MSSQL on Android allowing opening, closing and running sql on remote databases. This plugin does not allow an MSSQL database to be packaged locally on Android devices. The plugin only communication between remote databases.

Please let me know your projects that use these MSSQL React Native modules. I will list them in the reference section. If there are any features that you think would benefit this library please post them.

Step 1 - NPM Install

npm install --save react-native-mssql

Step 2 - Linking dependencies

react-native link react-native-mssql

Using The Plugin

import MSSQL from 'react-native-mssql';
...

Connect a Database

    const config = {
        server: '192.168.1.1', //ip address of the mssql database
        username: 'sa', //username to login to the database
        password: 'password', //password to login to the database
        database: 'admin', //the name of the database to connect to
        port: 1234, //OPTIONAL, port of the database on the server
        timeout: 5, //OPTIONAL, login timeout for the server
    }
    const connected = await MSSQL.connect(config);

Returns a promise indicating if the connection was successful.

Execute SQL

    const query = 'SELECT TOP * FROM USERS'
    const result = await MSSQL.executeQuery(query);

Returns a promise with the query results. If Getting data from a table the promise will return an array of objects for each table row.

Execute Update SQL

    const query = 'UPDATE USERS SET Active=0'
    const result = await MSSQL.executeUpdate(query);

Returns a promise with the number of rows updated. Use this method if performing INSERT, UPDATE or DELETE statements on a database.

Close a Database

    const closed = await MSSQL.close();

Closes the currently open database (if any) and returns a promise indicating if the close was successful. It is not necessary to open and close the database when required unless working with multiple databases.