Getting Started
Download the latest release of
doltgresPut
doltgreson yourPATHRun
doltgres. This will create apostgresuser (with a password ofpassword) and apostgresdatabase in~/doltgres/databases(add the--data-dirargument or change theDOLTGRES_DATA_DIRenvironment variable to use a different directory).
$ doltgres
Successfully initialized dolt data repository.
Starting server with Config HP="localhost:5432"|T="28800000"|R="false"|L="info"|S="/tmp/mysql.sock"Make sure you have Postgres version 15 or higher installed. I used Homebrew to install Postgres on my Mac. This requires I manually add
/opt/homebrew/opt/postgresql@15/binto my path. On Postgres version 14 or lower,\commands (i.e.\d,\l) do not yet work with Doltgres.
export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"Open a new terminal. Connect with the following command:
psql -h localhost -U postgresand enter the passwordpasswordwhen prompted. This will connect to thepostgresdatabase with thepostgresuser.
$ psql -h 127.0.0.1 -U postgres
Password for user postgres:
psql (15.4 (Homebrew), server 15.0)
Type "help" for help.
postgres=>Create a
getting_starteddatabase. Create thegetting_startedexample tables.
postgres=> create database getting_started;
--
(0 rows)
postgres=> \c getting_started;
psql (15.4 (Homebrew), server 15.0)
You are now connected to database "getting_started" as user "postgres".
getting_started=> create table employees (
id int8,
last_name text,
first_name text,
primary key(id));
--
(0 rows)
getting_started=> create table teams (
id int8,
team_name text,
primary key(id));
--
(0 rows)
getting_started=> create table employees_teams(
team_id int8,
employee_id int8,
primary key(team_id, employee_id),
foreign key (team_id) references teams(id),
foreign key (employee_id) references employees(id));
--
(0 rows)
getting_started=> \d
List of relations
Schema | Name | Type | Owner
--------+-----------------+-------+----------
public | employees | table | postgres
public | employees_teams | table | postgres
public | teams | table | postgres
(3 rows)Make a Dolt Commit.
View the Dolt log.
Continue with Dolt Getting Started to test out more Doltgres versioning functionality.
Last updated
