[{"data":1,"prerenderedAt":367},["ShallowReactive",2],{"project-32179856":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":43,"post_text":46,"what":47,"said":78,"maker_in_thread":158,"shape":167,"grid":171,"attempts":328,"same_week":329,"maker_shows":40,"maker_hidden":359,"reader_version":360,"card":361},"32179856","Pg_jsonschema","A Postgres extension for JSON validation","title","Show HN: Pg_jsonschema – A Postgres extension for JSON validation","https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fpg_jsonschema","github.com","oliverrice",1658413880,2022,203,56,278,2570,11,"notable","data","postgres extension","library",[24,25,26,27],"postgres json validation","json schema","jsonb constraints","pgx rust","loved",0.195,{"positive":31,"neutral":32,"mixed":33,"critical":34},6,17,0,1,24,{"idea":37,"execution":39,"performance":41,"docs":42},{"positive":38,"critical":33},4,{"positive":40,"critical":33},2,{"positive":33,"critical":34},{"positive":33,"critical":33},[44,33,44,44,33,44,34,33,33,33,33,33,33,45,45,45,44,45,33,45,33,33,45,44,45,33,33,45,33,45,45,45,33,45,33,33,33,33,33,33],5,3,"pg_jsonschema is a solution we're exploring to allow enforcing more structure on json and jsonb typed postgres columns.\n\nWe initially wrote the extension as an excuse to play with pgx, the rust framework for writing postgres extensions. That let us lean on existing rust libs for validation (jsonschema), so the extension's implementation is only 10 lines of code :)\n\nhttps:\u002F\u002Fgithub.com\u002Fsupabase\u002Fpg_jsonschema\u002Fblob\u002Ffb7ab09bf6050130e8d656f2999ec0f6a3fedc0d\u002Fsrc\u002Flib.rs#L1-L13\n\nhappy to answer any questions!",{"problem":48,"audience":54,"pricing":54,"motivation":55,"time_to_build":54,"stack":59,"openness":75,"stage":76,"team_size":77},{"value":49,"source":50,"evidence":51},"Enforcing structure on json and jsonb typed Postgres columns","maker",[52],{"id":53},"post",null,{"value":56,"source":50,"evidence":57},"Excuse to play with pgx, the Rust framework for Postgres extensions",[58],{"id":53},[60,64,68],{"value":61,"source":50,"evidence":62},"Rust",[63],{"id":53},{"value":65,"source":50,"evidence":66},"pgx",[67],{"id":53},{"value":69,"source":50,"evidence":70},"jsonschema crate",[71,72],{"id":53},{"id":73,"by":11,"text":74},"32181159","> 4 different versions that differ in their capabilities pg_jsonschema is a (very) thin wrapper around https:\u002F\u002Fdocs.rs\u002Fjsonschema\u002Flatest\u002Fjsonschema\u002F it supports versions 4, 6,…","open_source","unknown","company",{"praise":79,"objections":103,"requests":115,"questions":130,"alternatives":145},[80,92],{"value":81,"source":82,"evidence":83},"Brings schema validation to the database level via CHECK constraints","commenter",[84,88],{"id":85,"by":86,"text":87},"32181970","billythemaniam","All this does is make writing a CHECK constraint for a JSON blob relatively straightforward. And yes you should use CHECKs in the database. In practice, it is very easy for…",{"id":89,"by":90,"text":91},"32188507","tsujp","This is awesome! I remember playing with Hasura (which uses Postgres) a few years ago. Hasura is great but one of the things I really wanted was JSON schema validation at a…",{"value":93,"source":82,"evidence":94},"Excited about pgx and Supabase's open source commitment",[95,99],{"id":96,"by":97,"text":98},"32180790","hardwaresofton","This is awesome -- really excited that Supabase is picking this up with their commitment to open source in general and PG in particular. Some prior art: -…",{"id":100,"by":101,"text":102},"32182309","cpursley","I just love the work both Supabase & Hasura have done making people aware of how powerful Postgres is.",[104],{"value":105,"source":82,"evidence":106},"Validation on a centralized RDBMS hurts scalability and ties up connections",[107,111],{"id":108,"by":109,"text":110},"32181368","paulmd","Nice work, however, I am structurally dubious of putting too much functionality onto a classical centralized RDBMS since it can't be scaled out if performance becomes a problem.…",{"id":112,"by":113,"text":114},"32195238","perlgeek","Scaling isn't really a concern for everybody and every application. It's good to be aware of additional strain you put on your DB, but I've worked with lots of applications where…",[116,123],{"value":117,"source":82,"evidence":118},"Support for full JSON Schema drafts 2019-09 and 2020-12",[119],{"id":120,"by":121,"text":122},"32189974","dmitry_dygalo","The `jsonschema` crate author here. First of all, this is an exciting use case, I didn't even anticipate it when started `jsonschema` (it was my excuse to play with Rust). I am…",{"value":124,"source":82,"evidence":125},"Dockerfile, PG15 compatibility info, and CI\u002FCD",[126],{"id":127,"by":128,"text":129},"32180497","pella","Thank you! Some suggestion for the next roadmap: - a Dockerfile ( The dockerfile helps me a lot in trying out new technologies ) - info about the compatibility with new PG15 -…",[131,138],{"value":132,"source":82,"evidence":133},"Which JSON Schema drafts are supported and whether $schema is honored",[134],{"id":135,"by":136,"text":137},"32180973","mdaniel","It would be valuable to know which JSON-Schema it supports, since there are currently 4 different versions that differ in their capabilities (as one might expect). Related to…",{"value":139,"source":82,"evidence":140},"Whether adding the constraint to a large table scans existing rows",[141],{"id":142,"by":143,"text":144},"32180645","warmwaffles","If adding this check to an existing table with millions of records, will it scan the entire table checking all of the records, or just check when the records are inserted or…",[146,150,154],{"value":147,"source":82,"evidence":148},"postgres-json-schema (gavinwahl)",[149],{"id":96,"by":97,"text":98},{"value":151,"source":82,"evidence":152},"is_jsonb_valid",[153],{"id":96,"by":97,"text":98},{"value":155,"source":82,"evidence":156},"pgx_json_schema (jefbarn)",[157],{"id":120,"by":121,"text":122},{"comments":38,"answered":45,"key":159},[160,163,166],{"id":161,"text":162},"32190695","thanks for the great work on the jsonschema crate! I didn't know about the pgx_json_schema (or is_jsonb_valid) and will add both of them to the README today",{"id":164,"text":165},"32180844","> fast-fail (the first check constraint violated would bubble the error upward) rather than slow-fail (collect all invalid fields and return the collection of errors, which IME…",{"id":73,"text":74},{"commenters":168,"max_depth":38,"maker_replies":38,"first_comment_mins":169,"lifespan_hours":170},41,50,33,[172,174,178,180,182,185,188,190,193,195,197,200,204,207,210,212,214,218,219,223,225,228,231,234,235,238,240,244,247,249,252,255,257,259,264,267,270,273,276,277,281,285,287,291,293,295,299,302,306,308,312,315,318,321,324,326],[96,33,44,173,97,33],"project\u002Fpositive\u002Fidea",[175,33,33,176,177,33],"32185563","other\u002Fneutral\u002Fnone","rad_gruchalski",[120,34,44,179,121,33],"project\u002Fpositive\u002Fexecution",[161,34,33,181,11,34],"maker\u002Fpositive\u002Fdocs",[183,40,44,173,184,33],"32183175","rubenfiszel",[186,40,33,176,187,33],"32183642","tmp_anon_22",[189,40,33,176,184,33],"32183779",[191,40,44,192,187,33],"32183903","maker\u002Fpositive\u002Fexecution",[108,45,34,194,109,33],"project\u002Fcritical\u002Fperformance",[85,45,33,196,86,33],"commenter\u002Fpositive\u002Fidea",[198,45,33,176,199,33],"32186878","westurner",[201,45,33,202,203,33],"32182227","commenter\u002Fneutral\u002Fidea","sgk284",[205,45,33,202,206,33],"32188487","mike_d",[208,45,33,202,209,33],"32189719","silversmith",[211,45,33,202,86,33],"32191597",[213,45,33,202,203,33],"32198222",[215,45,33,216,217,33],"32192770","commenter\u002Fneutral\u002Fperformance","anonymous23801",[112,45,33,216,113,33],[220,38,45,221,222,33],"32180458","project\u002Fneutral\u002Fidea","banashark",[164,38,33,224,11,34],"project\u002Fneutral\u002Fexecution",[226,38,45,221,227,33],"32180976","Tostino",[229,38,45,224,230,33],"32181092","memco",[232,44,44,173,233,33],"32181890","BrandiATMuhkuh",[135,31,45,224,136,33],[236,31,45,224,237,33],"32181125","dragonwriter",[73,31,33,239,11,34],"maker\u002Fneutral\u002Fexecution",[241,242,45,221,243,33],"32183773",7,"edmundsauto",[245,242,45,221,246,33],"32184177","spprashant",[248,242,33,202,243,33],"32186356",[250,242,33,202,251,33],"32190159","gregplaysguitar",[253,242,45,221,254,33],"32186072","shroompasta",[256,242,45,221,243,33],"32186370",[258,242,44,173,251,33],"32190138",[260,261,45,262,263,33],"32182613",8,"project\u002Fneutral\u002Fnone","dividuum",[265,261,45,262,266,33],"32182934","CodeIsTheEnd",[268,261,33,176,269,33],"32190351","ahachete",[100,271,33,272,101,33],9,"other\u002Fpositive\u002Fnone",[274,275,45,221,254,33],"32186157",10,[89,18,33,202,90,33],[278,279,33,272,280,33],"32184024",12,"mekoka",[282,279,45,283,284,33],"32184140","maker\u002Fneutral\u002Fnone","kiwicopple",[286,279,45,283,280,33],"32184414",[288,289,45,221,290,33],"32196625",13,"klysm",[142,292,45,224,143,33],14,[294,292,33,239,11,34],"32180889",[296,292,33,297,298,33],"32182966","commenter\u002Fneutral\u002Fexecution","mjw1007",[127,300,45,301,128,33],15,"project\u002Fneutral\u002Fdocs",[303,300,33,304,305,33],"32180744","commenter\u002Fneutral\u002Fnone","dewey",[307,300,33,304,128,33],"32180943",[309,310,33,176,311,33],"32180701",16,"legalcorrection",[313,310,33,176,314,33],"32180810","drewda",[316,310,33,176,317,33],"32180861","yakubin",[319,310,33,176,320,33],"32181115","alphalima",[322,310,33,176,323,33],"32182239","michelpp",[325,310,33,176,311,33],"32183588",[327,310,33,176,237,33],"32181163",[],[330,335,340,345,350,354],{"id":331,"name":332,"points":333,"category":334},"32216436","Hexapipes",537,"games",{"id":336,"name":337,"points":338,"category":339},"32212235","Kvass",227,"dev_tools",{"id":341,"name":342,"points":343,"category":344},"32240511","Blueboat",123,"infrastructure",{"id":346,"name":347,"points":348,"category":349},"32229278","Plunk",109,"web_saas",{"id":351,"name":352,"points":353,"category":349},"32249392","Birdy",89,{"id":355,"name":356,"points":357,"category":358},"32204938","Famnom",72,"consumer_social",false,"v2",{"id":362,"name":5,"line":6,"ai":359,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":363,"top":18,"kw":364,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":365,"url":9,"mix":366,"praise":81,"objection":105,"sub":21},32179856,0.2,[24,25,26,27],"5055051000000333530300353003033303000000",[31,32,33,34],1794036622842]