Explore database structure, tables, and columns with the schema command
The schema command provides powerful tools to explore your database structure without writing SQL. View tables, inspect column definitions, and visualize your entire schema as a tree.
$ queryly schema info MyApp usersFetching table info...Table: usersColumns:┌─────────────┬──────────────┬─────────────┬────────────────┬───────────────┐│ Column Name │ Data Type │ Is Nullable │ Is Primary Key │ Default Value │├─────────────┼──────────────┼─────────────┼────────────────┼───────────────┤│ id │ INTEGER │ No │ PK │ ││ name │ TEXT │ No │ │ ││ email │ TEXT │ No │ │ ││ created_at │ DATETIME │ Yes │ │ CURRENT_TIME ││ is_active │ BOOLEAN │ Yes │ │ 1 │└─────────────┴──────────────┴─────────────┴────────────────┴───────────────┘Total: 5 column(s)
Column Information:
Field
Description
Column Name
The name of the column
Data Type
Database-specific data type (INTEGER, TEXT, VARCHAR, etc.)
Is Nullable
Whether the column accepts NULL values (Yes/No)
Is Primary Key
Marked with “PK” if column is part of the primary key
Default Value
Default value assigned to new rows (empty if none)
SQLite
PostgreSQL
MySQL
SQL Server
Common SQLite data types:
INTEGER - Whole numbers
TEXT - Text strings
REAL - Floating point numbers
BLOB - Binary data
NUMERIC - General numeric
Common PostgreSQL data types:
integer, bigint, smallint - Integer types
varchar, text, char - Text types
boolean - True/false values
timestamp, date, time - Date/time types
json, jsonb - JSON data
uuid - Universally unique identifiers
Common MySQL data types:
int, bigint, tinyint - Integer types
varchar, text, char - Text types
decimal, float, double - Numeric types
datetime, timestamp, date - Date/time types
json - JSON data
enum - Enumerated values
Common SQL Server data types:
int, bigint, smallint - Integer types
nvarchar, varchar, nchar - Text types
decimal, float, money - Numeric types
datetime, datetime2, date - Date/time types
bit - Boolean values
uniqueidentifier - GUIDs
Table names are case-sensitive on some database systems (PostgreSQL, MySQL on Linux). Use the exact casing shown in schema list.
# Step 1: See what tables existqueryly schema list MyDB# Step 2: Inspect specific table structurequeryly schema info MyDB users# Step 3: View full schema treequeryly schema tree MyDB
# See exact column names and types before writing SQLqueryly schema info MyDB orders# Then write your query with confidencequeryly data query MyDBSQL> SELECT id, user_id, total FROM orders WHERE total > 100
Row Counts: Computing row counts with COUNT(*) can be slow on very large tables (millions of rows). The schema commands use this to provide accurate counts.
Tree View: For databases with 100+ tables, consider using schema list first to narrow down which tables you want to inspect with schema info.