You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A domain is "essentially a data type with optional constraints". You can think of them as type aliases. By using a domain, you can easily create custom types. For example, here's how you could create a KSUID type.
CREATEDOMAINksuidASVARCHAR(27) NOT NULL;
CREATETABLEfoo (
id ksuid PRIMARY KEY,
created_at TIMESTAMP DEFAULT NOW()
);
CREATETABLEbar (
id ksuid PRIMARY KEY,
created_at TIMESTAMP DEFAULT NOW(),
foo_id ksuid REFERENCES foo(id),
name textNOT NULL,
slug textNOT NULL UNIQUE
);
The advantage to using a domain is that you'd only need one entry in overrides
A domain is "essentially a data type with optional constraints". You can think of them as type aliases. By using a domain, you can easily create custom types. For example, here's how you could create a KSUID type.
The advantage to using a domain is that you'd only need one entry in overrides
Replaces #418
The text was updated successfully, but these errors were encountered: