/example-ent-crdb

Demo: Ent, Echo, Validation, Zerolog, CRDB, Just

Primary LanguageGoMIT LicenseMIT

Example Ent + CRDB

An example usage of Ent with CockroachDB.

This server partially recreates the Movr demo dataset.

Setup

Get Golang and Just in your PATH:

go version
# 1.19.5

just --version
# 1.11.0

You also need CRDB on SQL port 26257, user root, no password, no TLS.
One way to do that is:

# Clean slate
rm -rf cdb-data
mkdir cdb-data

# Host networking, local state, no TLS
podman run -it --rm --net=host -v "${PWD}/cdb-data:/cockroach/cockroach-data" cockroachdb/cockroach:v22.2.3 start-single-node --insecure

Usage

just run

Binds to port 9000.

Check the justfile for other options.