|
262 | 262 | "cell_type": "code",
|
263 | 263 | "execution_count": null,
|
264 | 264 | "id": "4e7763c1-4155-4fe3-ab40-ef359adb7ca8",
|
265 |
| - "metadata": {}, |
| 265 | + "metadata": { |
| 266 | + "scrolled": true |
| 267 | + }, |
266 | 268 | "outputs": [],
|
267 | 269 | "source": [
|
268 | 270 | "%env PGPASSWORD=postgres\n",
|
|
300 | 302 | "cell_type": "code",
|
301 | 303 | "execution_count": null,
|
302 | 304 | "id": "56e04d28-4ebc-463a-b7d0-1ea3cf843f1b",
|
303 |
| - "metadata": {}, |
| 305 | + "metadata": { |
| 306 | + "scrolled": true |
| 307 | + }, |
304 | 308 | "outputs": [],
|
305 | 309 | "source": [
|
306 | 310 | "%env PGPASSWORD=postgres\n",
|
|
431 | 435 | "cell_type": "code",
|
432 | 436 | "execution_count": null,
|
433 | 437 | "id": "698c6970-62f0-4cfb-b779-7a5dbbe11d3a",
|
434 |
| - "metadata": { |
435 |
| - "scrolled": true |
436 |
| - }, |
| 438 | + "metadata": {}, |
437 | 439 | "outputs": [],
|
438 | 440 | "source": [
|
439 | 441 | "from pprint import pprint\n",
|
|
857 | 859 | "source": [
|
858 | 860 | "query = \"SELECT cs_ste_vec_value_v1(encrypted_jsonb, %s) AS val FROM examples\"\n",
|
859 | 861 | "\n",
|
860 |
| - "results = cur.execute(query, (CsText(\"$.top.nested\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),))\n", |
| 862 | + "results = cur.execute(query, (CsJsonb(\"$.top.nested\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),))\n", |
861 | 863 | "\n",
|
862 | 864 | "found = cur.fetchall()\n",
|
863 | 865 | "print(\"values from '$.top.nested':\")\n",
|
|
884 | 886 | "\n",
|
885 | 887 | "cur.execute(\n",
|
886 | 888 | " query,\n",
|
887 |
| - " (CsText(\"$.num\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),\n", |
888 |
| - " CsText(\"1\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ste_vec\")\n", |
| 889 | + " (CsJsonb(\"$.num\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),\n", |
| 890 | + " CsJsonb(1, \"examples\", \"encrypted_jsonb\").to_db_format(\"ste_vec\")\n", |
889 | 891 | " )\n",
|
890 | 892 | ")\n",
|
891 | 893 | "\n",
|
|
917 | 919 | "\n",
|
918 | 920 | "cur.execute(\n",
|
919 | 921 | " query,\n",
|
920 |
| - " (CsText(\"$.num\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),)\n", |
| 922 | + " (CsJsonb(\"$.num\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),)\n", |
921 | 923 | ")\n",
|
922 | 924 | "found = cur.fetchall();\n",
|
923 | 925 | "print(\"JSONB contents, ordered by 'num' desc:\")\n",
|
|
947 | 949 | "\n",
|
948 | 950 | "cur.execute(\n",
|
949 | 951 | " query,\n",
|
950 |
| - " (CsText(\"$.category\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),\n", |
951 |
| - " CsText(\"$.category\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"))\n", |
| 952 | + " (CsJsonb(\"$.category\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"),\n", |
| 953 | + " CsJsonb(\"$.category\", \"examples\", \"encrypted_jsonb\").to_db_format(\"ejson_path\"))\n", |
952 | 954 | ")\n",
|
953 | 955 | "\n",
|
954 | 956 | "found = cur.fetchall()\n",
|
|
0 commit comments