sqldelight / sqldelight/sql-psi

Support domain types

Open
#149 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

postgresql
Dominant language
Kotlin
Stars
104
Forks
35
Avg merge
1h 11m
Merged PRs (30d)
14

Description

Dialect: PostgreSQL

https://www.postgresql.org/docs/12/domains.html

Example
CREATE DOMAIN http_url AS TEXT
    DEFAULT 'https://example.com'
    NOT NULL
    CHECK ( VALUE != '' );

CREATE TABLE page_rank (
    url http_url,
    rank INT NOT NULL
)
Side Note

This could lead to defining the Kotlin type in SQLDelight's .sq file more succinctly. For example:

CREATE DOMAIN http_url AS TEXT AS okhttp3.HttpUrl

I'll create a separate issue in SQLDelight when this issue is implemented.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PostgreSQL 12 domains documentation and the CREATE DOMAIN example in the issue, then inspect how SQLDelight .sq declarations represent database types. Done means the example domain and its use in CREATE TABLE are accepted; the proposed Kotlin type syntax is noted as a separate follow-up.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, postgresql
Domain
databases, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.