Open
Conversation
Track used tables from the LLM response and generate a mermaid ER diagram in the streamed chat completion payload. Made-with: Cursor
Added 'used_tables' and 'diagram' fields to Query and GeneratedSQL types to support relationship diagram generation. Updated related parsing and response handling to accommodate these changes. Improved documentation to reflect the new structure.
- SDK: WebSocket client connecting to AloDB server - QuerySafetyFilter: whitelist-based guard, row data never sent to server - SchemaQueryTranslator: converts PostgreSQL information_schema queries to SQLite PRAGMA equivalents - DatabaseDriver: interface with SQLiteDriver and RoomDriver implementations - SessionDataManager: session-scoped data write + verified DELETE on disconnect/logout - AloDBClient: Builder API with connect/chat/trigger/write/disconnect - Trigger system: named triggers for proactive chatbot messages on page navigation - Sample app: full chat UI with streaming, thinking indicator, auto-execute queries Made-with: Cursor
Critical fixes: - WebSocketManager: make handleQueryRequest/executeAndSend suspend and wrap driver.execute() in withContext(Dispatchers.IO) to prevent main thread DB violations - MainActivity: move autoExecuteQueries to lifecycleScope.launch(Dispatchers.IO) with Dispatchers.Main for UI updates, eliminating main thread blocking - ChatMessage: change var text to val text; use immutable copy() in appendStreamingDelta to fix thread-safety across WebSocket and UI threads - QuerySafetyFilter: replace start-of-string ^ regex with DML_ANYWHERE full-text scan to block multi-statement and WITH-clause DML injection - sample/build.gradle.kts: replace annotationProcessor with ksp plugin (annotationProcessor does not work for Kotlin Room projects) Medium fixes: - AloDBClient: disconnect previous WebSocketManager (with OkHttpClient thread pool shutdown) before creating new one on connect(); run clearSessionData on clientScope (Dispatchers.IO) to avoid main thread DB ops in onDestroy() - RoomDriver.clearTable: use compileStatement + executeUpdateDelete() to return actual deleted row count instead of pre-delete row count - SchemaQueryTranslator: log a warning when table name extraction falls back to "unknown" instead of failing silently Minor fixes: - ChatAdapter: move all hardcoded Color.parseColor calls to colors.xml and read via ContextCompat.getColor() once per bind - settings.gradle.kts: rename dependencyResolution to dependencyResolutionManagement (invalid block name) - build.gradle.kts: register KSP plugin at root level with apply false Made-with: Cursor
When sendQueryResults is enabled via Builder, SELECT query results are sent back to the LLM so it can produce personalized responses. Default is false (schema-only mode, no row data leaves the device). DML statements (INSERT/UPDATE/DELETE/DROP/CREATE/ALTER) are always blocked regardless of the flag. - AloDBConfig: add sendQueryResults field (default false) - AloDBClient.Builder: add sendQueryResults(enabled) method - QuerySafetyFilter: add checkSelectOnly() for permissive SELECT mode - WebSocketManager: route to correct filter based on flag Made-with: Cursor
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.
No description provided.