[{"data":1,"prerenderedAt":480},["ShallowReactive",2],{"project-30416531":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":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":46,"post_text":47,"what":48,"said":88,"maker_in_thread":213,"shape":226,"grid":231,"attempts":443,"same_week":444,"maker_shows":259,"maker_hidden":473,"reader_version":474,"card":475},"30416531","Prisma Python","A fully typed ORM for Python","title","Show HN: Prisma Python – A fully typed ORM for Python","https:\u002F\u002Fgithub.com\u002FRobertCraigie\u002Fprisma-client-py","github.com","probablyrobert",1645455436,2022,130,87,469,2570,19,"notable","dev_tools","orm","library",[24,25,26,27,28],"python orm","typed orm","prisma","autocomplete","type hints","debated",0,{"positive":32,"neutral":33,"mixed":34,"critical":35},9,15,1,10,35,{"design":38,"docs":41,"idea":43,"execution":44,"performance":45},{"positive":39,"critical":40},4,5,{"positive":34,"critical":42},3,{"positive":42,"critical":34},{"positive":30,"critical":30},{"positive":30,"critical":34},[40,30,42,42,40,34,30,30,30,42,34,40,42,30,30,42,42,40,30,42,42,30,30,30,30,30,34,40,34,40,42,42,34,42,40,34,42,42,42,34],"I created this ORM to fill a gap in the Python ecosystem. Due to the nature of typing in Python there are no other Python ORMs that can provide correct type hints. Prisma Python manages to work around this by auto-generating python types.\n\nAside from static type checking, providing type hints means that you will get autocomplete suggestions for you which for me is the killer feature for this ORM (see the GIF in the README for an example).\n\nIt's also built on top of Prisma, a next-generation ORM for TypeScript which means that the core query building and connection handling has been battle test",{"problem":49,"audience":55,"pricing":60,"motivation":61,"time_to_build":60,"stack":65,"openness":86,"stage":86,"team_size":87},{"value":50,"source":51,"evidence":52},"Python ORMs lack correct type hints, so autocomplete and static checking are weak","maker",[53],{"id":54},"post",{"value":56,"source":57,"evidence":58},"Python developers who want typed database queries","inferred",[59],{"id":54},null,{"value":62,"source":51,"evidence":63},"Fill a gap in Python ecosystem for typed ORMs",[64],{"id":54},[66,73,82],{"value":67,"source":51,"evidence":68},"Python",[69,70],{"id":54},{"id":71,"by":11,"text":72},"30418282","Yes it is fully typed because of TypedDicts, https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Ftyping.html#typing.TypedDict SQLAlchemy on the other hand provides very little (if any) type hints…",{"value":74,"source":51,"evidence":75},"Prisma engine (Rust)",[76,79],{"id":77,"by":11,"text":78},"30417827","Because Prisma Python currently interfaces with the Rust engine over HTTP (I am looking into changing this) and the Rust engines can be found here:…",{"id":80,"by":11,"text":81},"30419337","Yes I am using the same approach however I am working on using native FFI bindings which is what the TypeScript client is using now.…",{"value":83,"source":51,"evidence":84},"TypedDict",[85],{"id":71,"by":11,"text":72},"unknown","solo",{"praise":89,"objections":108,"requests":137,"questions":164,"alternatives":183},[90,101],{"value":91,"source":92,"evidence":93},"Type hints and autocomplete are valuable","commenter",[94,97],{"id":95,"by":11,"text":96},"30419849","Use whatever works for you! I personally felt the same until I learned of Prisma. The main benefits for me are type checking and autocomplete. Autocomplete is the big one as it…",{"id":98,"by":99,"text":100},"30419288","crucialfelix","I use Prisma typescript daily and love it. It's fast to write complex queries and readable joins. The type hints are well documented and custom generated for your models and…",{"value":102,"source":92,"evidence":103},"Built on battle-tested Prisma core",[104],{"id":105,"by":106,"text":107},"30418225","cabalamat","> Prisma, a next-generation ORM for TypeScript which means that the core query building and connection handling has been battle tested, getting around a potential concern with…",[109,120,130],{"value":110,"source":92,"evidence":111},"Query DSL is verbose compared to SQL",[112,116],{"id":113,"by":114,"text":115},"30420838","inshadows","How is this DSL acceptable? ``` posts = await client.post.find_many( where= { 'OR': [ {'title': {'contains': 'prisma'}}, {'content': {'contains': 'prisma'}}, ] } ) ``` SQL for…",{"id":117,"by":118,"text":119},"30424088","mypalmike","Try making an apples to apples comparison. You neglected to write the SELECT, which would typically not be as simple as \"SELECT * from post\". You neglected to write the code to…",{"value":121,"source":92,"evidence":122},"Performance is slow and rests on HTTP to Rust engine",[123,126],{"id":124,"by":11,"text":125},"30417687","I haven't written benchmarks yet but it is something I am working on. The reason that performance is mentioned in the README is that I haven't spent time on improving it yet. The…",{"id":127,"by":128,"text":129},"30417796","anentropic","What is the Rust engine doing here? How come GitHub doesn't highlight any Rust code in the project repo?",{"value":131,"source":92,"evidence":132},"Too early to adopt until 1.0",[133],{"id":134,"by":135,"text":136},"30417990","lytefm","This looks promising. Using prisma both in TypeScript app backends and in Python data pipelines would make switching between the two without much cognitive overhead much easier.…",[138,150,157],{"value":139,"source":92,"evidence":140},"Document what ORM means and Rust core in README",[141,145,149],{"id":142,"by":143,"text":144},"30417394","melony","Might want to explain in the README that Prisma's core is written in Rust. You don't need to install an entire JS stack to use this.",{"id":146,"by":147,"text":148},"30417962","WaitWaitWha","Nowhere is the acronym ORM explained, let alone how it can benefit Python programmers.",{"id":105,"by":106,"text":107},{"value":151,"source":92,"evidence":152},"Pure Python option without Rust binaries",[153],{"id":154,"by":155,"text":156},"30419218","bb88","Given the state of PyPi these days and third party packages, I would just prefer to have pure python, even if it is slower. It means I don't have to worry about things breaking…",{"value":158,"source":92,"evidence":159},"Benchmarks",[160],{"id":161,"by":162,"text":163},"30417559","bckr","This looks really cool. I might have to try it for my current project. Question: The Readme says there's room for massive improvement in performance. What's the performance like…",[165,176],{"value":166,"source":92,"evidence":167},"How does it compare to SQLModel and SQLAlchemy",[168,172],{"id":169,"by":170,"text":171},"30418347","klft","Seems to solve the same problem as SQLModel. From [1]: \"SQLModel is a library for interacting with SQL databases from Python code, with Python objects. It is designed to be…",{"id":173,"by":174,"text":175},"30418257","mdellavo","fully typed? it used dicts for queryinb - should maybe look at sqlalchemy for comparison",{"value":177,"source":92,"evidence":178},"How does it compare to EdgeDB",[179],{"id":180,"by":181,"text":182},"30421387","messo","How does Prisma compare to EdgeDB? Pros and cons? I have limited experiences with DBs and ORMs, but EdgeDB looks very interesting.",[184,188,195,202,209],{"value":185,"source":92,"evidence":186},"SQLModel",[187],{"id":169,"by":170,"text":171},{"value":189,"source":92,"evidence":190},"SQLAlchemy",[191,194],{"id":192,"by":170,"text":193},"30419748","My understanding is that this is exactly what SQLModel adds on top of SQLAlchemy. statement = select(Hero).where(Hero.age > 32).limit(3) But I am only halfway through the…",{"id":173,"by":174,"text":175},{"value":196,"source":92,"evidence":197},"Entity Framework",[198],{"id":199,"by":200,"text":201},"30423530","camdenreslink","Entity Framework allows you to do that (if you are coding for .NET). It is the best ORM I've encountered. The option to do it is called \"Code First from Database\".",{"value":203,"source":92,"evidence":204},"MikroORM",[205],{"id":206,"by":207,"text":208},"30425187","dpacmittal","MikroORM can also auto generate schema from an existing database",{"value":210,"source":92,"evidence":211},"EdgeDB",[212],{"id":180,"by":181,"text":182},{"comments":214,"answered":215,"key":216},28,16,[217,220,223],{"id":218,"text":219},"30422535","If you're wanting to automatically generate the Prisma Schema then all you have to do is create the schema file, define the datasource connection and then run `prisma db pull`",{"id":221,"text":222},"30417512","Good point, I'll update it, thanks!",{"id":224,"text":225},"30421238","I find the relational API very easy and intuitive to work with. What do you not like about it?",{"commenters":227,"max_depth":228,"maker_replies":214,"first_comment_mins":229,"lifespan_hours":230},43,7,74,148,[232,236,240,244,246,249,250,251,252,254,258,261,264,266,269,272,276,278,280,283,286,290,293,296,299,300,302,304,306,307,309,312,314,317,320,322,325,328,331,332,335,338,340,342,345,347,350,352,355,357,359,361,364,366,368,371,373,375,377,379,381,382,384,388,391,394,396,399,400,401,402,403,405,407,412,414,418,420,421,425,426,428,430,432,435,437,440],[233,30,40,234,235,30],"30419321","project\u002Fpositive\u002Fdesign","joshribakoff",[237,30,30,238,239,30],"30422118","other\u002Fneutral\u002Fnone","post-it",[241,30,30,242,243,30],"30422480","other\u002Fneutral\u002Fidea","ParetoOptimal",[218,30,30,245,11,34],"project\u002Fneutral\u002Fdocs",[247,30,42,245,248,30],"30443268","ChibiJoel",[199,30,30,242,200,30],[206,30,30,242,207,30],[142,34,42,245,143,30],[221,34,30,253,11,34],"maker\u002Fneutral\u002Fdocs",[255,34,40,256,257,30],"30419836","project\u002Fpositive\u002Fdocs","BozeWolf",[113,259,34,260,114,30],2,"project\u002Fcritical\u002Fdesign",[262,259,34,260,263,30],"30420961","lucas_codes",[224,259,30,265,11,34],"maker\u002Fneutral\u002Fdesign",[267,259,30,268,263,30],"30421319","commenter\u002Fneutral\u002Fdesign",[270,259,30,271,11,34],"30421342","commenter\u002Fneutral\u002Fnone",[273,259,30,274,275,30],"30423927","other\u002Fcritical\u002Fidea","subsection1h",[277,259,30,238,118,30],"30424107",[279,259,30,265,11,34],"30421218",[281,259,30,268,282,30],"30421266","jjice",[284,259,30,268,285,30],"30422760","vonseel",[287,259,42,288,289,30],"30421803","project\u002Fneutral\u002Fdesign","IanCal",[291,259,30,292,11,34],"30422574","maker\u002Fpositive\u002Fdesign",[294,259,34,295,114,30],"30465170","project\u002Fcritical\u002Fidea",[297,259,40,234,298,30],"30421576","dgb23",[117,259,30,271,118,30],[301,259,30,271,114,30],"30465176",[169,42,42,303,170,30],"project\u002Fneutral\u002Fidea",[305,42,30,288,11,34],"30418361",[192,42,30,268,170,30],[308,42,30,238,11,34],"30419829",[310,42,30,238,311,30],"30419779","O5vYtytb",[313,42,30,288,11,34],"30419858",[315,42,42,316,257,30],"30419870","project\u002Fneutral\u002Fnone",[318,42,30,319,11,34],"30419886","maker\u002Fneutral\u002Fnone",[134,39,42,321,135,30],"project\u002Fmixed\u002Fexecution",[323,39,30,324,11,34],"30418041","project\u002Fneutral\u002Fexecution",[326,39,40,327,135,30],"30418402","project\u002Fpositive\u002Fidea",[329,40,30,274,330,30],"30419715","hutrdvnj",[95,40,30,234,11,34],[333,40,30,238,334,30],"30420102","NAHWheatCracker",[336,40,30,242,337,30],"30420207","ckmar",[105,339,42,245,106,30],6,[341,339,30,253,11,34],"30418253",[343,228,42,288,344,30],"30418210","samwillis",[346,228,30,288,11,34],"30418265",[348,228,30,271,349,30],"30418341","dragonwriter",[351,228,30,238,11,34],"30418395",[353,228,30,271,354,30],"30419202","dllthomas",[356,228,30,271,235,30],"30419343",[358,228,30,271,11,34],"30419399",[360,228,30,271,354,30],"30419655",[362,228,30,363,344,30],"30418604","other\u002Fcritical\u002Fnone",[365,228,30,288,11,34],"30419124",[367,228,30,238,344,30],"30419229",[369,228,30,238,370,30],"30420346","BerislavLopac",[372,228,30,242,106,30],"30422991",[374,228,30,288,11,34],"30423074",[376,228,34,260,106,30],"30491463",[98,378,40,234,99,30],8,[380,378,30,316,11,34],"30419384",[180,32,42,303,181,30],[383,32,30,303,11,34],"30421667",[385,32,34,386,387,30],"30422566","project\u002Fcritical\u002Fperformance","RedCrowbar",[389,35,40,327,390,30],"30419710","PeterCorless",[392,35,30,393,11,34],"30419745","maker\u002Fpositive\u002Fnone",[395,35,42,316,390,30],"30419762",[161,397,42,398,162,30],11,"project\u002Fneutral\u002Fperformance",[124,397,30,398,11,34],[127,397,42,398,128,30],[77,397,30,398,11,34],[154,397,34,260,155,30],[404,397,30,288,11,34],"30419405",[406,397,42,398,235,30],"30419453",[408,409,40,410,411,30],"30418783",12,"maker\u002Fpositive\u002Fidea","djstein",[413,409,30,393,11,34],"30418806",[415,409,40,416,417,30],"30419656","project\u002Fpositive\u002Fnone","sorenbs",[173,419,34,260,174,30],13,[71,419,30,265,11,34],[422,423,42,398,424,30],"30419270",14,"leetrout",[80,423,30,398,11,34],[427,423,40,234,424,30],"30420395",[146,33,34,429,147,30],"project\u002Fcritical\u002Fdocs",[431,33,30,245,11,34],"30417991",[433,33,42,245,434,30],"30418215","tomrod",[436,33,42,245,147,30],"30420223",[438,33,34,429,439,30],"30418076","occz",[441,33,34,429,442,30],"30424890","Havoc",[],[445,450,455,460,464,468],{"id":446,"name":447,"points":448,"category":449},"30399881","Judy Records",698,"data",{"id":451,"name":452,"points":453,"category":454},"30408434","Rotator",659,"games",{"id":456,"name":457,"points":458,"category":459},"30440828","Simula One",463,"hardware",{"id":461,"name":462,"points":463,"category":449},"30417411","google-drive-to-sqlite",305,{"id":465,"name":466,"points":467,"category":459},"30446960","endless-sphere.com",304,{"id":469,"name":470,"points":471,"category":472},"30440275","Supernotes 2",251,"productivity",false,"v2",{"id":476,"name":5,"line":6,"ai":473,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":477,"maker":11,"domain":10,"tier":19,"attempts":30,"strip":478,"url":9,"mix":479,"praise":91,"objection":110,"sub":21},30416531,[24,25,26,27,28],"5033510003153003350330000015153313513331",[32,33,34,35],1794036617236]