djwhitt / core2-playground

Developer Experience experimentation for https://github.com/xtdb/core2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

core2-playground

This repository provides a wide range of examples which allow you to experiment with the XTDB Core2 UX.

.
├── README.adoc
├── SQL.adoc
│
│   # clients:
├── clojure
├── psql
├── python
│
│   # servers:
├── xtdb-server-clj
└── xtdb-server-docker

Start a server

Option 1: Docker

docker pull xtdb/core2
docker run -p 5432:5432 xtdb/core2

Option 2: JAR

TODO

Option 3: Clojure in-process

  • Make sure Clojure is installed

  • cd xtdb-server-clj && ./run.sh

XTDB SQL

The SQL dialect available in XTDB tries very hard to adhere to the SQL Specification. There are small deviations from the spec where absolutely required. Read more in SQL.adoc.

psql

Install psql (Postgres) if you don’t have it already. Some package managers offer the Postgres client in isolation (ubuntu has postgresql-client) but this is surprisingly uncommon.

sudo apt-get install -y postgresql
sudo pacman -S postgresql
brew install postgresql
# etc.
  • Start an XTDB server

  • Run ./psql/run.sh to start a client

  • Try a query from ./psql/queries.sql

Python

  • Start an XTDB server

  • Install dependencies: ./python/install.sh

  • Edit and run ./python/queries.py

Clojure

The Clojure examples consume Core2 directly, running a client and server in the same process for convenience. This means you do not need to start an external Core2 server. (Though you still can, of course.) The client code still speaks to Core2 over the pgwire protocol using JDBC.

./clojure/README.adoc

About

Developer Experience experimentation for https://github.com/xtdb/core2

License:MIT License


Languages

Language:Clojure 73.3%Language:Python 18.9%Language:Shell 7.9%