goyesql
goyesql | bazel-postgres-sketch | |
---|---|---|
2 | 2 | |
44 | 3 | |
- | - | |
0.0 | 0.0 | |
over 1 year ago | over 2 years ago | |
Go | Shell | |
BSD 2-clause "Simplified" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
goyesql
-
How to deal with long select query in go?
Write it in a sql file then use a library like https://github.com/knadh/goyesql to load them into a struct. I prefer doing this with all my code. The SQL is also auditable.
-
We Went All in on Sqlc/Pgx for Postgres and Go
sqlc looks very interesting and compelling. A similar library I like but haven't had the chance to really use is goyesql: https://github.com/knadh/goyesql
It also allows just writing SQL in a file, reminds me a bit of JDBI in Java.
bazel-postgres-sketch
-
We Went All in on Sqlc/Pgx for Postgres and Go
I uploaded most of our Workspace setup here: https://github.com/jschaf/bazel-postgres-sketch. The tooling is a bunch of Go to manage the Postgres process. Basically, give it schema files and receive a running database with a tear down command.
We make temp instances of Postgres quickly by:
- avoiding Docker, especially on Mac
- keeping the data dir on tmpfs
- Disable initdb cleanup
- Disable fsync and other data integrity flags
- Use unlogged tables.
- Use sockets instead of TCP localhost.
For a test suite, it was 12x faster to call createdb with the same Postgres cluster for each test than than to create a whole new db cluster. The trick was to create a template database after loading the schema and use that for each createdb call.
-
In Praise of PostgreSQL
Sure, here's sketch of how it works: https://github.com/jschaf/bazel-postgres-sketch
What are some alternatives?
sqlparser-rs - Extensible SQL Lexer and Parser for Rust
pike - Generate CRUD gRPC backends from single YAML description.
pggen - Generate type-safe Go for any Postgres query. If Postgres can run the query, pggen can generate code for it.
better-sqlite3 - The fastest and simplest library for SQLite3 in Node.js.
sqlite
proteus - A simple tool for generating an application's data access layer.
goqu - SQL builder and query library for golang
SQLBoiler - Generate a Go ORM tailored to your database schema.
rules_nixpkgs - Rules for importing Nixpkgs packages into Bazel.
pronto - Protobuf ORM
gnorm - A database-first code generator for any language