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

jsqldb-debug-client

v1.0.8

Published

JSQLDB node debug client

Downloads

13

Readme

jsqldb-debug-client

Synchronous client for jsqldb https://jsqldb.org, for the purpose of debugging. It allows a js debugger, e.g. Visual Studio Code, to step through queries. Performance is lower than the asynchronous client (https://github.com/jsqldb/jsqldb-node-client), because there is much more network traffic to allow the client side debugging to take place, whereas the async client does only one request per query (but queries run on server so can't be stepped through)

Available on npm

npm install jsqldb-debug-client

Usage sample

const jsqldb = require('jsqldb-debug-client')

var client = new jsqldb.Client("127.0.0.1", 7591);
let con = client.connect();

con.dbadmin.createdb("db");

con.db.a = {A:"aaa"}
con.db.b = {B:"bbb"}

console.log(con.db.a.A);

console.log(JSON.stringify(con.db.a));

con.db.dbeach(function(k,o) {
    console.log(k); //<--You can set a break point here for example
});

con.db.testf = function(t) {
    console.log("in testf "+t); //Or here :)
    return t;
}

console.log("con.db.testf('a')="+con.db.testf('a'));

Objects are retured as [object JSQLDBSessionQuery], in order that query functions may be chained and lazy loaded. In most cases this just works transpararently, for example

console.log(con.db.a); // logs [object JSQLDBSessionQuery] (normal javascript object would log [object Object]
console.log(JSON.stringify(con.db.a)); //logs { "A":"aaa" } 
console.log(con.db.a.A) //logs 'aaa', because in this case it's a primitive;

console.log(JSON.stringify(con.db.limit(1))); //logs {a : { "A":"aaa" }} 
//The above illustrates why JSQLDBSessionQuery is necessary, it has
//to support query functions, and lasy load only for example one entry from potentially large collections, withour bringing back the
//whole collection

In some cases it may be necessary to render out a JSQLDBSessionQuery to a normal object/array. For that purpose the driver provider the .r() function.

con.db.a.r();

//This creates db.c as a reference to the same object, db.a. Modifiying db.c will modify db.a and vice versa
con.db.c = con.db.a 

//This creates db.d as a new independant copy of db.a, this is equivalent to con.db.d = {A:"aaa"}
con.db.d = con.db.a.r() 

Due to a limitation in v8 wrapping of arrays, in this driver, arrays might be rendered as objects. The .r() function can be used to render them correctly.

con.db.ar = ['a', 'b']
console.log(JSON.stringify(con.db.ar)); //logs { "0" : "a", "1", "b" } 
console.log(JSON.stringify(con.db.ar.r())); //logs ["a", "b" ]
//or equivalent
console.log(JSON.stringify(con.db.r('.ar'))); //logs ["a", "b" ]