Skip to content

Commit e47d61c

Browse files
committed
make commands cross-platform
1 parent 43276da commit e47d61c

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

languages/python/jupyter_notebook/CipherStash-Getting-Started.ipynb

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@
235235
]
236236
},
237237
{
238-
"cell_type": "markdown",
239-
"id": "7f68e37d-210d-468d-b267-1b6930ba7957",
238+
"cell_type": "raw",
239+
"id": "be2faca5-11f9-46d2-a2f9-76b8afd5925b",
240240
"metadata": {},
241241
"source": [
242242
"The command above should start PostgreSQL.\n",
@@ -429,15 +429,9 @@
429429
"source": [
430430
"## Insert test record\n",
431431
"\n",
432-
"With the database extensions, EQL, and application specific data types installed together with the type definitions for Python, your setup is now ready to encrypt and decrypt data."
433-
]
434-
},
435-
{
436-
"cell_type": "markdown",
437-
"id": "3c571924-c592-447b-88a7-fef6b50f2114",
438-
"metadata": {},
439-
"source": [
440-
"Insert an example row:"
432+
"With the database extensions, EQL, and application specific data types installed together with the type definitions for Python, your setup is now ready to encrypt and decrypt data.\n",
433+
"\n",
434+
"Run the following to create a record in the `examples` table:"
441435
]
442436
},
443437
{
@@ -457,6 +451,7 @@
457451
"cur = conn.cursor(cursor_factory=RealDictCursor)\n",
458452
"\n",
459453
"cur.execute(\"delete from examples\") # Clear the table in case there are records from previous runs\n",
454+
"cur.execute(\"select cs_refresh_encrypt_config()\")\n",
460455
"\n",
461456
"cur.execute(\"INSERT INTO examples (encrypted_int, encrypted_boolean, encrypted_date, encrypted_float, encrypted_utf8_str) VALUES (%s, %s, %s, %s, %s)\",\n",
462457
" (\n",
@@ -497,7 +492,7 @@
497492
"source": [
498493
"# From CipherStash Proxy; you should see plaintext JSONB\n",
499494
"%env PGPASSWORD=postgres\n",
500-
"!printf '\\\\x \\n select * from examples limit 1;' | psql -h localhost -p 6432 -U postgres cipherstash_getting_started"
495+
"! psql -h localhost -p 6432 -U postgres -x -c \"select * from examples limit 1;\" cipherstash_getting_started"
501496
]
502497
},
503498
{
@@ -517,7 +512,7 @@
517512
"source": [
518513
"# From PostgreSQL; you should see JSONB with encrypted values\n",
519514
"%env PGPASSWORD=postgres\n",
520-
"!printf '\\\\x \\n select * from examples limit 1;' | psql -h localhost -p 5432 -U postgres cipherstash_getting_started"
515+
"! psql -h localhost -p 5432 -U postgres -x -c \"select * from examples limit 1;\" cipherstash_getting_started"
521516
]
522517
},
523518
{
@@ -1034,7 +1029,8 @@
10341029
},
10351030
"outputs": [],
10361031
"source": [
1037-
"! printf '\\\\x \\n select * from examples where id = {record_id};' | PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres cipherstash_getting_started"
1032+
"%env PGPASSWORD=postgres\n",
1033+
"! psql -h localhost -p 5432 -U postgres -x -c \"select * from examples where id = {record_id};\" cipherstash_getting_started"
10381034
]
10391035
},
10401036
{
@@ -1067,7 +1063,7 @@
10671063
"name": "python",
10681064
"nbconvert_exporter": "python",
10691065
"pygments_lexer": "ipython3",
1070-
"version": "3.10.12"
1066+
"version": "3.12.7"
10711067
}
10721068
},
10731069
"nbformat": 4,

0 commit comments

Comments
 (0)