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-esoftplay-db

v1.0.7

Published

an SQLite helper for esoftplay developer

Downloads

4

Readme

Esoftplay SQLite Helper

A SQLite helper for esoftplay developer

note : this module require to install expo first

Instalation

  1. install the npm package
npm install --save react-native-esoftplay-db
  1. Create class extends Helper (simple example)
export default class Event extends Helper {
  *require
  // table name
  static table = 'event'

  // fields
  static id = 'id'
  static title = "title";
  static intro = "intro";
  static description = "description";
  static image = "image";
  static created = "created";
  static url = "url";
  sql = "CREATE TABLE IF NOT EXISTS '" + Event.table + "' (" + this.getSQLFormat() + ")" 

  //*require
  constructor() {
    super();
    this.init(Event.table, this.sql)
  }

  //*require
  getColumn() {
    return [Event.id, Event.title, Event.intro, Event.description, Event.image, Event.created, Event.url]
  }
}
  1. done

Usage

CREATE OBJECT FROM DB
var db = new Event()
INSERT
db.Insert(values, insertId, debug)

Arguments

  • values (object) - object with key-value to insert
  • insertId (callback) - callback with 1 param (insertId)
    • insertId: last id after insert
  • debug(0|1) : console log db process default 0
UPDATE
db.Update(id, values, rowAffected, debug)

Arguments

  • id (string|int) - an id for 'where' reference
  • values (object) - object with key-value to update
  • rowAffected (callback) - callback with 1 param (rowAffected)
    • rowAffected: how many row affected in this execution
  • debug(0|1) : console log db process default 0
DELETE (with WHERE id)
db.Delete(id,rowAffected, debug)

Arguments

  • id (string|int) - an id for 'where' reference
  • rowAffected (callback) - callback with 1 param (rowAffected)
    • rowAffected: how many row affected in this execution
  • debug(0|1) : console log db process default 0
DELETE (with WHERE clause)
db.Delete(fields,arguments, rowAffected, debug)

Arguments

  • fields (array) - an array fieldname
  • arguments (array) - an array argument to match with fields
  • rowAffected (callback) - callback with 1 param (rowAffected)
    • rowAffected: how many row affected in this execution
  • debug(0|1) : console log db process default 0
GET ONE ROW (with WHERE id)
db.getRow(id, result, debug)

Arguments

  • id (string|int) - an id for 'where' reference
  • result (callback) - callback with 1 param (result)
    • result: query result
  • debug(0|1) : console log db process default 0
GET ONE ROW (with WHERE clause)
db.getRow(fields, arguments, result, debug)

Arguments

  • fields (array) - an array fieldname
  • arguments (array) - an array argument to match with fields
  • result (callback) - callback with 1 param (result)
    • result: query result
  • debug(0|1) : console log db process default 0
GET ALL
db.getAll(result)
db.getAll(result, debug)
db.getAll(orderBy, result) 
db.getAll(orderBy, result,debug)
db.getAll(fields, arguments, result)
db.getAll(limit, offset, result)
db.getAll(fields, arguments, result, debug)
db.getAll(limit, offset, result, debug)
db.getAll(fields, arguments, orderBy, limit, offset, groupBy, result, debug) 

Arguments

  • fields (array) - an array fieldname
  • arguments (array) - an array argument to match with fields
  • orderBy (string) - fieldname
  • limit (int) - limit query result
  • offset (int) - offset query result
  • groupBy (string) - fieldname
  • result (callback) - callback with 1 param (result)
    • result: query result
  • debug(0|1) : console log db process default 0
CUSTOM QUERY
db.execute(query, result, debug)

Arguments

  • query (string) - an sql query
  • result (callback) - callback with 1 param (result)
    • result: query result with webSQLiteResult format
  • debug(0|1) : console log db process default 0

Example

GET ROW
db.getRow([Event.title, Event.Intro], ['masmun','jos'], (result)=>{ //do your stuff })