Last active
November 8, 2023 21:36
-
-
Save syntaqx/a80c435e64a2a844bb21922798864001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO customers (name, email, created_by) | |
VALUES ('John Doe', '[email protected]', ROW('namespace1', '12345')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TYPE urn AS ( | |
namespace TEXT, | |
identifier TEXT | |
); | |
CREATE TABLE customers ( | |
customer_id SERIAL PRIMARY KEY, | |
name TEXT NOT NULL, | |
email TEXT UNIQUE NOT NULL, | |
created_by urn, -- Using the custom "urn" type | |
created_at TIMESTAMP DEFAULT NOW() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment