Socket
Book a DemoInstallSign in
Socket

@eduact/lucid-fetch-helper

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eduact/lucid-fetch-helper

get all data for certain database model with pagination ,filtration ,date range ,sort by column and search query all in one request

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
2
Created
Source

lucid-fetch-helper

Installation

npm install --save lucid-fetch-helper

or using yarn

yarn add lucid-fetch-helper

Usage

import fetch from "lucid-fetch-helper"

const response = await fetch(LucidModel,columnsSettings, pagination, orderBy, searchQuery, filters, dateRange, customColumnsSelectionList,excludedSearchColumns)
...

API

ParameterDescription
LucidModelLucid Orm Model
columnsSettings{ customColumnsSelectionList : ['columnName1',...], method : 'include'
paginationobject defines pagination settings {page:number,perPage:number(defaults to 15)}
orderByobject defines column to order by {filed:"columnName" ,direction:"asc"
searchQuerystring to search with in all database columns (generic search)
filtersan array of key:value pairs defines filtration criteria [{gender:"male"}]
dateRangedate range to filter by {from:"YYYY/MM/DD",to:"YYYY/MM/DD"} note that from and to are optional witch means you can define dateRange object as follows {from:"YYYY/MM/DD"} Or {to:"YYYY/MM/DD"}
excludedSearchColumnslist of columns that should be excluded from generic search i.e. any non string values ex ['isActive','id',...] Note by default 'id','updated_at','created_at' columns are excluded

Keywords

lucid

FAQs

Package last updated on 05 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.