This repository contains basic setup and test for Postgrest. All dependencies are automatically installed, database is automatically created so you can start testing and tweaking in minutes.
The repository uses embedded Invoke-Build to run tasks.
To get list of all tasks run with ?
:
> ./Invoke-Build.ps1 ?
Name Jobs Synopsis
---- ---- --------
Deps {} Install postgresql14, postgrerest 10, and latest superbenchmarker via chocolatey
RecreateDb {} Recreate database using db.sql. Pass aTodosCount to specify number of todo items to seed (default 100K)
Run {} Run postgrest backend
RunSandboxed {} Run inside Windows Sandbox
Todos {} Get 50 todo items with random offset
Todo {} Get single todo item with random id
PerfTestBulk {} Start perf test with limit set to 50 todo items and random offset
PerfTestBulk2 {} Start perf test with limit set to 50 todo items and random offset (alternative)
PerfTestSingle {} Start perf test with single random todo item
- Open administrative shell in repository root and type:
Set-Alias ib $pwd\Invoke-Build.ps1
- Install local dependencies only on first run:
ib Deps
This will install postgresql (with passwordtest
), postgrest & superbenchmarker via chocolatey. If you use existing installation specify password with$Env:PGPASSWORD
. - Create database with:
ib RecreateDb
.
Modify number of created todo items via-aTodosCount
argument - by default 100K records are randomly created. - Start backend with
ib Run
. - Test with
ib Todo
(gets single random todo item) orib Todos
(gets bulk todo's)
Run everything in Windows Sandbox using the following command:
ib RunSandboxed
which executes the following script inside VM:
cd postgrest-test
Set-Alias ib $pwd\Invoke-Build.ps1
ib Deps, RecreateDb, Run, Todo, Todos
- postgrest-benchmark
Another benchmark, using NixOs and K6