Skip to content

Cell Locking

Cell locking allows you to bind individual cells in a notebook to specific database connections, databases, and optionally schemas. This enables you to work with multiple data sources within a single notebook while maintaining consistency for specific analyses.

Cell locking ties individual notebook cells to specific database connections, providing:

  • Multi-Source Analysis: Query different databases within the same notebook
  • Connection Consistency: Lock critical cells to prevent accidental connection changes
  • Schema Specificity: Optionally lock cells to specific schemas within a database
  • Flexible Workflows: Change the notebook’s default connection while keeping certain cells locked
  • Compare data across development, staging, and production environments
  • Query different database systems (PostgreSQL, MySQL, etc.) in the same notebook
  • Analyze historical data stored in separate archives
  • Lock reporting cells to production while keeping exploratory cells flexible
  • Maintain reference data queries locked to specific connections
  • Ensure compliance queries always run against the correct database
  • Lock cells to specific schemas for multi-tenant applications
  • Maintain separation between different application modules
  • Work with multiple schemas within the same database connection

Locking and unlocking cells is simple and intuitive:

  1. To Lock: Click the Lock icon in the cell status bar
  2. To Unlock: Click the Lock icon again

When you lock a cell:

  • The cell locks to the currently selected connection, database, and schema
  • The lock icon changes to a closed lock to indicate the cell is locked
  • The cell will always use this specific connection for execution

When you unlock a cell:

  • The lock icon changes to an open lock
  • The cell will use the notebook’s default connection

Check if a cell is locked:

  • Locked: Closed lock icon in the cell status bar
  • Unlocked: Open lock icon in the cell status bar