Skip to content

Conversation

@blshukla
Copy link
Contributor

@blshukla blshukla commented Jul 11, 2025

📝 Description

Add an example app that combines BrightScript and JavaScript to handle SQLite database operations

Issue: PE-968

✔️ Dev Complete Checklist

  • PR template filled out
  • Change is tested by submitter
  • PR follows all linting and coding standards
  • Github Issue exists (if applicable)
  • Team member has been assigned
  • At least one commit message is in Conventional Commit format

Add an example app that combines BrightScript and JavaScript to
handle SQLite database operations
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a sample BrightScript/JavaScript application demonstrating SQLite database operations via a message port.

  • Introduces index.js for JS-side messageport handling and issuing SQL commands.
  • Implements autorun.brs with a BrightScript event loop and helper functions for creating, querying, and deleting records.
  • Updates Husky hooks by adding a shared script and adjusting the commit message hook.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
examples/bs-sqlite-db-example/index.js JS messageport setup and sequential SQLite command flow
examples/bs-sqlite-db-example/autorun.brs BrightScript event loop and SQLite helper functions
.husky/prepare-commit-msg Sources common hook logic and invokes commitizen hook
.husky/common.sh Adds command_exists helper and Windows/Git Bash workaround
Comments suppressed due to low confidence (2)

examples/bs-sqlite-db-example/autorun.brs:7

  • The variable 'm' is used without initialization; initialize 'm' (for example via m = CreateObject("roAssociativeArray")) before assigning properties to it.
    m.nodejs = CreateObject("roNodeJs", "SD:/index.js", { message_port: port })

examples/bs-sqlite-db-example/autorun.brs:50

  • The variable 'cmd' is undefined here; use the correct variable (e.g., eventData.message.command) or pass the SQL string into the print statement.
                                print "Failed to insert record: "; cmd

jdmedlin1
jdmedlin1 previously approved these changes Jul 14, 2025
Copy link
Contributor

@jdmedlin1 jdmedlin1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lherlein lherlein left a comment

Choose a reason for hiding this comment

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

LGTM

@blshukla blshukla merged commit 9623820 into main Jul 14, 2025
2 checks passed
@blshukla blshukla deleted the PE-968-sqlite branch July 14, 2025 23:21
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.

4 participants