Choose a unique URL path
Since there are no logins or signups, all data is hidden in public. The only protection is your own secret URL path.
Choose your URL path wisely (or use a secure hash), example:SET custom_url = 'https://urleng.com/supersecret_token'
INSERT data
It's time to insert some data. The serverless table will automatically adapt to the schema insertsINSERT INTO FUNCTION url(getSetting('custom_url'), JSONEachRow, 'key String, value UInt64') VALUES ('hello', 1)
SELECT data
Let's read our data back and apply some logic for fun. Note due to how ClickHouse works, the full table is read.SELECT * FROM url(getSetting('custom_url'), JSONEachRow)
CREATE URL Table
If you plan on using the data frequently, you can create a persistent URL Engine table. Choose any schema, too.:) CREATE TABLE default.url_engine_distributed
(
`key` String,
`value` UInt64,
)
ENGINE = URL('https://urleng.com/supersecret', 'JSONEachRow')
β:) INSERT INTO url_engine_distributed VALUES ('hello', 1), ('world', 2)
:) SELECT * FROM url_engine_distributed
βββkeyβββ¬βvalueβ
β hello β 1 β
β world β 2 β
βββββββ΄ββββββ
2 rows in set. Elapsed: 0.185 sec.