Reference Source
public class | source

JsonFileRecordProvider

Extends:

RecordProvider → JsonFileRecordProvider

Json File record provider class.

Constructor Summary

Public Constructor
public

Create a record provider instance

Member Summary

Public Members
public
public

Json file provider low db instance.

public

Json file provider file name.

public

Json file provider is ready flag.

public

Json file provider model name.

public

Json file provider primary key name.

Method Summary

Public Methods
public

Build a query to fetch datas.

public

Provide all datas records

public

Find a record by its id.

public

find_records_by_values(arg_values_map: object, arg_query: object | undefined): Promise

Find a record with a set of values.

Inherited Summary

From class RecordProvider
public

Record provider settings.

public

Build a query to fetch datas.

public abstract

Provide all datas records

public abstract

Find a record by its id.

public abstract

find_records_by_values(arg_values_map: object, arg_query: object | undefined): Promise

Find a record with a set of values.

Public Constructors

public constructor() source

Create a record provider instance

Override:

RecordProvider#constructor

Public Members

public file_adapter: * source

public file_db: object source

Json file provider low db instance.

public filename: string source

Json file provider file name.

public is_ready: boolean source

Json file provider is ready flag.

public modelname: string source

Json file provider model name.

public pkname: string source

Json file provider primary key name.

Public Methods

public build_query(arg_query: object | undefined): Promise source

Build a query to fetch datas.

Override:

RecordProvider#build_query

Params:

NameTypeAttributeDescription
arg_query object | undefined

optional query context

Return:

Promise

datas record promise

public find_all_records(arg_query: object | undefined): Promise source

Provide all datas records

Override:

RecordProvider#find_all_records

Params:

NameTypeAttributeDescription
arg_query object | undefined

optional query context

Return:

Promise

datas record promise

public find_records_by_id(arg_id: string | number): Promise source

Find a record by its id.

Override:

RecordProvider#find_records_by_id

Params:

NameTypeAttributeDescription
arg_id string | number

record id

Return:

Promise

promise of found record or null

public find_records_by_values(arg_values_map: object, arg_query: object | undefined): Promise source

Find a record with a set of values.

Override:

RecordProvider#find_records_by_values

Params:

NameTypeAttributeDescription
arg_values_map object

values map

arg_query object | undefined

optional query context

Return:

Promise

promise of found records or null value