Skip to content

Added SoSQL query support#28

Merged
thealphacubicle merged 3 commits into
developfrom
feature/socrata-update
Mar 10, 2026
Merged

Added SoSQL query support#28
thealphacubicle merged 3 commits into
developfrom
feature/socrata-update

Conversation

@thealphacubicle

Copy link
Copy Markdown
Owner

This pull request adds a new advanced tool, execute_sql, to the Socrata plugin, enabling users to run raw SoQL queries with robust security validation. The implementation includes a dedicated validator to ensure only safe SELECT queries are executed, and comprehensive tests to verify correct behavior and error handling. The documentation is also updated to reflect the new tool.

New tool: Raw SoQL execution

  • Added the execute_sql tool to the Socrata plugin, allowing users to run raw SoQL SELECT queries for complex data retrieval. The tool is documented in docs/BUILT_IN_PLUGINS.md and includes schema validation for required parameters. [1] [2]

Security and validation

  • Implemented the SoQLValidator class in soql_validator.py to enforce security restrictions, blocking non-SELECT statements and forbidden keywords, and integrated it into the plugin's query execution flow. [1] [2]
  • The plugin now validates SoQL queries before execution, returning descriptive error messages for invalid or unsafe queries.

User experience improvements

  • Added the _format_sql_results method to format query results for user display, including field names and record counts.

Testing and quality assurance

  • Extended plugin tests to cover the new tool, including success, validation errors, missing parameters, and API failures. Added a dedicated test suite for the SoQLValidator to ensure robust query validation. [1] [2] [3] [4]

@thealphacubicle thealphacubicle self-assigned this Mar 10, 2026
@thealphacubicle thealphacubicle added the enhancement New feature or request label Mar 10, 2026
@thealphacubicle thealphacubicle merged commit 32b6a9d into develop Mar 10, 2026
2 checks passed
@thealphacubicle thealphacubicle deleted the feature/socrata-update branch March 10, 2026 15:06
thealphacubicle added a commit that referenced this pull request Mar 10, 2026
* Removed redundant files

* Github action to prevent divergent branching on PR to main

* Added Socrata support  (#27)

* WIP: Socrata support (formatting etc)

* Updated README file with right config

* Updated Socrata isntructions to be more LLM friendly

* Fixed smoke test bug

* Updated smoke test bug

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Added SoSQL query support (#28)

* Added SoSQL query support

* Smoke test bug fix

* Removed smoke test

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Updated docs

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
thealphacubicle added a commit that referenced this pull request Apr 10, 2026
* Removed redundant files

* Github action to prevent divergent branching on PR to main

* Added Socrata support  (#27)

* WIP: Socrata support (formatting etc)

* Updated README file with right config

* Updated Socrata isntructions to be more LLM friendly

* Fixed smoke test bug

* Updated smoke test bug

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Added SoSQL query support (#28)

* Added SoSQL query support

* Smoke test bug fix

* Removed smoke test

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Updated docs

* Feature/arcgis support (#30)

* Bug fix

* Ruff fix

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Socrata discovery API bug fix (#31)

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Pr/boston changes merge (#34)

* Updated config files and deployment scripts (#33)

* Deployed prod MCP

* Added ACM SSL cert

* Updated shell script and staging vars

* Staging tf vars files changed

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Generalized boston specific values

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Feature/opencontext cli (#35)

* Lint fix

* Lint fix

* bug fix

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Updated docs

* Fixed CLI bugs and added template tfvars

* lint fix

* Added DX files

* lint fix

* Feature/security update (#37)

* Lint fix

* Security update: removed Lambda entrypoint

* Added DLQ SQS + tagging

* Updated CLI tools for new service additions

* Added transparency CLI commands + tests

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Refactor/docs (#61)

* lint fix

* updated docs

* Updated workflows

* bug fix

* Parallelized container setup

* lint fix

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>

* Fixed CLI bug

---------

Co-authored-by: Srihari Raman <raman.sr@northeastern.edu>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant