holistics / holistics/dbml

[PostgreSQL] New feature - Consider partial Index

Open
#494 0 comments 7 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
3.7k
Forks
233
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Please, consider partial Index (PostgreSQL)

A partial index is an index built over a subset of a table; the subset is defined by a conditional expression (called the predicate of the partial index). The index contains entries only for those table rows that satisfy the predicate.

SQL example

```
CREATE TABLE tests (
subject text,
target text,
success boolean,
...
);

CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target)
WHERE success is true;
```

Suggestion:

```
table test {
subject text
target text
success boolean

Indexes {
(subject, target) [name: 'tests_success_constraint', unique, expression: `success is true`]
}
}
```

Important note:

There is already a perfect comment from [Yokozuna59](https://github.com/Yokozuna59) here [issue 68](https://github.com/holistics/dbml/issues/68#issuecomment-1608299284) that could solve this one graciously

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.