sql-psi icon indicating copy to clipboard operation
sql-psi copied to clipboard

Support domain types

Open veyndan opened this issue 5 years ago • 0 comments

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.

veyndan avatar Aug 18 '20 22:08 veyndan