TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Typed Postgres CRUD Queries

29 点作者 yasserf超过 3 年前

3 条评论

yasserf超过 3 年前
hey HN!<p>This is a simple typescript wrapper around the npm pg-node library which provides autocomplete and validation for basic crud queries out of the box, without having to use an ORM.<p>I do alot of refactoring on my projects and I find crud queries to be around 80% of my APIs, so having typescript have my back really helps out.<p>The idea is mostly to provide helper functions for the common commands we do, and leave the more complex queries to the same query APIs in pg-node, with a couple tiny optional helper functions for field autocompletion.<p>Curious to hear your thoughts!
Andys超过 3 年前
If you are into Golang, also well worth checking out sqlc. It parses your migrations to generate typed structs and query funcs<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kyleconroy&#x2F;sqlc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kyleconroy&#x2F;sqlc</a>
yasserf超过 3 年前
Note: Posted again here (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28327008" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28327008</a>) since the repo was private