Code Monkey home page Code Monkey logo

nest-sqlite-crud's Introduction

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ yarn install

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

Migration

Once you get into production you'll need to synchronize model changes into the database. Typically, it is unsafe to use synchronize: true for schema synchronization on production once you get data in your database. Here is where migrations come to help. A migration is just a single file with sql queries to update a database schema and apply new changes to an existing database. Let's say you already have a database and a post entity:

TypeOrm

we have 2 structure (Active Record): Entity Extend from BaseEntity that we dont cant test and we dont have Injection and all use in BaseEntity and dont can use in User an other (Data Mapper):we dont have extends BaseEntity and all time we call this with Injection and use this every where and can call that with const userRepository = dataSource.getRepository(User) Or in router call @EntityRepository

save & create

Save can be used to both create a new Record and update a existing record Whereas create is used to create a new record by providing all required field at one time.

Hooks

save format like log table and dont use like object {email:"t",pass:7895} this is not hooks save() + remove() ==> use Hooks But insert() + update() + deleted() ==> dont use Hooks

serialize(Show Data with world format) and deserialize your data

Data serialization is the process of converting an object into a stream of bytes to more easily save or transmit it. why is it important? In some distributed systems, data and its replicas are stored in different partitions on multiple cluster members. If data is not present on the local member, the system will retrieve that data from another member. This requires serialization for use cases such as:

Deserialization is the process of reconstructing a data structure or object from a series of bytes or a string in order to instantiate the object for consumption. This is the reverse process of serialization, i.e., converting a data structure or object into a series of bytes for storage or transmission across devices. To fetch an object state over a wire or read it from persistent storage, a system must be able to deserialize it from raw bytes.

exclude

when user create and we return all data in response(serialize,transformer Data) we dont show password and we should use @Eclude in class class-transformer step2 ==> we can handel with custom. 1) create folder interceptors 2)create file serialize.intercepteor.ts import { UseInterceptors, NestInterceptor, ExecutionContext, CallHandler, } from '@nestjs/common';

RX Js

that meanf handdel you thread or eventloop. instanece

util.promisfy()

this module change our old functio or any function to async awat autu

cookies

it is a HTTP cookie is a smile piece of stored by user's browser to remmber stateful inforation when user visit her website again the cookie is auto sent with request

nest-sqlite-crud's People

Contributors

afshinrahmati 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.