krok
sql-migrate
Our great sponsors
krok | sql-migrate | |
---|---|---|
9 | 9 | |
13 | 3,080 | |
- | - | |
0.0 | 6.7 | |
over 1 year ago | 7 days ago | |
Go | Go | |
Apache License 2.0 | 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.
krok
-
The fastest and easiest way of setting up the database for unit tests
Booting up a database in a container is relatively fast now-a-days. Take a look here: https://github.com/krok-o/krok/blob/main/tests/livestore/init_test.go
-
How to write unit test for gin golang
An example for this you can find here: https://github.com/krok-o/krok/tree/main/pkg/krok/providers/handlers
-
my first golang project!
Tests!!! You have none. :) If you want to test with a real DB instead of mocking everything you can do that with an ephemeral container that spins up relatively fast. Here is an example for that: https://github.com/krok-o/krok/blob/main/tests/livestore/init_test.go ( This might be a bit over your head depending on your experience maybe this post is better: https://docs.docker.com/language/golang/run-tests/ )
-
need help with "os/exec"
As others suggested, using the API is nicer. If you are looking for a nice example on how to do that take a look at my docker container executor code here: https://github.com/krok-o/krok/blob/main/pkg/krok/providers/executor/in_memory_executor.go :)
-
https://np.reddit.com/r/golang/comments/pn9k5r/what_is_swagger_and_how_to_implement_swagger_for/hcnxk69/
Here is an app where I'm using swagger and I create API documentation by using swagger generator and comments: https://github.com/krok-o/krok
-
Presenting Krok - Multiplatform webhook handling system with containerised commands
I would like to present a project I've been working on for 1.5 years or so, called Krok Github, Krok Website.
-
[Question] How to split main.go into separate packages/files whilst maintaining Dependency Injection?
Here is a fairly complex project which does just this: https://github.com/krok-o/krok
-
https://np.reddit.com/r/golang/comments/og9458/how_to_implement_swagger_ui_for_multiple_apis/h4kfmsa/
Adding to the other comments, this is how Krok uses swagger:
-
What is the fastest way to clear my SQL database between integration tests?
This creates a temporary database in a docker container while you are running your test. For an example look here: https://github.com/krok-o/krok/blob/main/tests/livestore/init_test.go
sql-migrate
- GORM
-
How to seed database for testing?
I'd never did this with sqlite3, but I think sql-migrate should work (https://github.com/rubenv/sql-migrate)
-
Can anyone help me on how you are using golang with databases in production systems?
I use sqlboiler which generates an ORM from your database, and sql-migrate which is a tool for managing SQL migrations. Although you have to write your migrations in SQL, which IMHO is a plus.
- How to use sql-migrate in Kubernetes?
-
Is there a DB framework that can manage migrations like Ruby on Rails ?
Currently a fan of this one https://github.com/rubenv/sql-migrate
-
Go Echo API Server Development
db migration by sql-migrate
- Most recommended database migration tool? using golang for the record
-
How do you install commands using go.mod
There are some packages in my project that are not used in the source code, but they're used as commands (i.e. https://github.com/vektra/mockery https://github.com/rubenv/sql-migrate).
-
What is the fastest way to clear my SQL database between integration tests?
Keep your migrations in the code repo and use a tool like sql-migrate to automatically apply them for you. At my job, we run a new container for each package's tests, and create a new db with the migration scripts for every test. It's certainly a bit slower, but the reproducibility is worth it.
What are some alternatives?
typhon - A wrapper around Go's net/http to provide safety and convenience. At Monzo, Typhon forms the basis of most clients and servers in our microservices platform.
goose
todo-api-microservice-example - Go microservice tutorial project using Domain Driven Design and Onion Architecture!
migrate - Database migrations. CLI and Golang library.
go-banking-api - Banking API implementation using Go
skeema - Declarative pure-SQL schema management for MySQL and MariaDB
microservicebotexample
TinyGo - Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
txdriver - txdriver provides transaction isolation for Go SQL tests
noms - The versioned, forkable, syncable database
fx - A dependency injection based application framework for Go.
BTrDB - Berkeley Tree Database (BTrDB) server