Skip to content

Commit

Permalink
working-with-vector-data db syntax, notes and tags updated
Browse files Browse the repository at this point in the history
  • Loading branch information
demenskyi committed Jan 26, 2024
1 parent 0d8fee0 commit ba0f297
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
2 changes: 1 addition & 1 deletion notebooks/working-with-vector-data/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ description="""\
vector data from SingleStoreDB using Python.
"""
icon="browser"
tags=["beginner", "vectordb"]
tags=["stater", "vectodb", "genai"]
destinations=["spaces"]
54 changes: 49 additions & 5 deletions notebooks/working-with-vector-data/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "09cb34bc",
"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": "782ffea9-fbc0-4942-8a1a-da8788ed2fec",
Expand Down Expand Up @@ -70,6 +84,20 @@
"# os.environ['SINGLESTOREDB_DEBUG_QUERIES'] = '1'"
]
},
{
"cell_type": "markdown",
"id": "9b1cd9d3",
"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": "e2e322f5-b81d-4249-b512-bd36f88aa168",
Expand All @@ -85,9 +113,10 @@
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS vector_data;\n",
"CREATE DATABASE vector_data;"
"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 vector_data;\n",
" %sql CREATE DATABASE vector_data;"
]
},
{
Expand Down Expand Up @@ -1114,15 +1143,30 @@
"methods work for your use-case."
]
},
{
"cell_type": "markdown",
"id": "42060943",
"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": 61,
"id": "8f911f36-0153-4959-828a-41e637cc9887",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS vector_data"
"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 vector_data;"
]
},
{
Expand Down

0 comments on commit ba0f297

Please sign in to comment.