How to create a table in Edge SQL

Once you’ve created your Edge SQL database, you can begin creating tables and inserting data into them.

Go to Edge SQL reference

Creating a table

Run the following POST request in your terminal, replacing [TOKEN VALUE] with your personal token and {id_database} with the ID of the database you want to create a table into:

curl --location 'https://api.azion.com/v4/edge_sql/databases/{id_database}/query' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"statements": [
"CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);"
]
}'

You should receive the following response:

{
"state": "executed",
"data": [
{
"results": {
"columns": [],
"rows": []
}
}
]
}

Contributors