-
Notifications
You must be signed in to change notification settings - Fork 876
chore: Initial database scaffolding #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This implements migrations and code generation for interfacing with a PostgreSQL database. A dependency is added for the "postgres" binary on the host, but that seems like an acceptable requirement considering it's our primary database. An in-memory database object can be created for simple cross-OS and fast testing.
.github/workflows/coder.yaml
Outdated
# Check that go is available | ||
# TODO: Implement actual test run | ||
- run: go version | ||
- run: go test -v ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, our CI is actually doing something now 🎉
if err != nil { | ||
return "", nil, xerrors.Errorf("create pool: %w", err) | ||
} | ||
resource, err := pool.RunWithOptions(&dockertest.RunOptions{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me for now! As we discussed, if Docker is too heavy a dependency... we could look at running psql
manually in the future.
I think this approach makes for now, though, since the team is familiar with this approach from coderd
. And if we decide Docker is too heavy, there might be other approaches we take (like revisiting a cloud solution...)
This implements migrations and code generation for interfacing with a PostgreSQL database.
A dependency is added for the "postgres" binary on the host, but that seems like an acceptable requirement considering it's our primary database.We decided Docker was a more reliable and ubiquitous dependency, so we launch a PostgreSQL Docker container instead.An in-memory database object can be created for simple cross-OS and fast testing.