First Query
Run your first SQL query in data-peek
First Query
Now that you're connected to a database, let's run your first query!
Running a Query
-
Open a new tab by clicking the + button in the tab bar or pressing
Cmd+T(macOS) orCtrl+T(Windows/Linux) -
Type your query in the editor:
SELECT * FROM users LIMIT 10; -
Execute the query by pressing
Cmd+Enter(macOS) orCtrl+Enter(Windows/Linux) -
View the results in the table below the editor
The results show the first 100 rows by default. Use the pagination controls at the bottom to navigate through larger result sets.
Quick Table Preview
Instead of writing a query, you can quickly preview any table:
- Expand your connection in the sidebar to see schemas and tables
- Click on a table name to open a preview tab
- data-peek automatically runs
SELECT * FROM table LIMIT 100
Understanding the Results
Results Toolbar
| Feature | Description |
|---|---|
| Row count | Shows number of rows returned |
| Duration | Query execution time in milliseconds |
| Export | Download results as CSV or JSON |
| Edit | Enable inline data editing |
Data Type Indicators
Columns show colored badges indicating their data type:
| Color | Types |
|---|---|
| 🟣 Purple | UUID |
| 🟢 Green | Text, VARCHAR |
| 🔵 Blue | Integer, Numeric |
| 🟠 Orange | Date, Timestamp |
| 🟡 Yellow | Boolean |
NULL Values
NULL values are displayed with a distinctive NULL badge to clearly distinguish them from empty strings.
Working with Results
Copy Cell Value
Click any cell to copy its value to the clipboard.
Copy Row as JSON
Right-click a row and select Copy as JSON to get the entire row as a JSON object.
Navigate Foreign Keys
If a column is a foreign key, you can Cmd+Click (macOS) or Ctrl+Click (Windows/Linux) to open the referenced record in a new tab.
Query Editor Features
Syntax Highlighting
The Monaco-powered editor provides full SQL syntax highlighting and IntelliSense.
Format SQL
Press Cmd+Shift+F (macOS) or Ctrl+Shift+F (Windows/Linux) to auto-format your SQL query.
Multiple Tabs
Open multiple query tabs to work on different queries simultaneously. Each tab maintains its own:
- Query text
- Results
- Pagination state
- Execution history
Query History
Every query you run is automatically saved to history. Access it from the sidebar to:
- Re-run previous queries
- See execution times and row counts
- Delete old queries
- Search through your history
Saving Queries
Bookmark frequently used queries:
- Write your query
- Press
Cmd+Shift+S(macOS) orCtrl+Shift+S(Windows/Linux) - Give it a name, description, and optional tags
- Access saved queries from the sidebar
Next Steps
Now that you know the basics, explore more features: