Skip to content

Conversation

lmangani
Copy link
Collaborator

@lmangani lmangani commented Jul 20, 2024

WIP to emulate the following macro in the extension. Currently missing optional/default parameters support.

CREATE OR REPLACE MACRO clickhouse(query, server := 'https://play.clickhouse.com', user := 'play', format := 'JSONEachRow') AS TABLE
    SELECT * FROM read_json_auto(concat(server, '/?default_format=', format, '&user=', user, '&query=', query));


SELECT * FROM clickhouse("SELECT number as once, number *2 as twice FROM numbers(10)")

Checklist

@lmangani lmangani marked this pull request as ready for review September 9, 2024 18:50
@lmangani lmangani merged commit 2e68607 into main Sep 9, 2024
22 checks passed
@lmangani lmangani deleted the clickhouse-query-macro branch September 9, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant