投稿時間:2023-03-12 23:21:55 RSSフィード2023-03-12 23:00 分まとめ(22件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita 顔認証 https://qiita.com/naokinaoki230/items/4180929d51c10ff5c087 uthoruserimportcvimport 2023-03-12 22:35:39
python Pythonタグが付けられた新着投稿 - Qiita M1 Macで機械学習用のpython環境を立ち上げる https://qiita.com/Hakky_ball/items/f70fd7247831d77549d3 tensorflow 2023-03-12 22:23:10
python Pythonタグが付けられた新着投稿 - Qiita Shebangの書き方がわかりません。 https://qiita.com/gakusei_programmer/items/bac40594761251424d29 tanacondabinpythonnosuchf 2023-03-12 22:17:06
AWS AWSタグが付けられた新着投稿 - Qiita SESのRejectテストメール作成方法 https://qiita.com/Roux_Qiita/items/095137128c5b67050163 semailmessagesubjectdata 2023-03-12 22:53:21
AWS AWSタグが付けられた新着投稿 - Qiita 【Udemyで完結】AWS Certified Solutions Architect - Professional対策まとめる(合格) https://qiita.com/umauuma321/items/24d0da8a29a8f5aeec0f sarchitectprofessional 2023-03-12 22:41:36
golang Goタグが付けられた新着投稿 - Qiita Grafana Tempo の Parquet ファイルの内容を JSON で取り出す https://qiita.com/fits/items/e6c4ed8a518e9e6b7e6d apacheparquet 2023-03-12 22:26:02
golang Goタグが付けられた新着投稿 - Qiita 【Go言語入門】Goで開発するなら知っておきたい5つのコマンド https://qiita.com/ryo_manba/items/ceeaa2d65ee05f40a859 mtgovetgobuildgomodgodoc 2023-03-12 22:26:01
海外TECH MakeUseOf 10 Ways to Limit Smart Devices' Access to Your Home Network https://www.makeuseof.com/how-to-limit-smart-devices-access-to-your-home-network/ Ways to Limit Smart Devices x Access to Your Home NetworkSmart devices have made our lives easier and safer than ever before but this convenience can come with some serious privacy and security concerns 2023-03-12 13:45:16
海外TECH MakeUseOf 9 Reasons Why the iPhone Isn’t Cool Anymore https://www.makeuseof.com/why-the-iphone-isnt-cool-anymore/ anymoreyou 2023-03-12 13:30:16
海外TECH MakeUseOf The 9 Best Courses and Certifications to Kickstart Your Fintech Career https://www.makeuseof.com/best-courses-fintech-career/ The Best Courses and Certifications to Kickstart Your Fintech CareerAre you interested in breaking into the competitive fintech industry Here are the best courses and certifications to launch your fintech career 2023-03-12 13:16:15
海外TECH MakeUseOf How The Last of Us Part I (Remake) Is Different From Its Remastered Version https://www.makeuseof.com/the-last-of-us-remake-vs-remastered-differences/ How The Last of Us Part I Remake Is Different From Its Remastered VersionWhile The Last of Us Part I remake has the same story as the remastered version there are many changes you should know about 2023-03-12 13:16:15
海外TECH DEV Community Prisma Client Extensions: Use Cases and Pitfalls https://dev.to/zenstack/prisma-client-extensions-use-cases-and-pitfalls-31o6 Prisma Client Extensions Use Cases and PitfallsAlthough still experimental Client Extensions are one of the most exciting features introduced in recent Prisma releases Why Because it opens a door for developers to inject custom behaviors into PrismaClient with great flexibility This post shows a few interesting scenarios enabled by this feature together with thoughts about where we should set the boundary to avoid overusing its power BackgroundPrior to the introduction of client extensions middleware was the only way to extend Prisma s core runtime functionality you can use it to make changes to the query arguments and alter the result Client extensions are created as a future replacement to middleware with more flexibility and type safety Here s a quick list of things you can do with it Add a custom method to modelconst xprisma prisma extends model user async signUp email string return prisma user create data email const user await xprisma user signUp john prisma io Add a custom method to clientconst xprisma prisma extends client log s string gt console log s prisma log Hello world Add a custom field to query resultconst xprisma prisma extends result user fullName the dependencies needs firstName true lastName true compute user the computation logic return user firstName user lastName const user await xprisma user findFirst console log user fullName Customize query behaviorconst xprisma prisma extends query user async findMany model operation args query inject an extra age filter args where age gt args where return query args await xprisma user findMany returns users whose age is greater than Use CasesClient extensions are great for solving cross cut concerns Here re a few use cases to stimulate your inspiration Soft deleteSoft delete is a popular way to handle deletion by putting a marker on entities without really deleting them so that the data can be quickly recovered when necessary It s so widely desired that on Prisma s GitHub there s a long lasting issue about it Soft deletes e g deleted at With client extensions you can implement soft delete in a central place For example suppose you have a schema like this model User id Int id default autoincrement email String unique name String posts Post deleted Boolean default false model Post id Int id default autoincrement title String content String author User relation fields authorId references id authorId Int deleted Boolean default false Soft delete can be implemented like the following const xprisma prisma extends name soft delete query allModels async findMany args query inject read filter args where deleted false args return query args other query methods like findUnique etc async delete model args translate delete to update return prisma as any model update args data deleted true deleteMany All queries and mutations done with the xprisma client have soft delete behavior now The benefit of implementing soft delete with client extensions is that since client extensions don t alter the behavior of the original prisma client you can still use the original client to fetch all entities including those marked as deleted A curious reader may find the sample implementation incomplete Please read on we ll cover more of it in the Pitfalls part Limiting result batch sizePrisma s findMany method returns all records by default which can be an unwanted behavior for tables with many rows We can use client extensions to add a safety guard const MAX ROWS const xprisma prisma extends name max rows query allModels async findMany args query return query args take args take MAX ROWS LoggingLogging is another very common cross cut concern Sometimes you want to log certain important CRUD operations but turning on full logging on PrismaClient can be overwhelming It s now easy to achieve with client extensions const xprisma prisma extends name logging query post async delete args query const found await prisma post findUnique select title true published true where args where if found amp amp found published myLogger warn Deleting published post found title return query args Enacting access control rulesMost database driven applications have business rules for access control that must be consistently enforced across multiple feature areas Traditionally the practice is to implement them at the API layer but it s prone to inconsistency Prisma client extensions now offer the possibility to express them closer to the database Suppose you re implementing APIs with Express js you can do it like this function getAuthorizedDb prisma PrismaClient userId number return prisma extends name authorize query post async findMany args query return query args where authorId userId other operations app get posts req res gt const userId req userId provided by some authentication middleware return getPosts getAuthorizedDb userId The beauty of client extensions is that they share the same query engine and connection pool with the original prisma client that they re based on so the cost of creating them is very low and you can do it at a per request level as shown in the code above Limitations and PitfallsClient extensions are still fairly new and they re not without limitations and pitfalls Here re a few important ones that you may want to watch out for Strong typing doesn t always workPrisma does a great job of making sure things are always nicely typed Even for client extensions one important design goal is to support strong typed programming when implementing an extension However as you can see in the “soft delete example it s not consistently achievable for now Tendency to implement business logic with themClient extensions allow you to add arbitrary methods into a model or the entire client It can make it tempting for you to implement business logic with it For example you may want to add a signUp method to the User model and besides creating an entity also send an activation email It will work but your business code starts to creep into the database territory making the code base harder to understand and troubleshoot However as demonstrated previously cross cut concerns like soft delete logging access control etc are very valid use cases Injecting filter conditions can be very trickyAs you ve seen in use cases and we injected extra conditions into Prisma query args to achieve additional filtering Unfortunately neither is strictly correct Prisma s query API is very flexible for fetching relations So for the soft delete example besides handling top level findMany we also need to deal with relation fetching like prisma user findMany include posts true should be injected asprisma user findMany where deleted false include posts where deleted false and this needs to be processed recursively if you have a deep relation hierarchy Beware that mutation methods like update delete suffer from the same problem because their result can carry relation data too by using the include clause The example we used is a to many scenario To one relation is even harder to deal with because you can t really attach a filter on the fetching of the to one side of the relation It s very easy to make a leaky implementation All these complexities drove us to create the ZenStack toolkit for systematically enhancing Prisma and allowing you to model access control concerns declaratively The toolkit does the heavy lifting at runtime to ensure queries are properly filtered and mutations are guarded so that you don t need to deal with all the subtleties yourself 2023-03-12 13:28:37
Apple AppleInsider - Frontpage News Apple AirPods getting health features in the next few years https://appleinsider.com/articles/23/03/12/apple-airpods-getting-health-features-in-the-next-few-years?utm_medium=rss Apple AirPods getting health features in the next few yearsApple s AirPods could become more useful in helping users stay healthy with a possibility that the personal audio devices will include hearing health features in the coming years AirPods ProThe AirPods and AirPods Pro are great accessories that are poised to gain health features in the future given their tendency to be worn for long periods at a time As part of that push it is thought that the earphones could offer enhanced hearing health features within a few years Read more 2023-03-12 13:38:10
Apple AppleInsider - Frontpage News Tim Cook may be launching Apple VR headset earlier than engineers want https://appleinsider.com/articles/23/03/12/apples-vr-headset-launch-in-2023-goes-against-design-teams-advice?utm_medium=rss Tim Cook may be launching Apple VR headset earlier than engineers wantThe expected launch of the Apple VR headset was an executive decision against the advice of the company s industrial design team a report claims with the latter preferring to wait until it could release AR glasses A render of a potential Apple headset AppleInsider Apple s long rumored VR headset has been teased and talked about for years but has yet to make it to launch While current speculation has Apple finally bringing out the headset as soon as this summer s WWDC some within the company apparently would ve preferred waiting even longer Read more 2023-03-12 13:30:37
海外ニュース Japan Times latest articles Shohei Ohtani homers to power Samurai Japan to victory over Australia https://www.japantimes.co.jp/sports/2023/03/12/baseball/japan-australia-wbc-win/ Shohei Ohtani homers to power Samurai Japan to victory over AustraliaShohei Ohtani helped Samurai Japan script a perfect ending to a perfect first round at the World Baseball Classic Ohtani hit a three run home run Yoshinobu 2023-03-12 22:25:49
ニュース BBC News - Home Childcare: I'll cut costs to boost workforce, says Chancellor Jeremy Hunt https://www.bbc.co.uk/news/uk-politics-64931202?at_medium=RSS&at_campaign=KARANGA budget 2023-03-12 13:46:20
ニュース BBC News - Home Gary Lineker tweet a technical breach, ex-BBC head says https://www.bbc.co.uk/news/uk-64930957?at_medium=RSS&at_campaign=KARANGA breach 2023-03-12 13:10:07
ニュース BBC News - Home UK to help tech firms after Silicon Valley Bank collapse https://www.bbc.co.uk/news/business-64930944?at_medium=RSS&at_campaign=KARANGA england 2023-03-12 13:41:14
ニュース BBC News - Home Yousaf might use snap Holyrood vote to secure independence https://www.bbc.co.uk/news/uk-scotland-scotland-politics-64931626?at_medium=RSS&at_campaign=KARANGA holyrood 2023-03-12 13:12:25
ニュース BBC News - Home Bangladesh v England: Tigers ease to T20 series victory https://www.bbc.co.uk/sport/cricket/64931943?at_medium=RSS&at_campaign=KARANGA mirpur 2023-03-12 13:43:47
ニュース BBC News - Home Matt Dawson column: Reputations of England players on the line after record-breaking loss to France https://www.bbc.co.uk/sport/rugby-union/64929300?at_medium=RSS&at_campaign=KARANGA Matt Dawson column Reputations of England players on the line after record breaking loss to FranceThe futures of England s players are on the line after their record breaking home defeat by France says former captain Matt Dawson 2023-03-12 13:41:02
海外TECH reddit Arsenal line-up to face Fulham: Ramsdale, White, Saliba, Gabriel, Zinchenko, Partey, Xhaka, Odegaard, Martinelli, Saka, Trossard https://www.reddit.com/r/Gunners/comments/11pe0dn/arsenal_lineup_to_face_fulham_ramsdale_white/ Arsenal line up to face Fulham Ramsdale White Saliba Gabriel Zinchenko Partey Xhaka Odegaard Martinelli Saka Trossard submitted by u BenjaminDaaly to r Gunners link comments 2023-03-12 13:00:58

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)