|
235 | 235 | ]
|
236 | 236 | },
|
237 | 237 | {
|
238 |
| - "cell_type": "markdown", |
239 |
| - "id": "7f68e37d-210d-468d-b267-1b6930ba7957", |
| 238 | + "cell_type": "raw", |
| 239 | + "id": "be2faca5-11f9-46d2-a2f9-76b8afd5925b", |
240 | 240 | "metadata": {},
|
241 | 241 | "source": [
|
242 | 242 | "The command above should start PostgreSQL.\n",
|
|
429 | 429 | "source": [
|
430 | 430 | "## Insert test record\n",
|
431 | 431 | "\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:" |
441 | 435 | ]
|
442 | 436 | },
|
443 | 437 | {
|
|
457 | 451 | "cur = conn.cursor(cursor_factory=RealDictCursor)\n",
|
458 | 452 | "\n",
|
459 | 453 | "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", |
460 | 455 | "\n",
|
461 | 456 | "cur.execute(\"INSERT INTO examples (encrypted_int, encrypted_boolean, encrypted_date, encrypted_float, encrypted_utf8_str) VALUES (%s, %s, %s, %s, %s)\",\n",
|
462 | 457 | " (\n",
|
|
497 | 492 | "source": [
|
498 | 493 | "# From CipherStash Proxy; you should see plaintext JSONB\n",
|
499 | 494 | "%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" |
501 | 496 | ]
|
502 | 497 | },
|
503 | 498 | {
|
|
517 | 512 | "source": [
|
518 | 513 | "# From PostgreSQL; you should see JSONB with encrypted values\n",
|
519 | 514 | "%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" |
521 | 516 | ]
|
522 | 517 | },
|
523 | 518 | {
|
|
1034 | 1029 | },
|
1035 | 1030 | "outputs": [],
|
1036 | 1031 | "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" |
1038 | 1034 | ]
|
1039 | 1035 | },
|
1040 | 1036 | {
|
|
1067 | 1063 | "name": "python",
|
1068 | 1064 | "nbconvert_exporter": "python",
|
1069 | 1065 | "pygments_lexer": "ipython3",
|
1070 |
| - "version": "3.10.12" |
| 1066 | + "version": "3.12.7" |
1071 | 1067 | }
|
1072 | 1068 | },
|
1073 | 1069 | "nbformat": 4,
|
|
0 commit comments