Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "17:00"
timezone: Europe/London
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [24.x] # [18.x, 20.x, 21.x, 26.x]
# Node.js release schedule: nodejs.org/en/about/releases/

- uses: actions/checkout@v7 # github.com/actions/checkout
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7 # github.com/actions/setup-node
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7 # github.com/codecov/codecov-action
with:
token: ${{ secrets.CODECOV_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/fix-typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Temporarily Commenting Out
# name: Automatically fix typos
# on:
# push:
# branches:
# - main

# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# ref: main
# - uses: sobolevn/misspell-fixer-action@master
# - uses: peter-evans/create-pull-request@v4.2.0
# env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

Expand Down
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

62 changes: 34 additions & 28 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,75 @@

## Why PostgreSQL and _Not_ MySQL?
# _Why_ `Postgres` and _Not_ `MySQL`?

The _good_ news is that almost all of your PostgreSQL knowledge
The _good_ news is that almost all of your `PostgreSQL` knowledge
is _directly_ transferable to [MySQL](https://en.wikipedia.org/wiki/MySQL).
Since _both_ use SQL as the language
Since _both_ use `SQL` as the language
for interacting with the database,
the time you invest in learning PostgreSQL
and building SQL skills is a hugely valuable.
the time you invest in learning `Postgres`
and building `SQL` skills is a hugely valuable.

Learning how to _run_ means you also know how to _walk_.
PostgreSQL might _feel_ "more difficult"
`Postgres` might _feel_ "more difficult"
in the same way that , but the principals are all the same.
Just stick with it and keep asking questions until it all "makes sense".
If you need to _apply_ your SQL skills to MySQL, MS SQL or MariaDB,
it will only take you a few minutes to adapt to it.
Just stick with it
and **keep asking questions** until it all makes sense.
If you need to _apply_ your `SQL` skills to `MySQL`,
`MS SQL` or `MariaDB`,
it will only take you a few minutes to adapt to it
(with some Googling).

It's very much like riding a bicycle.
Once you know how to balance, pedal and steer,
your skills transfer to other bicycles.



The _reason_ MySQL is still _hugely_ popular
The _reason_ `MySQL` is still _hugely_ popular
can be summarised by _one_ word:
[***WordPress***](https://en.wikipedia.org/wiki/WordPress).
[***`WordPress`***](https://en.wikipedia.org/wiki/WordPress).

Over **30%** of the 10 million most popular websites use WordPress.
WordPress runs on the "LAMP" (_Linux Apache **MySQL** PHP_) stack,
which means that people are using MySQL by _`default`_
Over **30%** of the 10 million most popular websites use `WordPress`.
WordPress runs on the "LAMP" (_`Linux` `Apache` **`MySQL`** `PHP`_) stack,
which means that people are using `MySQL` by _`default`_
not _conscious enlightenment_.
+ https://www.whoishostingthis.com/compare/wordpress/stats
+ https://w3techs.com/technologies/overview/content_management/all


## Why _Not_ Use WordPress?
## Why _Not_ Use `WordPress`?

WordPress is _unquestionably_ a good CMS and blogging platform
`WordPress` is _unquestionably_ a good
[CMS](https://en.wikipedia.org/wiki/Content_management_system)
and blogging platform
that helps millions of people/businesses publish online.
Sadly, it's not secure by _default_ and when a vulnerability is discovered,
Sadly, it's **not secure by _default_**
and when a vulnerability is discovered,
it gets exploited en-mass very quickly.
Yes, WordPress can be
Yes, `WordPress` can be
["Hardened"](https://codex.wordpress.org/Hardening_WordPress)
but that is _usually_ not the _first_ thing on people's todo list
when launching a website or blog.
The result is that _thousands_ of WordPress websites get hacked
The result is that _thousands_ of `WordPress` websites get hacked
each time a patch is released e.g:
https://www.zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code
[zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code](https://www.zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code)
and it creates a maintenance headache
for the person/people _responsible_ for the site.
We're not saying you (_or anyone else_) should not use WordPress,
We're not saying you (_or anyone else_) should not use `WordPress`,
just make sure you follow the the latest "best practice" if you do.
(_We have been "burned" by it through no fault of our own...
and would not touch it again with a barge pole!
There are **much** more **secure** and **performant** options!_)

### What About NoSQL Databases/Datastores Like ElasticSearch and Redis?
### What About NoSQL Databases/Datastores Like `ElasticSearch` and `Redis`?

@dwyl we are _huge_ fans of _special-purpose_ data storage/retrieval systems.
We have used _several_ NoSQL databases including CouchDB, ElasticSearch,
MongoDB, Neo4J and Redis.
Of these we _recommend_ ElasticSearch for full-text search
and Redis for in-momory datasets and caching. see:
We have used _several_ NoSQL databases including `CouchDB`, `ElasticSearch`,
`MongoDB`, `Neo4J` and `Redis` to name a few.
Of these we _recommend_ `ElasticSearch` for **full-text search**
and `Redis` for in-momory datasets and caching.
see:

+ [github.com/dwyl/learn-**elasticsearch**](https://github.com/dwyl/learn-elasticsearch)
+ [github.com/dwyl/learn-**redis**](https://github.com/dwyl/learn-redis)

However as a "primary" datastore with a robust query language,
we feel PostgreSQL is the _clear_ winner as a "first" database.
we feel `Postgres` is the **_clear_ winner** as a "first" database.
80 changes: 38 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
<div align="center">

# Learn PostgreSQL
<img src="https://github.com/user-attachments/assets/0189074e-f835-41b7-86c0-8e75ce54ff74" alt="Learn Postgres intro image" />

Learn how to use PostgreSQL
and Structured Query Language (SQL) to store
and query your data.
Learn to use **`Postgres`**
and Structured Query Language (**`SQL`**)
to **securely store**
and **reliably query** your data.

<br />
<!-- Update the Build Badge When its working -->

<a href="https://www.postgresql.org/about/">
<img src="https://user-images.githubusercontent.com/194400/52590350-fa116100-2e38-11e9-9303-c38819493a4e.png" width="700">
</a>

<br />

[![Build Status](https://img.shields.io/travis/dwyl/learn-postgresql/master.svg?style=flat-square)](https://travis-ci.org/dwyl/learn-postgresql)
[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/learn-postgresql/master.svg?style=flat-square)](https://codecov.io/github/dwyl/learn-postgresql?branch=master)
[![Dependencies: None!](https://david-dm.org/dwyl/learn-postgresql/status.svg?style=flat-square)](https://david-dm.org/dwyl/learn-postgresql)
[![devDependencies Status](https://david-dm.org/dwyl/learn-postgresql/dev-status.svg?style=flat-square)](https://david-dm.org/dwyl/learn-postgresql?type=dev)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dwyl/javascript-todo-list-tutorial/ci.yml?label=build&style=flat-square&branch=main)](https://github.com/dwyl/javascript-todo-list-tutorial/actions)
[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/learn-postgresql/master.svg?style=flat-square)](https://codecov.io/github/dwyl/learn-postgresql?branch=main)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square)](https://github.com/dwyl/learn-postgresql/issues)
<!-- uncomment when ready
[![HitCount](https://hits.dwyl.io/dwyl/learn-postgresql.svg)](https://hits.dwyl.io/dwyl/learn-postgresql)
-->
[![HitCount](https://hits.dwyl.com/dwyl/learn-postgresql.svg)](https://hits.dwyl.com/dwyl/learn-postgresql)

</div>


# _Why_?

Helping people store, retrieve and derive insights from data
is the essence of _all_ software applications. <br />

## SQL is _Everywhere_
## `SQL` is _Everywhere_

Like it or not, Relational Databases store
Like it or not, **Relational Databases** store
_most_ of the world's structured data
and Structured Query Language (SQL)
and Structured Query Language (`SQL`)
is _by far_ the most frequent way of retrieving the data.<br />

According to the most _recent_ surveys/statistics,
SQL _still_ dominates the world of databases.
`SQL` _still_ dominates the world of databases.
`PostgreSQL` _specifically_ is the most popular:
[survey.stackoverflow.co/2025/technology#1-databases](https://survey.stackoverflow.co/2025/technology#1-databases)

https://insights.stackoverflow.com/survey/2018/#technology-databases
![stackoverflow-survey-2018-databases](https://user-images.githubusercontent.com/194400/52594468-80cb3b80-2e43-11e9-867a-eeb4eea9a322.png)
<img src="https://github.com/user-attachments/assets/f3b90a24-5466-4049-a872-ca7c997f09e4" />


https://db-engines.com/en/ranking
![dbms-ranking](https://user-images.githubusercontent.com/194400/52594416-64c79a00-2e43-11e9-8a61-02af22554802.png)

<img alt="DB Engines ranking 2026"
src="https://github.com/user-attachments/assets/8242d7b5-2336-4ed7-8278-1e68b3ec2fc2" />

> _**Note**: you should never adopt a technology
based on it's **current popularity**,
Expand All @@ -58,40 +51,43 @@ based on the requirements, constraints and/or availability
(both of "skill" on your existing team or in the wider community).
We include these stats to explain that **relational databases**
are **still** the most widely used **by far** and so
learning SQL skills is a very **wise investment**
both as an **individual** and for your **team** or **organisation**._
learning `SQL` skills is a very **wise investment**
both as an **individual**
and for your **team** or **organisation**._


## PostgreSQL is _Easy_ to Learn and it Runs _Everywhere_!
## `PostgreSQL` is _Easy_ to Learn and it Runs _Everywhere_!

Getting started with PostgreSQL is _easy_,
Getting started with `PostgreSQL`` is _easy_,
(_just follow the steps in this guide and try out the example queries!_) <br />
When you are ready to _deploy_ your app, you are in safe hands,
PostgreSQL runs _everywhere_:

+ **Travis-CI** (free) Integration Testing:
https://docs.travis-ci.com/user/database-setup/#postgresql
+ **Heroku** PostgreSQL (_free for MVP: 10k rows_): https://www.heroku.com/postgres
+ AWS RDS Postgres (_good value + high performance_):
https://aws.amazon.com/rds/postgresql/
+ Google Cloud SQL: https://cloud.google.com/sql/
+ DigitalOcean: https://www.digitalocean.com/products/managed-databases/
[aws.amazon.com/rds/postgresql](https://aws.amazon.com/rds/postgresql/)
+ Google Cloud SQL:
[cloud.google.com/sql](https://cloud.google.com/sql/)
+ DigitalOcean:
[digitalocean.com/products/managed-databases](https://www.digitalocean.com/products/managed-databases/)
+ Azure:
[azure.microsoft.com/en-us/services/postgresql](https://azure.microsoft.com/en-us/services/postgresql/)
+ Citus:
https://techcrunch.com/2019/01/24/microsoft-acquires-citus-data
+ Self-managed high availability cluster:
[github.com/sorintlab/stolon](https://github.com/sorintlab/stolon)
+ Linode:
https://www.linode.com/docs/databases/postgresql/create-a-highly-available-postgresql-cluster-using-patroni-and-haproxy/
+ Azure: https://azure.microsoft.com/en-us/services/postgresql/
+ Citus: https://techcrunch.com/2019/01/24/microsoft-acquires-citus-data
+ Self-managed high availability cluster: https://github.com/sorintlab/stolon

# _Who_?

_Everyone_ building _any_ application that stores data should learn SQL.
SQL is _ubiquitous_ in every field/industry and the sooner you learn/master it,
_Everyone_ building _any_ application that stores data should learn `SQL`.
`SQL` is _ubiquitous_ in every field/industry and the sooner you learn/master it,
the higher your life-time return on time investment.

Learning how to use a relational database is a foundational skill
for all of computer science and application development.

Being _proficient_ in SQL will open the door to Data Science with
Being _proficient_ in `SQL` will open the door to Data Science with
[SQL-on-Hadoop](https://mapr.com/why-hadoop/sql-hadoop/sql-hadoop-details/)
[Apache Spark](https://en.wikipedia.org/wiki/Apache_Spark#Spark_SQL),
Google [BigQuery](https://en.wikipedia.org/wiki/BigQuery),
Expand Down
3 changes: 1 addition & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<main id="main">
<h1>Hello World 123!</h1>
</main>

<script src='https://rawgit.com/dwyl/faster/master/lib/client.js'></script>

</body>
</html>
Loading