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

gsql-connector

v0.0.2

Published

A g-sql connector to connect the g-sql data query language with an api in nodejs.

Downloads

3

Readme

G-SQL Connector

This is gsql connector, that helps to connect between g-sql and the nodejs projects.

G-sql is a structured database system that allows you to process data from tables, its the same query we used on other database systems. It only comes with extra advantages of the database system drawbacks.

How to use the connector:

The connector acceptes object paramter.

# To call/reference gsql-connector
const gconnector=require('gsql-connector').connection


# using paramters
gconnector.connect({
   host:"192.168.2.2", # Or this can be a url where database available is, it can be other local network computer
   space:"space1", # This is the space that contains the whole database system
   user:"test_user", # User that has permission to login into the space of that host
   password:"test_user", # Password is password of the user
   port:"3001", # Port of the database where it found in the host
   database:"test1" # This is optional field, it is a database name that found in the host/space/ and database name
})

gconnector.connect({
   host:"https://www.yourwebsite.com",
   space:"space1",
   user:"test_user",
   password:"test_user",
   port:"3001",
   database:"test1"
})


# using the connector to fetch data
gconnector.query('select * from test1.tb1',"",(error,row)=>{
   console.log("rowww",row)
})

How to use inside function:
```sh
# using in a function syncron
function test(){
   gconnector.query('select * from test1.tb1 where name=gide',"",(error,row)=>{
       console.log("row",row)
   })
}
# calling from function
test()

# using in a function async
function testAs(){
  return new Promise((resolve,reject)=>{
       gconnector.query('select * from test1.tb1 where name=gide',"",(error,row)=>{
           console.log("row",row)
           return resolve(row)
       })
  })
}
# calling asyn
async function mytest(){
   let result = await testAs()
   consol.log("result:",result)
   # so result will come as an array like this 
   # result: [
   #     {
   #         message: '',
   #         success: true,
   #         data: [
   #         [Object], [Object]
   #         ]
   #     }
   # ]
   # message: is any text if there is action excuted or something not succeeded in the process
   # success: is a boalean propertie which explains if the process was suceeded or not, if succeeded then it will be true otherwise false
   # data: is any content of the respons of the result, it can hold object, array items, or it can be null as well

   # So this shows that 
   # if you want a message then you could display the message like this result[0].message, 
   # if you want to know if the process was succeed or not then result[0].success, if true then it means the process was succeeded.
   # if you want the data then result[0].data, so all content of the data will be displayed or can be manipulated.
}