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

kaizer-db

v1.2.7

Published

A lightweight and minimal csv database package

Downloads

21

Readme

Kaizer DB

A lightweight and minimal csv database package

logo

Features

  • SQL like syntax
  • Works directly with CSV
  • Supports all CRUD functionalities like INSERT, DELETE etc

Drawbacks

  • No type checking
  • Only one query at a time
  • Doesn't support data with spaces

Getting started

If you are using this package from the GitHub repository

  yarn start
  npm start

If you are using this package from the npm repository

  require('kaizer-db')

That's it! No fancy configuration or boiler code. It's as easy as that!!!

Usage

  • Creating or using a database

      Use Database dbname;
      Create Database dbname;

    Both these commands create a new folder named dbname where the tables are stored as csv files.

  • Show list of tables

      Show Tables;

    Shows list of available csv files in the current directory which is used as the database.

    first

  • Creating a table

     Create Table Warriors (Name,Attack,Defense,PowerLevel);

    Creates a file named Warriors.csv in the current folder dbname with the given headers.

  • Inserting data in a table

      Insert into Warriors (Name,Attack,Defense,PowerLevel) values (Goku,5000,7000,9001), (Vegeta,5000,7000,9000);

    Appends 2 records to the file named Warriors.csv

  • Getting records from a table

      Select * from Warriors;

    select1

      Select Name, PowerLevel from Warriors;

    select2

  • Getting records from a table using WHERE clause

      Select Name from Warriors Where PowerLevel > 9000;

    select3

  • Getting records from a table using multiple WHERE clauses

      Select * from Warriors Where PowerLevel > 9000 and Name = Goku;

    where1

      Select * from Warriors Where PowerLevel > 9000 or Name = Vegeta;

    where2

  • Updating a record using WHERE clause

      Update Table Warriors set PowerLevel = 10000, Defense = 8000 Where Name = Goku;

    updateQuery

  • Deleting a record using WHERE clause

      Delete From Warriors Where PowerLevel < 10000;

    select5

    Order by clause

    The default ordering is ascending order (asc,Asc,ASC)The descending order can be used as (desc,Desc,DESC)

    Examples

    Select * from test_data order by Defense;

    ser1

    Select * from test_data where Attack > 200 order by Defense desc;

    ser2

    Select Name, PowerLevel, Defense from test_data where Attack > 200 Order by Defense;

    ser3

    Error handling

    > Select Name, PowerLevel from test_data where Attack > 200 Order by Defense;
    Error: Order by field needs to be included in fetch list

    The sorting column must be present in the list of columns that needs to be fetched.

How to contribute

  • Fork the repository in your GitHub account.
  • Make your changes.
  • Submit a pull request.
  • Code should well documented.