dolthub / dolthub/doltgresql

`CREATE DATABASE` creates two commits in the log.

Open
#729 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.1k
Forks
73
Avg merge
1d 10h
Merged PRs (30d)
129

Description

Ideally, `CREATE DATABASE` should be a single commit at the head of the log.

```
doltgres=> create database getting_started;
CREATE DATABASE
doltgres=> \c getting_started;
psql (15.4 (Homebrew), server 15.0)
You are now connected to database "getting_started" as user "doltgres".
getting_started=> create table employees (
id int8,
last_name text,
first_name text,
primary key(id));
CREATE TABLE
getting_started=> create table teams (
id int8,
team_name text,
primary key(id));
CREATE TABLE
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));
CREATE TABLE
getting_started=> select dolt_commit('-Am', 'Created tables');
dolt_commit
------------------------------------
{uloh753ugjhoddgb2v2e6rkupr2lnjh5}
(1 row)

getting_started=> select * from dolt_log;
commit_hash | committer | email | date | message
----------------------------------+-----------+--------------------+---------------------+----------------------------
uloh753ugjhoddgb2v2e6rkupr2lnjh5 | doltgres | doltgres@127.0.0.1 | 2024-09-20 20:55:58 | Created tables
15iiq73epce96ops9mdtu7kbcu4i0609 | doltgres | doltgres@127.0.0.1 | 2024-09-20 20:49:58 | CREATE DATABASE
ttg8o7ld6cdgiahbrhv8jaeioot42k2h | timsehn | tim@dolthub.com | 2024-09-20 20:49:58 | Initialize data repository
(3 rows)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.