Angular 6 HttpClient - PostgreSQL - Node.js/Express Sequelize CRUD APIs

Angular 6 HttpClient - PostgreSQL - Node.js/Express Sequelize CRUD APIs

Sequelize is a promise-based ORM for Node.js v4 and later. In the tutorial, we will show how to GET/POST/PUT/DELETE requests from Angular 6 Client to PostgreSQL with NodeJs/Express RestAPIs using Sequelize ORM. Related posts: – Node.js/Express RestAPIs CRUD – Sequelize ORM – PostgreSQL – Node.js/Express RestAPIs – Angular 6 HttpClient – Get/Post/Put/Delete requests + Bootstrap … Continue reading "Angular 6 HttpClient – PostgreSQL – Node.js/Express Sequelize CRUD APIs – Post/Get/Put/Delete"

Angular 6 HttpClient – PostgreSQL – Node.js/Express Sequelize CRUD APIs – Post/Get/Put/Delete

https://grokonez.com/frontend/angular/angular-6/angular-6-httpclient-postgresql-node-js-express-sequelize-crud-apis-post-get-put-delete

Sequelize is a promise-based ORM for Node.js v4 and later. In the tutorial, we will show how to GET/POST/PUT/DELETE requests from Angular 6 Client to PostgreSQL with NodeJs/Express RestAPIs using Sequelize ORM.

Related posts:

Technologies

  • Angular 6
  • RxJS 6
  • Bootstrap 4
  • Visual Studio Code – version 1.24.0
  • Nodejs – v8.11.3
  • Sequelize
  • PostgreSQL

Demo

Overview

Goal

We create 2 projects:

– Angular Client Project:

angular-6-http-client-nodejs-express-sequelize-crud-postgresql + angular-project-structure

– Node.js RestAPIs project:

angular-6-http-client-nodejs-express-sequelize-crud-postgresql + nodejs-project-structure

UserCase

Start Node.js server -> Logs:


App listening at http://:::8080
Executing (default): DROP TABLE IF EXISTS "customers" CASCADE;
Executing (default): DROP TABLE IF EXISTS "customers" CASCADE;
Executing (default): CREATE TABLE IF NOT EXISTS "customers" ("id"   SERIAL , "firstname" VARCHAR(255), "lastname" VARCHAR(255), "age" INTEGER, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'customers' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
Drop and Resync with { force: true }
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Joe','Thomas',36,'2018-07-11 08:31:06.976 +00:00','2018-07-11 08:31:06.976 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Peter','Smith',18,'2018-07-11 08:31:06.977 +00:00','2018-07-11 08:31:06.977 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Lauren','Taylor',31,'2018-07-11 08:31:06.978 +00:00','2018-07-11 08:31:06.978 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Mary','Taylor',24,'2018-07-11 08:31:06.978 +00:00','2018-07-11 08:31:06.978 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'David','Moore',25,'2018-07-11 08:31:06.978 +00:00','2018-07-11 08:31:06.978 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Holly','Davies',27,'2018-07-11 08:31:06.978 +00:00','2018-07-11 08:31:06.978 +00:00') RETURNING *;
Executing (default): INSERT INTO "customers" ("id","firstname","lastname","age","createdAt","updatedAt") VALUES (DEFAULT,'Michael','Brown',45,'2018-07-11 08:31:06.979 +00:00','2018-07-11 08:31:06.979 +00:00') RETURNING *;

-> PostgreSQL records:

More at: Angular 6 HttpClient – PostgreSQL – Node.js/Express Sequelize CRUD APIs – Post/Get/Put/Delete

https://grokonez.com/frontend/angular/angular-6/angular-6-httpclient-postgresql-node-js-express-sequelize-crud-apis-post-get-put-delete

angular nodejs express postgresql

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Angular 8 Nodejs PostgreSQL CRUD Example - using Express RestAPIs + Sequelize

In the tutorial, I introduce how to implement "Angular 8 Nodejs PostgreSQL CRUD Example" using using Express RestAPIs and Sequelize

Angular 10 Nodejs PostgreSQL CRUD Example - using Express RestAPIs

In the tutorial, I guide how to build an "Angular 10 Nodejs PostgreSQL CRUD Example" with Express RestAPIs and Sequelize ORM

Build Nodejs CRUD Application with MySQL/PostgreSQL - Express RestAPIs + Ajax

In the tutorial, I will introduce how to create a Fullstack Nodejs RestAPIs CRUD Application to MySQL/PostgreSQL database using Express framework and Sequelize ORM for building Backend and using Bootstrap, JQuery Ajax for building frontend client Related posts: Angular Nodejs Fullstack CRUD Application with MySQL/PostgreSQL – Angular 10-9-8 HttpClient + Nodejs Express, Sequelize ORM Build … Continue reading "Build Nodejs CRUD Application with MySQL/PostgreSQL – Express RestAPIs + Ajax : Post/Get/Put/Delete Request"

Install Angular - Angular Environment Setup Process

Install Angular in easy step by step process. Firstly Install Node.js & npm, then Install Angular CLI, Create workspace and Deploy your App.

Angular 11 + Node.js + PostgreSQL example: CRUD App with Express.js

In this tutorial, I will show you how to build a full-stack (Angular 11 + Node.js + Express + PostgreSQL) example with a CRUD Application. The back-end server uses Node.js + Express for REST APIs, front-end side is an Angular App with HTTPClient. Related Posts: – Angular + Node.js Express: JWT Authentication & Authorization example […]