sqlite plugin - #22
Open
thai-canada wants to merge 4 commits into
Open
Conversation
Signed-off-by: thai-canada <93546914+thai-canada@users.noreply.github.com>
This README provides detailed information about the BrightSign SQLite Plugin, including its functionality, configuration options, access URLs, REST API endpoints, UDP commands, and troubleshooting tips. Signed-off-by: thai-canada <93546914+thai-canada@users.noreply.github.com>
Signed-off-by: thai-canada <93546914+thai-canada@users.noreply.github.com>
Signed-off-by: thai-canada <93546914+thai-canada@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a BrightSign plugin that hosts a local SQLite-backed REST API + UDP command interface, along with a built-in UI/help page and usage documentation.
Changes:
- Introduces
sql.brsimplementing the SQLite database helpers, REST endpoints, UDP command parsing, and HTML UI/help pages. - Adds
README.mddocumenting configuration, endpoints, and usage examples. - Adds an extra (currently empty) file named
SQLite Plugin.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| sqlite-plugin/sql.brs | Implements the SQLite REST/UDP plugin and embedded UI/help pages. |
| sqlite-plugin/README.md | Documents setup, configuration, REST endpoints, and UDP commands. |
| SQLite Plugin | Adds an empty file (likely accidental or placeholder). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else | ||
| m.SystemLog.SendLine("---------------------- Error creating table. Error code: " + result.ToStr()) | ||
| end if | ||
| createStatement.Finalise() |
| else | ||
| m.SystemLog.SendLine("---------------------- Error creating table on retry. Error code: " + result.ToStr()) | ||
| end if | ||
| createStatement.Finalise() |
| if type(m) = "roAssociativeArray" and type(m.SystemLog) = "roSystemLog" then | ||
| m.SystemLog.SendLine(bindErrorMessage$) | ||
| end if | ||
| statement.Finalise() |
| end if | ||
|
|
||
| result = statement.Run() | ||
| statement.Finalise() |
Comment on lines
+410
to
+411
| html$ = html$ + "var serverIp = window.location.hostname;" | ||
| html$ = html$ + "var serverBase = 'http://' + serverIp + ':8009';" |
Comment on lines
+68
to
+71
| h.localServer.AddPostToFormData({ url_path: "/createTable", user_data: h.SqlCreateAA }) | ||
| h.localServer.AddPostToFormData({ url_path: "/insert", user_data: h.SqlInsertAA }) | ||
| h.localServer.AddPostToFormData({ url_path: "/update", user_data: h.SqlUpdateAA }) | ||
| h.localServer.AddPostToFormData({ url_path: "/delete", user_data: h.SqlDeleteAA }) |
Comment on lines
+1273
to
+1275
| mVar.tableNames = tableNames | ||
| schemaJson$ = "[" | ||
| for i = 0 to schema.Count() - 1 |
Comment on lines
+1305
to
+1311
| schemaJson$ = schemaJson$ + "{" + Chr(34) + "table" + Chr(34) + ":" + Chr(34) + tableNameOut$ + Chr(34) + "," + Chr(34) + "columnCount" + Chr(34) + ":" + columnCountOut.ToStr() + "," + Chr(34) + "columns" + Chr(34) + ":" + columnsJson$ + "}" | ||
| next | ||
| schemaJson$ = schemaJson$ + "]" | ||
|
|
||
| body$ = "{" + Chr(34) + "status" + Chr(34) + ":" + Chr(34) + "success" + Chr(34) + "," + Chr(34) + "dbFile" + Chr(34) + ":" + Chr(34) + mVar.dbFile + Chr(34) + "," + Chr(34) + "countTable" + Chr(34) + ":" + tableNames.Count().ToStr() + "," + Chr(34) + "schema" + Chr(34) + ":" + schemaJson$ + "}" | ||
| e.AddResponseHeader("Content-type", "application/json") | ||
| e.SetResponseBodyString(body$) |
| html$ = html$ + "</head>" | ||
| html$ = html$ + "<body>" | ||
| html$ = html$ + "<h1>SQLite</h1>" | ||
| html$ = html$ + "<span>Database file: <b>" + mVar.dbFile + "</b> - Active table: <b>" + mVar.defaultTable + "</b></span>" |
| @@ -0,0 +1 @@ | |||
|
|
|||
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.
This plugin runs a local SQLite-backed API server on a BrightSign player and also accepts UDP commands for common table/row operations.