MiniCTRMSearch

MiniCTRM - Build Tutorial 646: One program, two databases: PostgreSQL beside SQLite, the default unchanged

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

One build that picks its database from the address; a platform interface with one class per database and the file-only parts on SQLite alone; a PostgreSQL baseline generated from the SQLite migrations, twin migrations after it, and a test that the two schemas match row for row; every query reading the same on both, the fast tier passing on each and a short database list in the quick check; server databases created, copied and dropped from the database screen; and sign-in and worker machines on a server database only.

  • Chosen by its address – The driver, dialect and migrations derived from the address; one platform interface; the file-only parts on SQLite alone.
  • One schema, two databases – A PostgreSQL baseline generated from the SQLite migrations, twins from then on, and a test that they match.
  • SQL that reads the same – A bind wrapper, a few portable rewrites and case-insensitive names; the tests on both; a short list in the quick check.
  • From the screen, and what only a server has – The database Type, a server database's own create, copy and drop, sign-in and worker machines; /ship.
  • How MiniCTRM did it – Database Maintenance's New database with its Type, and About's Back End with both drivers.

Before you start

The lessons this one builds on: 514 Choosing the database: SQLite first, PostgreSQL later; migrations only, 633 Security: sign-in, privileges on every endpoint, audit, secrets, 641 Ten users or a thousand: what changes, 644 Many jobs at once: one limit for the whole system, steps that start together, one writer shared.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

Both, not one or the other

1 / 13
Both, not one or the other
Chosen by its address

The address decides

2 / 13
The address decides
Chosen by its address

One interface, one class per database

3 / 13
One interface, one class per database
One schema, two databases

Generated, not rewritten

4 / 13
Generated, not rewritten
One schema, two databases

The baseline, the twins and the match

5 / 13
The baseline, the twins and the match
SQL that reads the same

The same question, the same answer

6 / 13
The same question, the same answer
SQL that reads the same

Both databases, every test

7 / 13
Both databases, every test
From the screen, and what only a server has

A server database from the screen

8 / 13
A server database from the screen
From the screen, and what only a server has

Sign-in and worker machines, on a server only

9 / 13
Sign-in and worker machines, on a server only
From the screen, and what only a server has

Ship it

10 / 13
Ship it
How MiniCTRM did it

New database, and its Type

11 / 13
New database, and its Type
How MiniCTRM did it

Both drivers, in About

12 / 13
Both drivers, in About
What you have now

What you have now

13 / 13
What you have now

You have finished lesson 646, One program, two databases: PostgreSQL beside SQLite, the default unchanged.

Where next?

← → move · N notes · Home / End