Add WebSocketSpec and MQTTSpec real-time protocol implementations#10
Merged
warkanum merged 1 commit intowebsocketspecfrom Dec 30, 2025
Merged
Add WebSocketSpec and MQTTSpec real-time protocol implementations#10warkanum merged 1 commit intowebsocketspecfrom
warkanum merged 1 commit intowebsocketspecfrom
Conversation
Copilot
AI
changed the title
[WIP] Add Websocket and MQTT specifications
Add WebSocketSpec and MQTTSpec real-time protocol implementations
Dec 30, 2025
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
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.
Extends ResolveSpec beyond REST with two new real-time protocol specifications sharing the same JSON message protocol, enabling WebSocket and MQTT-based database operations.
Core Implementations
WebSocketSpec (
pkg/websocketspec/): Real-time bidirectional communication over WebSocketMQTTSpec (
pkg/mqttspec/): Pub/sub-based operations for IoT/mobile/distributed systemsspec/{client_id}/request|response|notify/{sub_id}Shared Protocol
All three specs (REST/WebSocket/MQTT) use identical JSON message structure:
{ "id": "msg-123", "type": "request", "operation": "read", "schema": "public", "entity": "users", "options": { "filters": [{"column": "status", "operator": "eq", "value": "active"}], "sort": [{"column": "created_at", "direction": "desc"}], "limit": 10 } }Unified Hook System
12 lifecycle hooks across all specs (BeforeRead, AfterCreate, BeforeSubscribe, etc.) for:
Infrastructure Additions
Client Support
Examples provided for JavaScript (MQTT.js/native WebSocket), Python (paho-mqtt/websockets), and Go (paho.mqtt.golang/gorilla/websocket).
Both specs support database-agnostic operations via GORM/Bun adapters with consistent filtering, sorting, pagination, and preloading across all protocols.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.