Skip to content

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Jan 4, 2022

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.

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.
@kylecarbs kylecarbs requested a review from bryphe-coder January 4, 2022 15:25
@kylecarbs kylecarbs self-assigned this Jan 4, 2022
# Check that go is available
# TODO: Implement actual test run
- run: go version
- run: go test -v ./...
Copy link
Contributor

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{
Copy link
Contributor

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...)

@kylecarbs kylecarbs merged commit 025b55f into main Jan 5, 2022
@kylecarbs kylecarbs deleted the database branch January 20, 2022 16:01
bryphe-coder added a commit that referenced this pull request Feb 2, 2022
BrunoQuaresma added a commit that referenced this pull request May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants