Giter VIP home page Giter VIP logo

bim-query's Introduction

Bim Query

Bim Query is for front-end web that work with :

framework language progres status project link plan
adonisjs javascript (nodejs) done tested click here done
laravel php - - - immediately
expressjs javascript (nodejs) - - - -

Install

yarn add bim-query

-- or --

npm i --save bim-query

How To

const bimQuery = require('bim-query')

setUrl (optional)

if you need to set default base url

bimQuery.setUrl('https://example/')

base url must end by /

setAuth (optional)

if you need to set authetication bearer

bimQuery.auth('auth')

value must be string without Bearer at first word again

let to start

where (key, arg, value)

  • where (key, value)

    for example, looking for id with number 1

    the query is bimQuery.where('id', 1)

  • where (key, arg, value)

    if you need to put bigger that, small than, but not same

    the query is bimQuery.where('id', '>=' , 1)

  • where (array)

    query in array, you can put more then one query like this

    the query is bimQuery.where([ [ 'location', 'indonesia' ], [ 'age', '>', 18 ] ]) but you can do like this also bimQuery.where('location', 'ind').where('age', '>', 18) that will be return same

orwhere (key, arg, value)

same with where

wherelike (key, value, position)

position Value

  • start_with: (value: string)

    looking for column {key} that start with {value}

    for example : wherelike('key', 'a', 'start_with')

  • end_with: (value: string)

    looking for column {key} that end with {value}

  • any_position: (value: string)

    looking for column {key} that have {value} in any position

  • have_at_{number}: (value: string)

    looking for column {key} that have {value} in the {number}th position

  • start_min_{number}: (value: string)

    looking for column {key} start with {value} and are at least {number} characters in length

  • start_with_end: (value: array)

    Finds any values that start with {value[0]} and ends with {value[1]}

    for example : wherelike('key', ['a', 'd'], 'start_with_end')

between (key, value, value)

if you are looking between some value, for example age between 0-18 between('age', 0, 18)

groupby (key)

offset (key)

limit (key)

orderby (key, value)

with (key)

if table has relation

paginate(max, page) same with page(max, page)

  • paginate(page)
  • paginate(max, page)

first

if you need return just one column

generate()

generate to query object, you can use to third party library

release()

make sure you release if you using this library more than one action in same page for example bimQuery.release().where().with().orderby()

init()

if you want to make new Instance like this : var bimA = new bimQuery.init()

get(url, option)

return for axios library action (promise or async) bimQuery.release().where().with().orderby().page(1).get('user')

post(url, data, option)

put(url, data, option)

delete(url, option)

bim-query's People

Contributors

rachmanzz avatar

Stargazers

 avatar

Watchers

 avatar

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.