Skip to content

Commit

Permalink
Merge pull request #44 from singlestore-labs/update_syntax
Browse files Browse the repository at this point in the history
Update db syntax and notes
  • Loading branch information
kesmit13 authored Jan 29, 2024
2 parents 35776ae + 4226f61 commit 41fea73
Show file tree
Hide file tree
Showing 46 changed files with 757 additions and 92 deletions.
2 changes: 1 addition & 1 deletion notebooks/atlas-and-kai/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description="""\
Run your MongoDB queries on SingleStore Kai with no code change. \
"""
icon="database"
tags=["mongodb", "kai"]
tags=["starter", "mongo", "kai"]
destinations=["spaces"]
69 changes: 64 additions & 5 deletions notebooks/atlas-and-kai/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "df80b45e",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Note</b></p>\n",
" <p> This notebook can be run on a Free Starter Workspace. To create a Free Starter Workspace navigate to <tt>Start</tt> using the left nav. You can also use your existing Standard or Premium workspace with this Notebook. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "ca93a410-d513-42ec-a823-99ad8f3a25c1",
Expand Down Expand Up @@ -64,7 +78,7 @@
"source": [
"**Make sure that you have a created MongoDB enabled workspace.**\n",
"\n",
"This must be done when creating a workspace."
"This must be done when creating a workspace (for Standard/Premium Workspaces) For Starter Workspaces, the KAI API will be on by default."
]
},
{
Expand All @@ -85,15 +99,45 @@
"!pip install pymongo pandas matplotlib plotly ipywidgets --quiet"
]
},
{
"cell_type": "markdown",
"id": "7016efcd",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you have a Free Starter Workspace deployed already, select the database from drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "6087e187-ab0b-4df6-8c9e-ee9fc7153a6b",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS new_transactions"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS new_transactions;\n",
" %sql CREATE DATABASE new_transactions;"
]
},
{
"cell_type": "markdown",
"id": "27a6f491",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> Make sure to select a database from the drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
Expand Down Expand Up @@ -682,15 +726,30 @@
"## Clean up"
]
},
{
"cell_type": "markdown",
"id": "15754544",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you created a new database in your Standard or Premium Workspace, you can drop the database by running the cell below. Note: this will not drop your database for Free Starter Workspaces. To drop a Free Starter Workspace, terminate the Workspace using the UI. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "40e2ed0b-9b43-446a-9150-823b8e87dd0d",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS new_transactions"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS new_transactions;"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/confluent-cloud-integration/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ title = "Ingest data from Confluent Cloud (Kafka)"
description = """
A step-by-step guide on seamlessly ingesting data from Confluent Cloud (Kafka) into your SingleStoreDB database using a robust pipeline. """
icon = "confluent-logo"
tags = ["confluent", "training", "kafka", "pipeline", "realtime"]
tags = ["advanced", "confluent", "kafka", "pipeline", "realtime"]
destinations = ["spaces"]
14 changes: 14 additions & 0 deletions notebooks/confluent-cloud-integration/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "5787d6e9",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\">\n",
" <b class=\"fa fa-solid fa-info-circle\"></b>\n",
" <div>\n",
" <p><b>Note</b></p>\n",
" <p>This tutorial is meant for Standard & Premium Workspaces. You can't run this with a Free Starter Workspace due to restrictions on Storage. Create a Workspace using +group in the left nav & select Standard for this notebook. Gallery notebooks tagged with \"Starter\" are suitable to run on a Free Starter Workspace </p>\n",
" </div>\n",
"</div>"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/getting-started-with-dataframes/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ description="""\
familiar DataFrame syntax in addition to SQL.
"""
icon="browser"
tags=["beginner", "dataframe"]
tags=["starter", "dataframe", "python"]
destinations=["spaces"]
61 changes: 52 additions & 9 deletions notebooks/getting-started-with-dataframes/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "dc4afbf8",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Note</b></p>\n",
" <p> This notebook can be run on a Free Starter Workspace. To create a Free Starter Workspace navigate to <tt>Start</tt> using the left nav. You can also use your existing Standard or Premium workspace with this Notebook. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "8d01d69e-f7d4-4efc-815f-148e0c099b90",
Expand Down Expand Up @@ -74,12 +88,27 @@
"ibis.options.interactive = True"
]
},
{
"cell_type": "markdown",
"id": "1614bef1",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you have a Free Starter Workspace deployed already, select the database from drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "a3cc67a9-310f-42e2-9d9a-bbe160a588f3",
"metadata": {},
"source": [
"## Create a database"
"## Create a database\n",
"If you have a Standard or Premium workspace deployment, you can create a new database to run this notebook. Running the cell below to create the new database in your existing workspace. Note: this will NOT create a new database in your Free Starter Workspace."
]
},
{
Expand All @@ -89,10 +118,10 @@
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS ibis_getting_started;\n",
"\n",
"CREATE DATABASE ibis_getting_started;"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS ibis_getting_started;\n",
" %sql CREATE DATABASE ibis_getting_started;"
]
},
{
Expand All @@ -104,8 +133,7 @@
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p>Make sure to select the <tt>ibis_getting_started</tt> database from the drop-down menu at the top of this notebook.\n",
" It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" <p> Make sure to select a database from the drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
Expand Down Expand Up @@ -682,15 +710,30 @@
"on the various types, see the [Ibis documentation](https://ibis-project.orghttps://ibis-project.org)."
]
},
{
"cell_type": "markdown",
"id": "e811c596",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you created a new database in your Standard or Premium Workspace, you can drop the database by running the cell below. Note: this will not drop your database for Free Starter Workspaces. To drop a Free Starter Workspace, terminate the Workspace using the UI. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "d5bc91c6-f65b-4479-9475-df60e0ab2088",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS ibis_getting_started;"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS ibis_getting_started;"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/getting-started-with-notebooks/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ description="""\
visualization and analysis. \
"""
icon="notes"
tags=["beginner", "sqrl"]
tags=["starter", "python", "sqrl"]
destinations=["spaces"]
64 changes: 57 additions & 7 deletions notebooks/getting-started-with-notebooks/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "4e83c63b",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Note</b></p>\n",
" <p> This notebook can be run on a Free Starter Workspace. To create a Free Starter Workspace navigate to <tt>Start</tt> using the left nav. You can also use your existing Standard or Premium workspace with this Notebook. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "6d2bb122-3ae2-4eab-bbbd-3e3ba6907c4b",
Expand Down Expand Up @@ -140,6 +154,20 @@
"df.dtypes"
]
},
{
"cell_type": "markdown",
"id": "3a9c4139",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you have a Free Starter Workspace deployed already, select the database from drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "4ceef3c0-c804-48c3-9ca0-dcb7f5abfe27",
Expand Down Expand Up @@ -193,17 +221,24 @@
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS {{database_name}};\n",
"CREATE DATABASE {{database_name}};"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS {{database_name}};\n",
" %sql CREATE DATABASE {{database_name}};"
]
},
{
"cell_type": "markdown",
"id": "b8f95d65-b3ca-4306-b22c-11f8eadcce13",
"id": "7defddbb",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\"> <b class=\"fa fa-solid fa-exclamation-circle\"></b> <div> <p><b>Action Required</b></p> <p>Make sure to select the <tt>getting_started_notebook</tt> database from the drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> which is used by the <tt>%%sql</tt> magic command and SQLAlchemy to make connections to the selected database.</p> </div></div>"
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> Make sure to select a database from the drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
Expand Down Expand Up @@ -386,15 +421,30 @@
"## 6. Cleanup database"
]
},
{
"cell_type": "markdown",
"id": "fb94bc57",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you created a new database in your Standard or Premium Workspace, you can drop the database by running the cell below. Note: this will not drop your database for Free Starter Workspaces. To drop a Free Starter Workspace, terminate the Workspace using the UI. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "0792f4a6-82f4-413b-9895-cd4764f7a118",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE {{database_name}};"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS {{database_name}};"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description="""\
Using OpenAI to build a an app that can take images, audio, and text data to generate output
"""
icon="chart-network"
tags=["advanced", "openai", "genai"]
tags=["advanced", "openai", "genai", "vectordb"]
destinations=["spaces"]
Loading

0 comments on commit 41fea73

Please sign in to comment.