Skip to content

Instantly share code, notes, and snippets.

@danthegoodman1
Last active December 17, 2022 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danthegoodman1/3023fa3e09abcea389ca575478fddee7 to your computer and use it in GitHub Desktop.
Save danthegoodman1/3023fa3e09abcea389ca575478fddee7 to your computer and use it in GitHub Desktop.
curl \
-H "Authorization: Bearer <TOKEN>" \
-X POST "https://api.us-east.tinybird.co/v0/datasources" \
-d "schema=timestamp DateTime64(3) \`json:$.timestamp\`, _metadata_bundledIds Array(Nullable(String)) \`json:$._metadata.bundledIds[:]\`,
_metadata_bundled Array(Nullable(String)) \`json:$._metadata.bundled[:]\`, _metadata_unbundled Array(Nullable(String))
\`json:$._metadata.unbundled[:]\`, anonymousId Nullable(String) \`json:$.anonymousId\`, channel Nullable(String) \`json:$.channel\`, context
Nullable(String) \`json:$.context\`, messageId Nullable(String) \`json:$.messageId\`, originalTimestamp Nullable(DateTime64(3))
\`json:$.originalTimestamp\`, projectId Nullable(String) \`json:$.projectId\`, receivedAt Nullable(DateTime64(3)) \`json:$.receivedAt\`, sentAt
Nullable(DateTime64(3)) \`json:$.sentAt\`, type Nullable(String) \`json:$.type\`, userId Nullable(String) \`json:$.userId\`, version Nullable(Int16)
\`json:$.version\`, properties Nullable(String) CODEC(ZSTD) \`json:$.properties\`, name Nullable(String) \`json:$.name\`, event Nullable(String)
\`json:$.event\`, traits Nullable(String) \`json:$.traits\`" \
-d "engine=MergeTree" \
-d "engine_sorting_key=timestamp" \
-d "format=ndjson" \
-d "engine_partition_key=toYYYYMM(timestamp)" \
-d "name=<NAME>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment