Skip to content

sqlite plugin - #22

Open
thai-canada wants to merge 4 commits into
brightsign:masterfrom
thai-canada:master
Open

sqlite plugin#22
thai-canada wants to merge 4 commits into
brightsign:masterfrom
thai-canada:master

Conversation

@thai-canada

Copy link
Copy Markdown

This plugin runs a local SQLite-backed API server on a BrightSign player and also accepts UDP commands for common table/row operations.

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>
Copilot AI review requested due to automatic review settings June 8, 2026 16:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.brs implementing the SQLite database helpers, REST endpoints, UDP command parsing, and HTML UI/help pages.
  • Adds README.md documenting 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.

Comment thread sqlite-plugin/sql.brs
else
m.SystemLog.SendLine("---------------------- Error creating table. Error code: " + result.ToStr())
end if
createStatement.Finalise()
Comment thread sqlite-plugin/sql.brs
else
m.SystemLog.SendLine("---------------------- Error creating table on retry. Error code: " + result.ToStr())
end if
createStatement.Finalise()
Comment thread sqlite-plugin/sql.brs
if type(m) = "roAssociativeArray" and type(m.SystemLog) = "roSystemLog" then
m.SystemLog.SendLine(bindErrorMessage$)
end if
statement.Finalise()
Comment thread sqlite-plugin/sql.brs
end if

result = statement.Run()
statement.Finalise()
Comment thread sqlite-plugin/sql.brs
Comment on lines +410 to +411
html$ = html$ + "var serverIp = window.location.hostname;"
html$ = html$ + "var serverBase = 'http://' + serverIp + ':8009';"
Comment thread sqlite-plugin/sql.brs
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 thread sqlite-plugin/sql.brs
Comment on lines +1273 to +1275
mVar.tableNames = tableNames
schemaJson$ = "["
for i = 0 to schema.Count() - 1
Comment thread sqlite-plugin/sql.brs
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$)
Comment thread sqlite-plugin/sql.brs
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>"
Comment thread SQLite Plugin
@@ -0,0 +1 @@

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