Pg: Please welcome bun - go-pg + sql.DB

Created on 18 May 2021  路  7Comments  路  Source: go-pg/pg

Bun is a rewrite of go-pg that is built on sql.DB and works with different databases, for example, PostgreSQL, MySQL, and SQLite.

https://bun.uptrace.dev/guide/pg-migration.html

Most helpful comment

I would echo @sgon00 's 1st question, any words regarding stability and testing rigor would help with our decision.

We are in the middle of prototyping a production service and need to choose bun vs go-pg for immediate development this year. While bun makes a strong argument itself for new projects in the documentation, I don't want to be developing against a changing interface or against a library that isn't tested robustly. The 0.3.9 release on bun and limited "time on market" makes me nervous about this. I'd welcome anecdotes from others who have attempted to use a recent bun release in their projects.

All 7 comments

Is bun intended to be the future of go-pg? Or will go-pg become deprecated eventually in favor of bun?

Yes :) I prefer to think of Bun as the next iteration of go-pg, but practically there is no much difference. The time I have will be put into developing Bun, not go-pg.

I just went through so much effort upgrading to v10, only to see this. Mixed feelings about it. Hope go-pg remains as something with Postgres focus.

Is bun API stable? If not, how likely is it for the API to change?

Bun will be declared stable in July/August depending on feedback. There are no planned changes.

I have two questions:

  1. Where can I find the status of Bun? Whether it's production ready (stable) or not? I don't find it anywhere in the Doc and FAQ.
  2. What is the advantage of Bun compared to go-pg if people only use postgresql db? I only see disadvantage so far. The doc says Bun is slower than go-pg. Why should people switch to a slower lib with no advantage?

Thanks a lot.

Edited:

Sorry that I didn't read Bun's doc in detail. In Introduction URL, it says "Bun is a rewrite of go-pg that works on top of sql.DB instead of using custom API. As a consequence, Bun is slightly slower than go-pg".

But in some other pages, it says "Bun inserts/updates data faster than go-pg.".
I haven't tested it by myself.

So my second question is not really valid if Bun is faster than go-pg in some fields.

I would echo @sgon00 's 1st question, any words regarding stability and testing rigor would help with our decision.

We are in the middle of prototyping a production service and need to choose bun vs go-pg for immediate development this year. While bun makes a strong argument itself for new projects in the documentation, I don't want to be developing against a changing interface or against a library that isn't tested robustly. The 0.3.9 release on bun and limited "time on market" makes me nervous about this. I'd welcome anecdotes from others who have attempted to use a recent bun release in their projects.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eicca picture eicca  路  3Comments

AbooJan picture AbooJan  路  5Comments

l0gicgate picture l0gicgate  路  5Comments

mamal72 picture mamal72  路  3Comments

ValorVl picture ValorVl  路  3Comments