-
-
Notifications
You must be signed in to change notification settings - Fork 167
feat: postgres store #4626
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
Open
heiytor
wants to merge
2
commits into
master
Choose a base branch
from
feat/postgres
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: postgres store #4626
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b298f40 to
fb0dd93
Compare
otavio
reviewed
Mar 26, 2025
8bc3d90 to
1fb1bed
Compare
1e75d09 to
25d8b30
Compare
877ff84 to
45350b6
Compare
45350b6 to
0166ac3
Compare
6c1cc16 to
6124534
Compare
7b77588 to
d7e7a29
Compare
50b34d3 to
55cb58f
Compare
ea31f49 to
3017588
Compare
Base automatically changed from
refactor/api/store-save-and-delete-operations
to
master
October 22, 2025 12:51
9eea0fb to
dcde12b
Compare
6ce21bc to
51e99a2
Compare
99e1620 to
943603e
Compare
fcf23f3 to
807b0e8
Compare
otavio
requested changes
Nov 4, 2025
6a9e346 to
b5e21b8
Compare
Add support for pluggable database backends via SHELLHUB_DATABASE env var. MongoDB service moved from main docker-compose.yml to separate compose files. - Add SHELLHUB_DATABASE env var (defaults to mongo) - Add logic in bin/utils to load database-specific compose files - Remove hardcoded mongo service from main docker-compose.yml
Implement complete PostgreSQL support as an alternative to MongoDB, allowing users to select their preferred database backend via SHELLHUB_DATABASE environment variable. Infrastructure: - Add PostgreSQL 18.0 service in docker-compose.postgres.yml - Configure PostgreSQL environment variables (username, password, database) - Update bin/utils to recognize 'postgres' as valid database option - Add PostgreSQL healthcheck configuration Store Implementation: - Create pg store package with bun ORM and pgx driver - Implement all CRUD operations for all store interfaces - Add entity package with complete model-to-database mappings - Create 10 database migrations covering all tables and relations - Implement query system with pagination, sorting, and filtering - Add internal filter parser for complex queries (contains, eq, bool, gt, ne) - Implement SQL error mapping and handling utilities - Create transaction support with bun Entities and Relations: - Namespaces, Users, Memberships - Devices with status tracking - API Keys, Public Keys, Private Keys - Tags with many-to-many relations (device-tags, publickey-tags) - Sessions and Tunnels Testing Infrastructure: - Add testcontainers-based integration tests - Create YAML fixture system for test data - Implement comprehensive unit tests for all store operations - Add database test utilities and helpers Integration: - Update api/server.go to support database selection - Update cli/main.go to support database selection - Add bun, pgx, and testcontainers dependencies - Maintain backward compatibility with existing MongoDB implementation
b5e21b8 to
73638f5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.