Alex Gleason on Nostr: I saw a glimpse of a post about jsonb and gin. I figured out this actually can work ...
I saw a glimpse of a post about jsonb and gin. I figured out this actually can work if you structure the tags as key-value pairs like:
{ "p": ["abc", "def"], "e": ["ghi"] }
This actually seems like the best solution, but I would have to give up compatibility with SQLite, which makes me sad.
Published at
2024-07-19 01:27:43Event JSON
{
"id": "ce8a36e5e688ce11ab3c30418a752ea734e8c24a3018ffd8d065e328ee2a4f24",
"pubkey": "0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd",
"created_at": 1721345263,
"kind": 1,
"tags": [
[
"e",
"2c027a50e6fc29b4f8ff910b7489cf1561b59448c1d375c9b9a6dbaaa653e83f",
"wss://gleasonator.dev/relay",
"root"
],
[
"e",
"0511b0b02bdeac171feba4436643479b4ee60d41dcafb492d456d4a5699e5919",
"wss://gleasonator.dev/relay",
"reply"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
]
],
"content": "I saw a glimpse of a post about jsonb and gin. I figured out this actually can work if you structure the tags as key-value pairs like:\n\n{ \"p\": [\"abc\", \"def\"], \"e\": [\"ghi\"] }\n\nThis actually seems like the best solution, but I would have to give up compatibility with SQLite, which makes me sad.",
"sig": "face57de9f0e457f9ccb09f16b3d489a40a5eac5516db4565837580d694f1eecde4d2ce20250a0a3530a326624e855b063b3fbbf5e4353a4531ec7b8949622e4"
}