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 🙏

© 2026 – Pkg Stats / Ryan Hefner

student-queue-mariadb-plugin

v0.1.12

Published

MySQL-compatible plugin for my student-queue program

Readme

student-queue-mariadb-plugin

MariaDB-compatible Database plugin for my student-queue project

This project makes use of the mariasql and promised-io npm plugins. It serves as an easy-to-use interface with which to use a MariaDB database with the student-queue program.

Installation

npm install student-queue-mariadb-plugin

Usage

ConfigDB

The ConfigDB is an interface with server configuration, mainly adding, removing, and otherwise maintaining various queues.

Constructor (Used in Student Queue)
var DB = require("student-queue-mariadb-plugin");
var config = new DB({
  host: "localhost",
  user: "myDatabaseUser",
  password: "P@SSW0RD",
  database: "studentqueue"
});
Usage
config.createConfigTable(); // Does nothing if it exists
/*
+-------------+----------------------------------------------+-----------------------------------+
| name        | password                                     | description                       |
+-------------+----------------------------------------------+-----------------------------------+
*/

// This adds an entry to the "config" table and creates a table called "testQueue" to act as the actual queue.
config.addNewQueue({
  name: "testQueue",
  // This password will be hashed before being stored
  password: "password",
  description: "A testing queue for demonstration", // Optional
  // tableName: "testing" // Also optional. Defaults to the value of "name"
});
/*
+-------------+----------------------------------------------+-----------------------------------+
| name        | password                                     | description                       |
+-------------+----------------------------------------------+-----------------------------------+
| testQueue   | XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg= | A testing queue for demonstration |
+-------------+----------------------------------------------+-----------------------------------+
*/

config.setQueueName("testQueue", "cheese");
/*
+----------+----------------------------------------------+-----------------------------------+
| name     | password                                     | description                       |
+----------+----------------------------------------------+-----------------------------------+
| cheese   | XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg= | A testing queue for demonstration |
+----------+----------------------------------------------+-----------------------------------+
*/

config.setHash("cheese", "PASSWORD");
/*
+----------+----------------------------------------------+-----------------------------------+
| name     | password                                     | description                       |
+----------+----------------------------------------------+-----------------------------------+
| cheese   | C+ZK6J3dJOIlQ03pXVAXETObru4Y8Am6m0NpryfTDWA= | A testing queue for demonstration |
+----------+----------------------------------------------+-----------------------------------+
*/

config.setDescription("cheese", "This is a demonstration");
/*
+----------+----------------------------------------------+-------------------------+
| name     | password                                     | description             |
+----------+----------------------------------------------+-------------------------+
| cheese   | C+ZK6J3dJOIlQ03pXVAXETObru4Y8Am6m0NpryfTDWA= | This is a demonstration |
+----------+----------------------------------------------+-------------------------+
*/

// Here the second argument is only required if the table name is not the same as the queue name
// It's a good idea to include it, just in case
config.deleteQueue("cheese", "testQueue");
/*
+----------+----------------------------------------------+-------------------------+
| name     | password                                     | description             |
+----------+----------------------------------------------+-------------------------+
*/

RequestDB

The RequestDB is an interface to a particular queue on the server. It allows you to add and remove requests, get all requests, and empty the queue. These are loaded/updated onto config.queues when config.load() is called.

Constructor
// This is used in ConfigDB.prototype.load()
// RequestDB is not exported by the module and the constructor is not to be used outside of the above function
var queueDB = new RequestDB({
  host: "localhost",
  user: "myDatabaseUser",
  password: "P@SSW0RD",
  database: "studentqueue",
  table: "testQueue" // This table would have been created by config.addNewQueue()
});
Usage
// A request object was received from a student
/*
request = {
  id: 000001,
  name: "Joe Smith",
  problem: "EVERYTHING IS BORKED!!!"
}
*/
queueDB.add(request);
/*
+-----------+-----------+-------------------------+---------------------+
| studentid | name      | description             | timestamp           |
+-----------+-----------+-------------------------+---------------------+
| 000001    | Joe Smith | EVERYTHING IS BORKED!!! | 2016-03-08 17:51:00 |
+-----------+-----------+-------------------------+---------------------+
*/

queueDB.remove("000001");
/*
+-----------+-----------+-------------------------+---------------------+
| studentid | name      | description             | timestamp           |
+-----------+-----------+-------------------------+---------------------+
*/

/*
request1 = {
  id: 000001,
  name: "Joe Smith",
  problem: "EVERYTHING IS BORKED!!!"
}

request2 = {
  id: 000002,
  name: "Sally Jane",
  problem: "I don't understand how the plugin works yet"
}
*/
queueDB.add(request1);
queueDB.add(request2);
/*
+-----------+------------+---------------------------------------------+---------------------+
| studentid | name       | description                                 | timestamp           |
+-----------+------------+---------------------------------------------+---------------------+
| 000001    | Joe Smith  | EVERYTHING IS BORKED!!!                     | 2016-03-08 17:51:00 |
+-----------+------------+---------------------------------------------+---------------------+
| 000002    | Sally Jane | I don't understand how the plugin works yet | 2016-03-08 17:53:00 |
+-----------+------------+---------------------------------------------+---------------------+
*/

queueDB.remove("000001");
/*
+-----------+------------+---------------------------------------------+---------------------+
| studentid | name       | description                                 | timestamp           |
+-----------+------------+---------------------------------------------+---------------------+
| 000002    | Sally Jane | I don't understand how the plugin works yet | 2016-03-08 17:53:00 |
+-----------+------------+---------------------------------------------+---------------------+
*/

// Let's add Joe back in
queueDB.add(request1);
/*
+-----------+------------+---------------------------------------------+---------------------+
| studentid | name       | description                                 | timestamp           |
+-----------+------------+---------------------------------------------+---------------------+
| 000001    | Joe Smith  | EVERYTHING IS BORKED!!!                     | 2016-03-08 17:51:00 |
+-----------+------------+---------------------------------------------+---------------------+
| 000002    | Sally Jane | I don't understand how the plugin works yet | 2016-03-08 17:53:00 |
+-----------+------------+---------------------------------------------+---------------------+
*/

var items = queueDB.getAll();
/*
items = [{id: "000001", name: "Joe Smith", problem: "EVERYTHING IS BORKED!!!"},
         {id: "000002", name: "Sally Jane", problem: "I don't understand how the plugin works yet"}];
*/

queueDB.reset(); // Empties/resets the queue
+-----------+------------+--------------------+---------------------+
| studentid | name       | description        | timestamp           |
+-----------+------------+--------------------+---------------------+