Created
May 24, 2023 15:30
-
-
Save miguelmota/da41319b69168e88781d5ea2006c40e2 to your computer and use it in GitHub Desktop.
Node.js metabase raw sql query dataset
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
const body = { | |
database: databaseInteger, | |
type: 'native', | |
native: { | |
query: rawSqlQuery, | |
}, | |
} | |
const res = await fetch('https://metabase.example.com/api/dataset', { | |
method: 'POST', | |
headers: { | |
'X-Metabase-Session': token, | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify(body) | |
}) | |
const json = await res.json() | |
console.log(json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment