Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Dbcube SnippetsNew to Visual Studio Code? Get it now.
Dbcube Snippets

Dbcube Snippets

Dbcube

|
1 install
| (0) | Free
Intelligent snippets, autocompletion, and documentation for Dbcube Query Builder with contextual suggestions and tab completion
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dbcube Query Builder Snippets

Dbcube Logo

Intelligent snippets, autocompletion, and documentation for Dbcube Query Builder

This Visual Studio Code extension provides comprehensive support for Dbcube Query Builder, including intelligent autocompletion, contextual snippets, parameter hints, and rich documentation on hover.

🚀 Features

✨ Intelligent Autocompletion

  • Smart method suggestions based on context
  • Supports all Dbcube Query Builder methods
  • Contextual operator suggestions (=, !=, >, <, IS NULL, IS NOT NULL, etc.)
  • Tab completion with parameter placeholders

📖 Rich Documentation on Hover

  • Detailed method descriptions with examples
  • Parameter information with types
  • Usage notes and best practices
  • Real-world code examples

🔧 Parameter Hints & Signatures

  • Live parameter suggestions as you type
  • Multiple signature support for overloaded methods
  • Special handling for IS NULL and IS NOT NULL operators
  • Smart parameter counting and validation

📝 Comprehensive Snippets

  • 25+ pre-built query patterns
  • Common authentication patterns
  • Pagination helpers
  • Search query templates
  • CRUD operation templates

🎯 Context-Aware Suggestions

  • Only shows Dbcube suggestions in relevant contexts
  • Categorized suggestions (Conditions, Queries, Aggregations, Modifications)
  • Priority-based sorting for better developer experience

📦 Installation

From VS Code Marketplace

  1. Open Visual Studio Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Dbcube Query Builder Snippets"
  4. Click Install

From VSIX

  1. Download the latest .vsix file from the releases page
  2. Open VS Code
  3. Press Ctrl+Shift+P and type "Extensions: Install from VSIX"
  4. Select the downloaded .vsix file

🛠️ Usage

Quick Start

  1. Initialize Dbcube: Type dbcube-db and press Tab
const dbcube = new Dbcube();
await dbcube.init();
const db = dbcube.database('your_database');
  1. Start typing a query: The extension automatically provides suggestions
db.table('users').  // <- Autocompletion appears here
  1. Use snippets: Type any snippet prefix and press Tab

🔍 Available Snippets

Prefix Description Example
dbcube-db Database connection setup const db = dbcube.database('name')
dbcube-select Basic SELECT query .select(['col1', 'col2']).get()
dbcube-select-where SELECT with WHERE .where('col', '=', 'value').get()
dbcube-first Get first record .where('id', '=', 1).first()
dbcube-insert Insert records .insert([{col: 'value'}])
dbcube-update Update records .where('id', 1).update({col: 'new'})
dbcube-delete Delete records .where('col', '=', 'value').delete()
dbcube-where-null IS NULL condition .where('col', 'IS NULL')
dbcube-where-not-null IS NOT NULL condition .where('col', 'IS NOT NULL')
dbcube-or-where OR WHERE condition .orWhere('col', '=', 'value')
dbcube-join INNER JOIN .join('table', 'col1', '=', 'col2')
dbcube-left-join LEFT JOIN .leftJoin('table', 'col1', '=', 'col2')
dbcube-order-by ORDER BY clause .orderBy('column', 'DESC')
dbcube-limit LIMIT clause .limit(10)
dbcube-count COUNT aggregation await ...count() (returns number)
dbcube-auth-user User authentication pattern Complete login query
dbcube-paginate Native pagination .paginate(page, perPage) → items + metadata
dbcube-search Search with LIKE Multi-column search
dbcube-transaction Atomic transaction db.transaction(async (trx) => {...})
dbcube-raw Raw SQL with params db.raw('SELECT ... WHERE x = ?', [v])
dbcube-upsert Insert-or-update .upsert(rows, ['key'])
dbcube-increment / dbcube-decrement Atomic counters .increment('views', 1)
dbcube-exists Existence check .exists() → boolean
dbcube-chunk Batch processing .chunk(500, async rows => {...})
dbcube-with / dbcube-with-one Eager loading .with('orders') — no N+1
dbcube-where-not-in NOT IN condition .whereNotIn('status', [...])
dbcube-having / dbcube-group-agg Grouped aggregations .selectRaw([...]).groupBy().having()
dbcube-truncate Clear a table .truncate()

🎨 Advanced Features

Method Chaining with Intelligence

The extension understands Dbcube's fluent interface:

const users = await db.table('users')
  .select(['id', 'name', 'email'])  // ← Suggests column arrays
  .where('status', '=', 'active')   // ← Suggests operators
  .orWhere('email', 'IS NOT NULL')  // ← Knows IS NULL doesn't need 3rd param
  .orderBy('created_at', 'DESC')    // ← Suggests ASC/DESC
  .limit(50)                        // ← Suggests numbers
  .get();                          // ← Suggests execution methods

Smart NULL Handling

The extension properly handles the TypeScript overloads for NULL operators:

// ✅ Correct - No third parameter needed
.where('deleted_at', 'IS NULL')
.orWhere('email', 'IS NOT NULL')

// ✅ Also correct - With value parameter  
.where('status', '=', 'active')
.where('age', '>', 18)

Parameter Hints

Get live parameter information as you type:

Parameter Hints Example

Documentation on Hover

Hover over any Dbcube method to see detailed documentation:

Hover Documentation Example

⚙️ Configuration

The extension can be customized via VS Code settings:

{
  "dbcubeSnippets.enableAutoCompletion": true,
  "dbcubeSnippets.enableHoverDocumentation": true,
  "dbcubeSnippets.enableParameterHints": true,
  "dbcubeSnippets.suggestionLevel": "intermediate"
}

Settings Details

Setting Type Default Description
enableAutoCompletion boolean true Enable/disable intelligent auto-completion
enableHoverDocumentation boolean true Show method documentation on hover
enableParameterHints boolean true Show parameter hints and suggestions
suggestionLevel string "intermediate" Suggestion level: basic, intermediate, advanced

🎯 Supported Languages

  • TypeScript (.ts, .tsx)
  • JavaScript (.js, .jsx)

📚 Examples

Basic CRUD Operations

// CREATE
const newUser = await db.table('users')
  .insert([{
    name: 'John Doe',
    email: 'john@example.com',
    age: 30
  }]);

// READ
const users = await db.table('users')
  .select(['id', 'name', 'email'])
  .where('age', '>=', 18)
  .orderBy('created_at', 'DESC')
  .limit(10)
  .get();

// UPDATE  
const updated = await db.table('users')
  .where('id', '=', 1)
  .update({
    name: 'John Updated',
    last_login: new Date()
  });

// DELETE
const deleted = await db.table('users')
  .where('status', '=', 'inactive')
  .where('last_login', '<', '2023-01-01')
  .delete();

Advanced Queries

// Complex WHERE conditions with NULL checks
const results = await db.table('users')
  .select(['id', 'name', 'email', 'phone'])
  .where('email', 'IS NOT NULL')
  .where('status', '=', 'active')
  .orWhere('role', '=', 'admin')
  .whereBetween('age', [18, 65])
  .whereIn('department', ['IT', 'Marketing', 'Sales'])
  .get();

// JOINs with aggregations
const userStats = await db.table('users')
  .leftJoin('orders', 'users.id', '=', 'orders.user_id')
  .select(['users.name', 'COUNT(orders.id) as order_count'])
  .groupBy('users.id')
  .orderBy('order_count', 'DESC')
  .get();

// Search functionality
const searchResults = await db.table('products')
  .where('name', 'LIKE', '%' + searchTerm + '%')
  .orWhere('description', 'LIKE', '%' + searchTerm + '%')
  .where('status', '=', 'published')
  .orderBy('created_at', 'DESC')
  .limit(50)
  .get();

🔧 Commands

The extension provides several commands accessible via the Command Palette (Ctrl+Shift+P):

  • Dbcube: Insert Query Template - Inserts a basic query template
  • Dbcube: Show Documentation - Opens Dbcube documentation

🐛 Known Issues

  • Parameter hints may not appear immediately in some cases (restart TS server: Ctrl+Shift+P → "TypeScript: Restart TS Server")
  • Autocompletion works best with explicit Dbcube imports

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository
git clone https://github.com/dbcube/vscode-dbcube-snippets.git
cd vscode-dbcube-snippets
  1. Install dependencies
npm install
  1. Open in VS Code and press F5 to launch Extension Development Host

Building

npm run compile
npm run package  # Creates .vsix file

📋 Requirements

  • Visual Studio Code 1.74.0 or higher
  • Dbcube Query Builder package installed in your project

📄 License

This extension is licensed under the MIT License.

🙏 Acknowledgments

  • Thanks to the Dbcube team for creating an amazing query builder
  • Inspired by popular ORM extensions like Prisma and Sequelize tools
  • Built with ❤️ for the JavaScript/TypeScript community

📞 Support

  • 🐛 Issues: GitHub Issues
  • 📖 Documentation: Dbcube Docs
  • 💬 Discussions: GitHub Discussions

Happy coding with Dbcube! 🚀

Made with ❤️ by the Dbcube team

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft