Feature/database support#299
Open
IND-Subu wants to merge 5 commits into
Open
Conversation
|
@IND-Subu is attempting to deploy a commit to the Dullabs Team on Vercel. A member of the Team first needs to authorize it. |
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.
🚀 Feature: SQLite Database Support for BhaiLang
This PR introduces first-class SQLite database support to BhaiLang using
better-sqlite3, enabling BhaiLang programs to interact with real databases while maintaining BhaiLang’s fun syntax and simplicity.✅ What This Adds
New Database Builtins
Connections are tracked internally and reused per filename.
🧠 Design Philosophy
💻 Example Usage
hi bhai database_connect bhai "test.db"; database_execute bhai "test.db" "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, naam TEXT, umar INTEGER)"; database_execute bhai "test.db" "INSERT INTO users (naam, umar) VALUES ('Rahul', 25)"; database_query bhai "test.db" "SELECT * FROM users"; database_close bhai "test.db"; bye bhaiSample Output
Attempting to connect to: test.db Connected successfully: test.db Query executed successfully Found X rows bhai [ { id: 1, naam: 'Rahul', umar: 25 } ] Closed successfully🔧 CLI Build Fix
better-sqlite3 is a native addon and cannot be bundled inside a single file. To ensure stability, the CLI build was updated to externalize:
This prevents runtime crashes like:
🛡️ Safety & Stability
📌 Notes
🙏 Request
Kindly review and provide feedback. Happy to align syntax, naming, or behavior with BhaiLang’s philosophy.
Bhai ne DB ko bhi bhai bana diya 😎