Code Monkey home page Code Monkey logo

skydb's Introduction

Welcome to SkyDB ๐Ÿ‘‹

Version Documentation Maintenance License: GPL--3.0 Twitter: m_maciel6

a JSON powered database (yes, another one) so far you can create templates (kind of like documents), create data, search, filter, update and remove

๐Ÿ  Homepage

DB-1

TODO

TODO.


Install

npm install

Usage

  • create model
  • parameters: model: model name
import skyDB from 'skydb/lib'
skyDB.connection('users');

create records

  • parameters: model: model name, options: {data to be saved, pass as an object}
import skyDB from 'skydb/lib'
skyDB.create('users', { 'fieldName': 'manuel', 'age': 18 })
  • get data by id
  • parameters: model: model name, id: record id
import skyDB from 'skydb/lib'
const getDataById = async () => {
   const value = await skyDB.getById('users','v2dw1efZ5a')
   console.log(value)
}

getDataById()
  • get all data
  • parameters: model: model name, options: {order: [DESC or ASC, the name of the model data key], where: {the name of the model data key: value you want to find}}
import skyDB from 'skydb/lib'
const getAllData = async () => {
 const value = await skyDB.getAll('users', {order: ['DESC', 'fieldName'], where: {'fieldName': 'manuel'}})
 console.log(value)
}
getAllData()
  • update records
  • parameters: model: model name, id: record id, options: {value you want to find want to find}
import skyDB from 'skydb/lib'
const updateData = async () => {
 const value = await skyDB.update('users', 'v2dw1efZ5a', {'fieldName': 'manuel'})
 console.log(value)
}

updateData()
  • remove records
  • parameters: model: model name, id: id of the record to be deleted
import skyDB from 'skydb/lib'
const removeData = async () => {
 const value = await skyDB.remove('users', 'v2dw1efZ5a')
 console.log(value)
}

removeData()

Run tests

npm run test

Author

๐Ÿ‘ค ManuelMaciel

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

All Contributors

Thanks goes to these wonderful people (emoji key):


Diego Prestes

๐Ÿš‡ โš ๏ธ ๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

Show your support

Give a โญ๏ธ if this project helped you!

๐Ÿ“ License

Copyright ยฉ 2021 ManuelMaciel.
This project is GPL--3.0 licensed.


This README was generated with โค๏ธ by readme-md-generator

skydb's People

Contributors

allcontributors[bot] avatar diegolikescode avatar manuelmaciel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

diegolikescode

skydb's Issues

[bug]: order by does not work

  • I'm submitting a ...

    • bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?
    no

  • What is the current behavior?
    the parameter of the function getAll, sort by is not sorting in ascending or descending order

  • What is the expected behavior?
    it should sort in ascending order of the value to be sorted and descending order but it would not be sorting at all

  • What is the motivation / use case for changing the behavior?
    The data that is brought from the json can be sorted.

  • Please tell us about your environment:

    • Version: 1.1.0
    • Browser: none
    • Language: JS
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
    check the function on line 33 in the code of getAll

Add tests

  • I'm submitting a ...

    • bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?
    feature

  • What is the current behavior?
    add test to project, use jest for development

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?
    improve the development process

  • Please tell us about your environment:

    • Version: 2.0.0-beta.X
    • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    • Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Migrate from js to ts

  • I'm submitting a ...

    • bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?
    feature

  • What is the current behavior?

  • What is the expected behavior?
    migrate the code from javascript to typescript

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

    • Version: 2.0.0-beta.X
    • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    • Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.