←back to thread

75 points markusw | 1 comments | | HN request time: 0s | source
Show context
nu11ptr ◴[] No.45335239[source]
You can, just embed it in your Go app:

https://github.com/fergusstrange/embedded-postgres

replies(2): >>45335287 #>>45335384 #
OutOfHere ◴[] No.45335384[source]
Does this use an external binary or CGO or Wazero (Wasm) or is it rewritten in Go?

With SQLite, although all approaches are available, my fav is to use https://github.com/ncruces/go-sqlite3 which uses Wazero.

I try to avoid CGO if I can because it adds compile-time complexity, making it unfriendly for a user to compile.

replies(1): >>45335515 #
1. nu11ptr ◴[] No.45335515[source]
> Does this use an external binary or CGO or Wazero (Wasm) or is it rewritten in Go?

Since Postgres is always a network connection, I don't believe any CGo is required.

> I try to avoid CGO if I can because it adds compile-time complexity, making it unfriendly for a user to compile.

Using zig as your C compiler mostly fixes this, but you can't 100% get rid of the complexity, but I've cross compiled using Zig cc to Windows/Mac/Linux pretty easily via CGo.