Skip to content
Home
Docs/Database

Database

PocketCode ships a real PostgreSQL 18.2 that runs inside the app on 64-bit ARM phones, with no server and no account to set up. Around it: a SQL console with an AI assistant in the editor, a data viewer you can edit, backups and restore, execution plans, ER diagrams and a schema designer. The same module also opens your PostgreSQL and MySQL servers and your Neon, Supabase, PlanetScale, Turso and Cloudflare D1 databases. MongoDB, Redis, Firestore, monitoring, security, dashboards, import and sharing are in Database tools.

What it is and how to open it

Database is a full-screen manager that opens over the app; it is not one of the five pages of the pager. It has its own back stack: the screens of the core are on this page and the rest are in Database tools.

Four ways to open it

FromHow
Tools sheetTap Tools in the bottom bar, then the Database tile in Dev tools. You land on the start screen.
Command paletteRun Database Manager (“Connect to and query your databases”).
HomeThe Database quick action, or the databases widget.
Backend ManagerOpen in Database on a connected provider's project opens its project, tables or SQL console directly.

The start screen

The root of the module's navigation.

You can

  • My Connections opens the list of connections.
  • The Local Database card shows Running or Stopped. Tap it to install the engine (first time only, with a progress bar), start it and open its tables.
  • Start / Stop on the card once the app has checked the engine; Manage (the engine screen) and Use in project (the connection URL) only while it is running.
  • Monitoring and Schema Designer (it needs no connection).

You can't, and why

  • On a phone whose architecture the build has no engine for, tapping the card installs nothing and says “PostgreSQL is not included in this build for your device.” The rest of the module still works.Device
  • Manage and Use in project don't exist while the engine is stopped: there would be nothing to show.By design
Database Manager start screen on a tablet: My Connections, the Local Database card stopped with only Start, Monitoring and Schema Designer
Start screen on a tablet. With the engine stopped there is only Start: Manage and Use in project appear once it runs

Moving around

  • Back is the Android back gesture. It retraces your path one screen at a time, and on the start screen it closes the module. There are no back arrows in the header.
  • The title is a switch. Tap it (the ▾ next to it) to open Switch database: with the local engine, its databases, New Database and Engine; with any other connection, only the active database. Below, Connections (the active one first, marked Active) and All connections. It isn't offered on the start screen, the connection list and form, the project list or the schema designer.
  • The grid icon opens Tools: 25 tools in six sections (Explore, Query, Design, Data, Server, Security), a Search tools box and a Frequent row that appears after you have used a tool three times (four at most). Only what makes sense for the open connection is shown.
  • The subtitle says which database is open and whether the engine runs, for example postgres · ● Engine running.
  • The biometric lock, if you turned it on in Security, asks for your fingerprint, face or the device PIN / pattern when the module opens.
Database Manager start screen with My Connections, the Local Database card running, Monitoring and Schema Designer
Start screen — connections, the local engine and two shortcuts
Tools sheet with Frequent, Explore and Query sections
Tools — one sheet, grouped by what you want to do
Switch database sheet with the postgres database, New Database, Engine and the list of connections
Tap the title to switch database or connection

Phone, landscape and tablet

Phone, portraitOne screen at a time. The console switches between Editor and Results.
Phone, landscapeA slim rail on the left replaces the header (Tools and the connection switch). The console shows editor and results side by side with a divider you can drag.
Tablet, portraitEditor on top and results below, with 30 / 50 / 70 % presets. The side panel opens as a drawer.
Tablet, landscapeA permanent Tools rail that folds to a narrow strip, a side panel with your connections and tables (it docks from 952 dp of width), a row detail pane next to the grid, a tab strip and keyboard shortcuts in the console.

Screen map

One row per screen, sheet and tab of the module that this page covers.

ScreenHow you get thereWhat you can do
Database Manager (start screen)Tools → Database, the palette, Home or Open in DatabaseOpen My Connections, start or stop the local engine, Manage it, Use in project, open Monitoring or Schema Designer.
Databases (connection list)My Connections, or All connections in the title switchSee favourites, local, cloud and custom connections; open, edit, duplicate, test, favourite or delete one; add a server with +.
New Connection / Edit Connection+, the ⋮ of a card, or Use a direct connection on a Supabase projectParse a connection string, fill the details, set TLS and an SSH tunnel, Test Connection, Save.
TablesTap a connection, or Tools → TablesSearch tables and views, open data or structure, Create Table, import, export.
Data (viewer)Tap a table or viewFilter, Sort, Columns, Views, edit cells, select rows, Copy As, Export, Insert Row, add a column.
Row DetailTap a rowRead and edit one row as a form, Copy JSON.
Table Detail⋮ → Table Detail, or Structure on a tableColumns, indexes, keys, triggers and DDL; Rename, Truncate, Drop Table.
Create TableCreate Table or Tools → New tableDefine a table with 15 column types and the PK, AI, NN, UQ flags.
SQL ConsoleTools → SQL consoleWrite and run SQL, ask the AI, use parameters and tabs, copy or export results, Explain.
Query planTools → Execution plan, or ExplainSee the plan as a tree, measure it with Run it for real, get index suggestions and an AI explanation.
Schema TreeTools → Schema treeBrowse database → tables → columns and indexes.
ER DiagramTools → ER diagramPinch and drag a diagram of tables and relations, Export Diagram as PNG, Edit as design.
Schema DiffTools → Compare schemas (Pro)Save Snapshot, Run Diff, Generate Migration.
Backup & RestoreTools → BackupsBack up, restore, import and export dumps of the local PostgreSQL; schedule backups (Pro).
EngineManage, Engine in the title switch, or Tools → Engine settings, Extensions, Server logHealth, Extensions, Log and Settings of the local PostgreSQL.
Schema Designer and the new-schema wizardStart screen, or Tools → Schema designerList, create (3-step wizard, 6 templates), duplicate and delete schema projects.
Schema editor, table editor and Export SchemaOpen a schema projectDraw tables and relations, edit columns, export 7 formats, Apply to … in the console.
Tools sheet and railThe grid icon; permanent on a landscape tabletSearch and open any of the 25 tools.
Switch database and the side panelTap the title; the panel on a tabletChange database or connection, New Database, Engine, search connections and tables.
Use in your projectUse in project on the engine cardSee the connection URL, Reveal, Copy URL, Write .env in the open project.
More screens of the moduleTools sheet, project lists, Open in DatabaseProjects of provider accounts, Import Preview, Query History, Saved Queries, Charts, Dashboards, Monitoring, Test data, Security, Audit Log, Sharing, Redis, Firestore and the PlanetScale deploy diff: all in Database tools.
The screens in the last row, and the tools of the Tools sheet that aren't on this page, are documented in Database tools.

What you can connect

The module opens 13 kinds of database. Your own PostgreSQL and MySQL servers are connections you save; provider accounts come from the services you connect in Settings → Integrations → Connected Services (or from the Backend Manager) and need network. Firestore uses your Firebase project.

EngineHow it connectsWhat you can do
PostgreSQL (local)The engine inside the app: PostgreSQL 18.2 on 127.0.0.1:5433, no account. 64-bit ARM phones only.Everything on this page, plus engine settings, extensions, the server log, backups with restore and Use in project.
PostgreSQL (your server)Straight to your host, with optional TLS and SSH tunnel.Tables, data, SQL console, plans, create tables, ER diagram, schema tools.
MySQL / MariaDBPocketCode's own MySQL client, with optional TLS and SSH tunnel.The same, except that it lists no indexes, foreign keys or triggers and its plans are estimates.
NeonYour Neon account. SQL runs over JDBC when the app can read the project's connection from your account, and over Neon's HTTP API otherwise.SQL console with the Read-only guard, tables, data, plans, ER diagram.
SupabaseYour Supabase account; SQL goes through its API across every schema. Use a direct connection adds a real PostgreSQL connection once you give the password.The same as Neon.
PlanetScaleYour account lists databases and branches; a branch opens as a MySQL connection with full certificate checks.Like MySQL / MariaDB. Branch schema, schema check and deploy-request diff are in Database tools.
TursoYour Turso account; SQL goes over Turso's HTTP API.SQL console, tables, data, ER diagram (SQLite plans have no costs).
Cloudflare D1Your Cloudflare account; SQL goes over D1's API, like Turso.The same as Turso.
MongoDB AtlasYour Atlas account lists clusters; you type the database user and password.Collections and counts, in Database tools. No SQL console.
Upstash RedisYour Upstash account; opening a database connects as a real Redis database.Redis tools, in Database tools. No SQL console.
MongoDBPocketCode's own MongoDB client, with SCRAM authentication and TLS.Collections and counts, in Database tools.
RedisPocketCode's own Redis client, with TLS.Key browser, CLI and monitor, in Database tools.
Cloud FirestoreYour Firebase project in Settings → Integrations, or the Google session of the Backend Manager.Browse and query, in Database tools.
PocketCode has no server of its own in between: the app talks to the local engine, to your hosts or to the provider's API directly. These are 13 connection types, which the site counts as 12 engines because the local engine and your own PostgreSQL servers are the same engine. DigitalOcean's managed PostgreSQL, MySQL and Redis open from Managed databases in the Backend Manager, as ordinary PostgreSQL, MySQL or Redis connections held in memory (no form, and they don't count toward the connection limit); its other engines aren't opened from there. MongoDB, Redis, Firestore, monitoring, security, dashboards and the rest are covered in Database tools.

PostgreSQL on your phone

The engine is PostgreSQL 18.2 compiled for Android and packed inside the app, for 64-bit ARM phones (arm64-v8a). It listens only on the phone (127.0.0.1, port 5433, user postgres) and over TCP always asks for a password (SCRAM-SHA-256); the password is random, stored encrypted, and the engine refuses to start without it. Nothing needs root, Termux or a network.

Start it

From the start screen.

  1. 1Tap Local Database. The first time, the app unpacks the engine and creates the database cluster, then starts the server and opens the table list.
  2. 2To stop it, tap Stop on the engine card. To start it again, Start.
  3. 3Screens that need the engine (Tables, Data, SQL console, Execution plan, Schema tree, ER diagram and others) show Engine stopped with a Start button when it is off: “Start the local PostgreSQL engine to work with its tables.”
The first start unpacks a package of about 36 MB and runs initdb on the phone to create the cluster (it is allowed up to 10 minutes); that happens once. The app doesn't keep the engine alive in the background: when you leave, it asks PostgreSQL to write a checkpoint, and Android may stop the process later. The first-run steps (“Preparing…”, “Extracting…”, “Verifying…”) and the Running / Stopped labels are in English in every language.

You can't, and why

  • The engine doesn't live in the background: Android may kill the process without warning, so the card can say Stopped when you come back and you tap Start. Google Play requires a foreground service to have a declared type and a visible purpose, and “keeping a PostgreSQL alive” fits none.Google Play
  • The engine ships only for arm64-v8a. On x86 (emulators, x86 Chromebooks) it isn't available.Device

The engine screen

Open it with Manage on the engine card or Engine in the title switch. Engine settings, Extensions and Server log in Tools open the same screen on a tab (Engine settings opens Health, not Settings). It has four tabs and a Refresh button. With the engine stopped, each tab says “The engine is stopped. Start it to see its state.”

Landscape tablet: connection list on the left, Engine Health tab with PostgreSQL 18.2, sessions and slowest statements in the middle, and the Tools rail on the right
Landscape tablet: your connections on the left, Engine → Health in the middle, the Tools rail on the right

Health

The state of the running server.

You can

  • Read Version, Running for, Data size, Open sessions, Commits, Rollbacks, Cache hits, Checkpoints and Deadlocks.
  • See the size of each database under Databases, and remove one with Delete database (after a confirmation: “Everything in this database is deleted and there is no undo.”).
  • Watch Active sessions and end one with Cancel query or Terminate session.
  • See Slowest statements (calls, average time, rows) from pg_stat_statements. If it isn't active, Activate runs CREATE EXTENSION pg_stat_statements; to measure you also need Statement statistics on in Settings and a restart.

You can't, and why

  • Delete database is never offered for postgres (“The “postgres” database is the engine's maintenance database and cannot be deleted.”) or for the database you are connected to.By design

Extensions

The extensions this PostgreSQL package carries: 17 in total (btree_gin, btree_gist, citext, dblink, fuzzystrmatch, hstore, pageinspect, pg_freespacemap, pg_stat_statements, pg_trgm, pgcrypto, pgrowlocks, plpgsql, postgres_fdw, tablefunc, unaccent, uuid-ossp).

You can

  • See Most useful (pg_trgm, pgcrypto, uuid-ossp, citext, hstore, pg_stat_statements) and All available, each with its name, version and description.
  • Switch one on or off with its switch: it runs CREATE EXTENSION or DROP EXTENSION in the open database.

You can't, and why

  • You can't install other extensions: only the 17 in the package, and a name is checked against that list before it runs.By design

Log

The server's own log.

You can

  • Read the last 256 KiB of the server log, filtered by All, LOG, WARNING, ERROR or FATAL.
  • Copy it, or Share it as text.

You can't, and why

—

Settings

How much memory the engine takes and how safe its writes are. Changes apply when you save: the engine restarts.

You can

  • Pick the memory Profile: Light, Balanced or Powerful. The line under it says what it sets, and Detected RAM what the phone reports.
  • Switch Durability and Statement statistics (“Records every statement so Health can show the slowest ones. Needs a restart.”).
  • Copy URL copies the complete connection URL, password included.
  • Save (enabled only with changes; saves and restarts: “Settings applied — engine restarted.”) and Restart engine.

You can't, and why

  • The port is fixed at 5433 and the engine listens only on 127.0.0.1: it is never exposed to the network.By design
  • Powerful is offered only when Android reports 8 GiB of RAM or more.Device
Engine Extensions tab with pg_trgm switched on
Engine → Extensions: switch on what PostgreSQL bundles
Engine Settings tab with Light, Balanced and Powerful profiles and the Durability switch
Engine → Settings: memory profile and durability

Memory profiles

ProfileWhat it sets
Light16 MB shared memory · 2 MB per sort · up to 10 connections · 128 MB effective_cache_size · 2 workers. Default under 6 GiB of RAM.
Balanced64 MB shared memory · 4 MB per sort · up to 20 connections · 512 MB effective_cache_size · 3 workers. Default from 6 GiB.
Powerful128 MB shared memory · 8 MB per sort · up to 30 connections · 1 GB effective_cache_size · 4 workers. Needs 8 GiB or more.

RAM is the total Android reports (ActivityManager.totalMem), counted in GiB: a phone sold as “8 GB” may report less and not offer Powerful. A saved profile the phone can no longer sustain is lowered. Always: no parallel queries (max_parallel_workers = 0) and time zone UTC.

Durability

  • On (default): full_page_writes = on and synchronous_commit = off. If the phone loses power or Android kills the app, PostgreSQL recovers on its own, but the last few milliseconds of committed transactions can be lost; nothing is corrupted.
  • Off: faster, but full_page_writes = off: a crash while writing can leave the database corrupt with no way back. The screen warns you in amber. Keep it on unless the data can be regenerated.

More than one database

The local engine can hold several databases.

You can

  • Tap the title and choose New Database; type a Database name and tap Create. Names keep letters, numbers and _. The app switches to the new database straight away.
  • Every database appears under Databases in the same switch; tap one to switch. Extensions, tables and queries apply to the open one.

You can't, and why

  • On Free the engine holds one database (postgres), so New Database opens the Pro wall straight away; the dialog and the tool carry a Pro badge.Pro
  • Only the local engine switches databases; every other connection has a fixed one.By design

Use it from your code

Use in project on the engine card (engine running) opens the sheet Use in your project.

  1. 1The sheet shows the Connection URL with the password hidden: postgresql://postgres:***@127.0.0.1:5433/<database>.
  2. 2Reveal shows the password and Hide hides it again. Copy URL copies what the sheet shows, so it copies the hidden version until you tap Reveal. The Copy URL in the engine's Settings tab always copies the full URL.
  3. 3Write .env in the open project asks “Write .env?” and, on Write, puts DATABASE_URL in the project's .env: it replaces the first existing DATABASE_URL (duplicates are removed, a commented one is ignored) and keeps the rest of the file. If the file or a .git folder exists, .env is added to .gitignore.

You can't, and why

  • Neither Reveal nor Copy URL asks for your fingerprint, even with the biometric lock on.Not yet
  • With the engine stopped there is no URL (“The local engine is stopped, so there is no connection to hand out. Start it and come back.”), and with no open project there is nowhere to write (“No project is open, so there is nowhere to write a .env file.”).By design
  • There is no psql or pgpass: the password leaves the engine only through this URL or the environment variables.By design

Terminal and Node

While the engine runs, the local terminal and Node scripts get DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE in their environment. With npm i pg in a project, new Client() connects with no configuration. The terminal also has a ready-made snippet, Local PostgreSQL (Node).

The variables are read when a session starts: open a new session after starting the engine. SSH sessions don't get them. The terminal has no psql or pg_dump; backups are done from the Backups tool.

Connections

My Connections (titled Databases) lists everything the module can open. Opening and saving connections work the same for every type; what each type does once open is in the table under “Connection types”.

The connection list

Open it from My Connections on the start screen or All connections in the title switch.

You can

  • See your connections in sections: Favourites, Local Databases, Cloud Databases and Custom Connections, each with a count. Each card shows the engine's logo, the name, the host partly hidden (••.••••.empresa.com:5432), the environment in text (red PROD when the group or colour label starts with PROD) and a status dot.
  • Tap a card to open it: the local engine and your servers open their tables, provider accounts open their projects, Redis and Firestore open their own browsers.
  • Tap + (New Connection) to add a server.
  • Use the ⋮ of a card: Edit Connection, Duplicate (adds “ (Copy)” to the name), Test Connection, Add to favourites / Remove from favourites and Delete (“Delete connection …? This cannot be undone.”). Deleting also erases the stored credential and, for a PlanetScale branch opened as MySQL, revokes its branch password in your PlanetScale account.
  • Keep your connections in your PocketCode account. With Enable Sync on in the Settings Sync dialog of Settings (Cloud Sync, a Pro feature) and Connections (SSH/DB) ticked, saving or editing one of your own servers, opening a PlanetScale branch as MySQL and deleting a connection also update your account. Only metadata goes: name, host, port, engine and group label; never the user, the password, the TLS settings or anything else the app keeps on the side. With Cloud Sync off, or that box unticked, nothing is sent. Connections without a host aren't sent either.

You can't, and why

  • The local engine's connection can't be edited or deleted: “The local PostgreSQL connection is managed by the app: its host, port and user cannot be changed, and it cannot be deleted.” It does offer Duplicate, Test Connection and favourites.By design
  • On Free, saving (or duplicating and saving) a second connection of your own opens the Pro wall. The local engine, provider accounts and the in-memory connections from Open in Database (Upstash, DigitalOcean) don't count. Opening a PlanetScale branch, and Open… and Paste in Sharing, obey the same limit.Pro
Connections list with Local PostgreSQL first and cloud databases below
Connections — the local engine first, then your cloud accounts

New Connection and Edit Connection

The form for servers and for provider types you want to enter by hand. It opens on the Neon PostgreSQL type.

  1. 1In My Connections, tap + (New Connection).
  2. 2Paste a URL in Connection String and tap Parse Connection String. It understands postgres://, postgresql://, mysql://, mariadb://, libsql://, turso://, redis://, rediss://, mongodb:// and mongodb+srv://, with or without a jdbc: prefix; it decodes escapes such as %40, IPv6 hosts and MongoDB replica lists. rediss, mongodb+srv and libsql switch TLS on.
  3. 3Or fill Connection Name, Database Type, Host, Port, Database (for Redis, the index of SELECT), Username and Password.
  4. 4Under Appearance, pick a Color (None, Production, Staging, Development, Testing, Custom, Local) and a Group.
  5. 5Set SSL / TLS and, if you need it, SSH Tunnel (both below).
  6. 6Tap Test Connection. The result stays on screen under Last test, with the server's Answer and, if it worked, the Latency.
  7. 7Tap Save. The password goes to Android's encrypted storage and the connection file never holds it. When you edit a connection, leave Password empty to keep the saved one.

You can

  • The Database Type selector offers PostgreSQL (Local) (only where the engine ships), PostgreSQL, MySQL / MariaDB, Neon PostgreSQL, Supabase, PlanetScale MySQL, MongoDB Atlas, Turso SQLite, Upstash Redis, Redis and MongoDB. Cloudflare D1 and Cloud Firestore aren't in the selector: they arrive through their account.
  • Test Connection really tests: the local engine with SELECT version(); PostgreSQL, MySQL and PlanetScale with the version and the latency (“Connected — …”); Neon and Supabase by listing projects (“Connected — N projects”); MongoDB and Redis with a real ping, TLS and authentication included.

You can't, and why

  • Turso, Upstash, Atlas and D1 can't be tested from the form: “… cannot be tested from the app yet (no driver).”Not yet
  • On Free, Save on a second connection opens the Pro wall.Pro

TLS

Use TLS is under SSL / TLS. On PostgreSQL and MySQL / MariaDB, once it is on, the form offers two modes and starts on Verify server.

You can

  • Verify server: the server certificate is checked against the authorities your phone trusts, so a certificate from a public CA works with no file. If your server uses its own certificate, pick its CA with Choose CA certificate… (the file is copied to the app's private storage).
  • Verify Hostname (on by default) also checks the host name; turned off, only the CA is checked.
  • Encrypt only (no verification): encrypts the traffic without checking who answers. A red warning says someone on the same network could impersonate your server; use it only for a self-signed certificate.

You can't, and why

  • The form doesn't offer Disable, Allow or Prefer. A connection saved with an older mode shows that mode as an extra chip until you pick another.By design
  • On Redis and MongoDB, Use TLS always validates the certificate: there is no Encrypt-only choice.By design

SSH tunnel

SSH Tunnel → Use SSH tunnel reaches a database through a jump host: SSH Host, SSH Port, SSH User and a Password or a Private Key (Choose private key…).

You can

  • The tunnel forwards a local port to the database as the jump host sees it, so the database host and port you typed are the ones the jump host reaches.
  • The first time you reach a jump host the app shows “First time on this server. Fingerprint: …” and saves it. If the key changes later, “The SSH server key has changed. Connection stopped: the server may have been rebuilt, or someone may be in the middle.”, and nothing is sent.

You can't, and why

  • Only PostgreSQL and MySQL / MariaDB use the tunnel. The switch is drawn on every type's form, but on MongoDB, Redis, Neon and the others it has no effect.Not yet
  • Private keys with a passphrase don't work: the form has no passphrase field.By design
  • There is no SSH agent on Android, and only a single local port forward: no chained jumps.By design

Connection types

What opening each type does once you have connected it.

TypeWhat happens
Neon PostgreSQLPick a project. SQL runs over JDBC with full certificate checks when the app can read the project's connection from your account, and over Neon's HTTP API otherwise (“No direct connection to this Neon project — running over its HTTP API instead. Multi-statement transactions and a real EXPLAIN ANALYZE aren't available this way.”). SQL works on projects with the default neondb database and neondb_owner role.
SupabasePick a project; SQL goes through the API across every schema (Schema chips appear when there is more than one). The API doesn't give the database password, so Use a direct connection on the project screen opens the form filled with the pooler's host, port and user: type the password once and save it as an ordinary PostgreSQL connection.
PlanetScale MySQLYour account lists databases and Branches. Tapping a branch creates a branch password in your PlanetScale account and opens the branch as a MySQL connection with full certificate checks. On Free, a branch you have not opened yet counts as a connection of your own: with one already saved, the tap opens the Database Pro window and no password is created. Deleting that connection revokes the password; if revoking fails the app tells you to do it in the PlanetScale dashboard.
Turso SQLiteYour account lists databases; SQL goes over Turso's HTTP API.
Cloudflare D1Your account lists databases (D1 is always in the list) and opens straight on its tables; SQL goes over D1's API.
MongoDB AtlasYour account lists clusters. Choosing one opens the form with the SRV host filled in and you type the database user and password (Atlas doesn't hand them over). A mongodb+srv:// host is resolved with DNS over HTTPS against dns.google, falling back to cloudflare-dns.com.
Upstash RedisYour account lists databases; opening one connects as a real Redis database, or through REST when Upstash's API gives no Redis password. The connection lives in memory.
MongoDB, Redis, Cloud FirestoreTheir browsers and tools are in Database tools.

Tables and data

Tap a table to open it. Pages hold 100 rows, ordered by the primary key, so a row you edit stays where it was.

The table list

The tables and views of the open connection. Open it by tapping a connection, or from Tools → Tables.

You can

  • Search with Search tables…. The list has Tables (each with “~N rows · size”, the ~ marking an estimated count, and a System badge when it applies) and Views; PlanetScale adds Branches and Supabase, when there is more than one schema, Schema chips.
  • Tap a table or view to open its data. The ⋮ of a row offers Data, Structure, Export and favourites.
  • Tap + (Create Table) to open the table form.
  • The ⋮ of the list has Import CSV (it opens the import preview, which accepts CSV, TSV, JSON, NDJSON, SQL and XLSX; see Database tools) and, on the local engine only, Import from Clipboard and Schema Diff.

You can't, and why

  • Create Table is offered on the local engine, PostgreSQL servers and MySQL servers (and opened PlanetScale branches); not on Neon, Supabase, Turso, D1 or the PlanetScale account. There, run CREATE TABLE in the console.By design
  • On Free, with 4 tables in the connection, Create Table carries a Pro badge, and creating a fifth table (the form, importing with “Create table”, or a CREATE TABLE in the console) opens the Pro wall.Pro
  • MySQL / MariaDB doesn't list indexes, foreign keys or triggers (“… does not expose index metadata.”), and its row counts are the catalog's estimate.By design

The data viewer

The header shows the table; the subtitle, database · connection. The row count is computed once per table and set of filters.

You can

  • The top bar has Filter, Sort, Columns, Views, a refresh icon, the range (1-100 of 240, or Page N when the total is unknown) and Previous / Next.
  • Tap a column header to sort; long-press it for Freeze column / Unfreeze column, Fit widths, Reset widths and Compact / Comfortable rows.
  • Long-press a cell: if it is not part of the primary key you edit it; if it is, you start selecting rows. Tap a row to open Row Detail.
  • The ⋮ of the header has Insert Row, Add column, Table Detail and Export.
  • Insert Row opens a form with one field per column, each labelled with its name, its type and PK when it is a key. Leave a field empty and the column keeps its default (or NULL, or its auto-increment). Stage row queues the INSERT (at least one field must be filled, or the app says so) and Apply runs it. It works on a table without a primary key too.

You can't, and why

  • Edits and deletes need a usable primary key (and no primary key set to NULL in the row); otherwise the app can't identify rows safely and applies nothing. Insert Row needs none.By design
  • The primary key isn't edited cell by cell: a long-press on it selects the row.By design
  • On Neon, Supabase, Turso and D1 with Read-only on, edits, deletes and Drop / Truncate / Rename are blocked: “Read-only is on for this database, so nothing was changed. Turn it off above the SQL console editor to make changes.”By design
  • Without a total count (Supabase, or a COUNT(*) that fails) the bar says Page N and Next only advances if the page came full.Third party
The customers table with Filter, Sort, Columns and the page range
A table — filters, sort, columns and pages in one row
Filter sheet with column, operator and value fields
Filters run on the server, not just on screen

Filter

A filter narrows what the database returns, not just what you see: filters combine with AND and run on the server as a WHERE.

You can

  • Pick Select Column, an Operator (Change) among =, !=, >, <, >=, <=, LIKE, NOT LIKE, IS NULL, IS NOT NULL, IN and BETWEEN, type a Value and tap Add Filter.
  • The Active list has Remove filter, and Clear All empties it. IN takes comma-separated values; the value is compared as quoted text; IS NULL and IS NOT NULL need no value.

You can't, and why

  • BETWEEN is in the operator list but the sheet has a single value field, with no From / To: it produces BETWEEN 'x' AND ''. Use two filters, >= and <=.​Not yet

Columns

Show, hide and format the columns of this table.

You can

  • Switch each column on or off, or tap Show All.
  • Give a column a Format: No format, Stars, Progress Bar, Boolean, Link or Color.
  • A column masked by a rule (see Database tools) shows a lock; Show in clear reveals it for the session, and asks for your fingerprint when the biometric lock is on.

You can't, and why

—

Saved views

Views keeps a way of looking at a table.

You can

  • Save current view with a View name: it stores the filters, the sort order, the visible columns, the widths and the frozen columns for this connection and table.
  • Apply a view with a tap (Everything, unfiltered clears them) or Delete it.

You can't, and why

  • Saved views stay on this device and account: Sharing exports connections and saved queries, not views.By design

Edit cells and apply changes

Edits wait in a queue until you apply them.

You can

  • Long-press a cell that isn't part of the primary key, change the Value or switch NULL on, and tap Save. The cell is highlighted and a bar appears at the bottom with “N changes”.
  • See SQL shows the exact statements (UPDATE … SET col = value WHERE <every primary-key column>), Discard drops them and Apply runs them.

You can't, and why

  • Apply runs the statements one by one and stops at the first error, with no transaction: “Applied %1$d of %2$d: …”. The ones before the error stay applied.By design
  • The pending SQL can't be edited, only applied or discarded.By design

Row detail

Tap a row (when no selection is active). On a landscape tablet it opens as a pane next to the grid instead of replacing it.

You can

  • Read the row's primary key (or “Row N”) and tap Copy JSON to copy every value as text or null.
  • Edit one field per column, each labelled with its type and with PK, FK, NOT NULL badges, a NULL switch on nullable columns and a multi-line monospaced box for JSON.
  • The footer says “No changes” or “N changes”; Save queues only the fields you changed and applies them.

You can't, and why

  • There is no previous / next row navigation and no delete from here; without a usable primary key it doesn't save.By design

Select rows

Long-press a cell of the primary key column to start selecting.

You can

  • Tick rows with the checkboxes; the bar says “N selected” and has Clear.
  • Copy As copies the rows to the clipboard as CSV, TSV, JSON, NDJSON, SQL (INSERT), SQL (full) or Markdown.
  • Export offers the same formats plus Excel (XLSX), writes a file and opens the system share sheet.
  • Delete queues one DELETE … WHERE <primary key> per row, goes through safe mode and waits for Apply.

You can't, and why

  • Export here shares a file and doesn't ask for a destination; to choose a folder, use ⋮ → Export.​By design
Row detail form for id = 2 with typed fields and NULL switches
Row detail — typed fields and a real NULL switch
Three selected rows with Copy As, Export and Delete in the bottom bar
Long-press the key column to select rows

Add a column

⋮ → Add column opens New column.

You can

  • Fill Name, a type (the same 15 as in Create Table), the NN and UQ chips and a Default; a preview shows name TYPE NOT NULL UNIQUE.
  • Tap Add column to run ALTER TABLE … ADD COLUMN in the connection's dialect.

You can't, and why

  • On a table that has rows, a NOT NULL column needs a default, otherwise the button is disabled with “The table already has N rows. A NOT NULL column needs a default value — otherwise the engine has nothing to put in them.”By design
  • There are no PK or AI chips in this form, only NN and UQ.​By design

Table detail

⋮ → Table Detail in the viewer, or Structure on a row of the table list.

You can

  • Read five tabs: columns (type, PK / FK / NOT NULL, Default, References), Indexes, Keys (Primary key and Foreign keys), Triggers and DDL, with Copy DDL.
  • Use the Danger Zone: Rename, Truncate and Drop Table. Each asks for confirmation and goes through safe mode. On SQLite engines (Turso, D1) truncating runs DELETE FROM.

You can't, and why

  • When an engine doesn't expose indexes, keys, triggers or the DDL, the tab says so (“This engine does not return the DDL of a table.”) instead of showing an empty list.By design
  • You can't edit indexes, keys or triggers from here.By design
  • On cloud databases, Read-only blocks Drop, Truncate and Rename.By design

Create a table

Create Table in the table list, or Tools → New table.

You can

  • Type a Table Name. For each column set a Name, a type (SMALLINT, INTEGER, BIGINT, REAL, DECIMAL(p,s), CHAR(n), VARCHAR(n), TEXT, BLOB, BOOLEAN, DATE, DATETIME, TIMESTAMP, JSON or UUID), the PK, AI, NN and UQ chips and a Default. Add and remove columns freely.
  • Tap Create to run CREATE TABLE IF NOT EXISTS in the connection's dialect (SERIAL / BIGSERIAL and BYTEA on PostgreSQL, AUTO_INCREMENT and CHAR(36) for UUID on MySQL). The list reloads.

You can't, and why

  • The form has no foreign keys, indexes or CHECK constraints, only per-column flags.By design
  • On Free, with 4 tables, Create opens the Pro wall.Pro

Export a table

⋮ → Export, the ⋮ of a row in the table list, Tools → Export (only with a table open), or Export under console results.

You can

  • Choose a Format (CSV, TSV, JSON, NDJSON, SQL (INSERT), SQL (full), Markdown or Excel (XLSX)) and, when filters are on, Rows: Filtered rows (N) or Whole table.
  • Tap Save to… and pick where it goes. “N rows written” counts up. A table is read in batches of 1,000 rows and written row by row, so there is no size limit.

You can't, and why

  • Exporting a console result writes only the rows on screen (at most 500) and doesn't run the query again.By design
  • A table without a single-column primary key is read with LIMIT/OFFSET, so writes during the export can skew it; a table without a primary key has no guaranteed order.By design

SQL console

Open it from Tools → SQL console. It appears for connections that run SQL: the local engine, your PostgreSQL and MySQL servers, Neon, Supabase, opened PlanetScale branches, Turso and Cloudflare D1. If a table is open and the editor is empty, it starts with SELECT * FROM <table> LIMIT 50.

The editor

One editor for every dialect.

You can

  • Line numbers and syntax highlighting in the connection's dialect (PostgreSQL, MySQL or SQLite). Autocorrect and automatic capitals are off.
  • Undo, Redo, Format and AI in the toolbar; the ⋮ menu has New Tab, Query History, Saved Queries, Query Parameters (only when the query has parameters) and Smaller text / Larger text.
  • Suggestions appear as chips from the second character, ten at most: up to 5 keywords, 5 tables, 3 views, 5 columns of the open table and 3 functions.
  • With the keyboard open, a key row sits above it: fx (switches between words and up to 24 functions of the dialect), the symbols ( ) , ; = * ' " < > . :, eleven words (SELECT, FROM, WHERE, JOIN, ON, GROUP BY, ORDER BY, LIMIT, INSERT, UPDATE, DELETE) and Run fixed at the right.
  • The layout adapts: a Editor | Results switch on a portrait phone, two columns with a draggable divider (20–80 %, double-tap for 50/50) on a landscape phone, 30 / 50 / 70 % rows on a portrait tablet, and columns with a tab strip on a landscape tablet.

You can't, and why

  • MongoDB, Redis, Upstash and Firestore have no SQL console: their screen is the connection itself, and the tool isn't offered.By design

Run, stop and limits

What happens when you tap Run.

You can

  • Run runs the whole editor (only the selection with Ctrl+Shift+Enter). While it runs, Results says “Running · N s” and Run becomes Stop.
  • A plain SELECT without LIMIT gets LIMIT 500 (not added to WITH …, to COUNT / SUM / AVG / MIN / MAX selects, or when the text already contains LIMIT). Remote connections keep at most 500 rows. A query is cut after 30 s on the local engine; on remote servers the socket waits 60 s (plus 10 s to connect).
  • Statements that return no rows say what happened: “Table created · 53 ms”, “3 rows affected · 8 ms”, “Statement executed · …”.
  • Stop cancels the query on the server on the local engine, your PostgreSQL servers and MySQL: “Query cancelled on the server.”
  • Each run goes to the history (500 entries) and the audit log (1,000), and reloads the table list if it created or dropped something.

You can't, and why

  • On Neon, Supabase, Turso and D1, Stop only stops waiting: “Stopped waiting for the query. The server may still be running it.”By design
  • Each run opens its own connection, so BEGIN in one run and COMMIT in the next don't form a transaction.By design
SQL console with a formatted query joining customers and orders
SQL console — highlighting, Format and AI in the toolbar
Results: 12 rows with name and email columns and the result actions below
Results — row count, time, and what to do with them

Safe mode

Before running a dangerous statement the console shows Dangerous Operation (“This will execute a … operation”) with the exact SQL and “Estimated affected rows”. Nothing runs until you tap Execute Anyway; Cancel leaves it.

You can

  • It triggers on DELETE or UPDATE without WHERE, DROP TABLE, DROP VIEW, DROP INDEX, a DELETE inside a CTE without WHERE and any text with TRUNCATE.
  • On MySQL / MariaDB / PlanetScale the list is longer: DROP DATABASE, ALTER TABLE … DROP, RENAME TABLE, user and privilege management (GRANT…), KILL, FLUSH, RESET, LOAD DATA, INTO OUTFILE, SET GLOBAL, SHUTDOWN, REPLACE INTO, plugins and LOAD_FILE().
  • Drop, Truncate and Rename of a table, deleting rows and deleting a database from the engine screen go through it too.

You can't, and why

  • Safe mode has no switch: it is always on.By design

Parameters

Named parameters turn a query into a template.

  1. 1Write named parameters in the query: SELECT * FROM orders WHERE status = :status AND total > :min;
  2. 2Tap Run. Instead of running, the console opens Query Parameters with one field per name.
  3. 3Fill the values and tap Run. Values are sent as quoted text. The editor keeps the query with its :names, and so does the history.

You can't, and why

  • Only :name asks for a value; @name and $1 are recognised but don't prompt. There are no types: every value goes as text.By design

Tabs

Several queries at once.

You can

  • ⋮ → New Tab (on a landscape tablet, the + of the strip). On a phone the strip appears with two or more tabs.
  • Tap a tab to switch, ✕ to close, long-press to rename. Each tab keeps its SQL and its result, and tabs survive closing the app. There is always at least one.

You can't, and why

  • On Free, the third tab opens the Pro wall.Pro

What to do with the results

A row of actions sits under the result grid, and an icon in the header.

ActionWhat it does
Copy AsCSV, TSV, JSON, NDJSON, SQL (INSERT), SQL (full) or Markdown, to the clipboard. Identifiers are quoted the way the engine of the connection expects (no backticks on PostgreSQL).
ExportOpens Export with the rows on screen.
ChartsA chart from the result (it needs two or more columns). In Database tools.
ExplainOpens the execution plan of the query in the editor.
Save QuerySaves it with a Query Name.
Add to dashboard (header icon)Saves the query as a dashboard widget once it has run. In Database tools.

You can't, and why

  • On Free, Save Query opens the Pro wall once you have 5 saved queries.Pro

History and saved queries

⋮ → Query History or Saved Queries opens a sheet in the console.

You can

  • Pick an entry to load it into the editor.
  • Save the query with a Query Name, Delete entries and move saved queries to folders (No folder).

You can't, and why

  • 5 saved queries on Free; the sixth opens the Pro wall.Pro
  • The history keeps the last 500 entries.By design

Write SQL with AI

The assistant lives inside the editor, above your code. It writes a proposal; nothing reaches the editor until you accept it, and nothing runs on its own.

You can

  • Tap AI. A line with Describe the query you need… opens above the code; describe the query in your own words and tap Generate. A shortcut: write the request as a comment on the cursor's line, like -- customers who ordered this month, and tap AI.
  • Read the proposal. Above it is the origin (the provider and model, or Offline — generated by rules, not a model), the Explanation, and arrows to move between alternatives; Regenerate asks again.
  • Accept puts it in the editor, replacing the selection or on a new line below the cursor. Discard leaves the editor as it was. A destructive proposal carries “Destructive operation — review carefully”.

You can't, and why

  • With no provider connected the assistant falls back to a built-in rule generator for simple queries and says why: “No AI provider is connected. Connect one in AI settings to have a model write the query.” If the provider takes more than 90 seconds: “The AI provider didn't answer within 90 seconds, so no model was used.”Needs network
  • If the model answers something that isn't SQL you see its answer under “The model didn't return SQL”, with no Accept button.By design
  • What it knows: the dialect and the names of up to 40 tables and views with their columns (6,000 characters at most), so it writes ciudad when the column is called ciudad. No row data is sent.
  • Which model: the one set for SQL assistant in the AI settings, your manual choice, or a fast model in Automatic mode.
  • Consent: the first time a provider is used, the app asks Send to …? before sending anything.

Cloud databases: Read-only, confirmation and fingerprint

On Neon, Supabase, Turso and Cloudflare D1 the console asks before it writes. A fixed row above the editor holds the Read-only switch (“Writes are blocked” / “Writes ask before running”).

You can

  • Read-only is on by default, per database (switching project turns it on again): only reads are sent. Running a write says “Read-only is on, so this write wasn't sent. Turn off Read-only above the editor to run it.”
  • With it off, every write opens “Write to …?” listing what it will do (creates a table, drops a table, empties a table, inserts rows, updates the matching rows, updates every row (no WHERE)…); Run confirms.
  • A destructive write (DROP, TRUNCATE, DELETE or UPDATE without WHERE…) is titled “Destructive write to …”, its button is Continue and it then asks for your fingerprint or device PIN (“Confirm destructive write”). A phone with no screen lock continues with the confirmation already given.
  • The same switch governs the edits in the data grid, Drop / Truncate / Rename and the measured plan of a write.

You can't, and why

  • The AI chat respects the switch and can't run destructive writes on a cloud database: it hands you the SQL to run from the SQL console.By design

Execution plan

Tools → Execution plan, or Explain under the results. It needs a query in the editor: “Write a query first — the plan describes how it would run.”

You can

  • See the plan as a tree with a cost bar per step and the most expensive step in red, labelled “Estimated by the planner — the query was not run” or “Measured — the query was actually run”, with “Planning: N ms” and “Execution: N ms”. Tap a step for Step detail (step, table, total cost, own cost, rows, row width). The refresh icon asks again and keeps whether it was measured.
  • Tap Run it for real (“Runs the query and measures every step instead of estimating it.”) on the PostgreSQL dialect: the local engine, Neon, Supabase and your PostgreSQL servers. If the statement isn't read-only it asks “Run this statement?”: “This is not a read-only statement, and measuring it means running it: it will change your data.”
  • Read Index suggestions when there is a sequential scan with a filter, on at least 100 estimated rows (the minimum is skipped when the engine gives no estimate); each has Copy. “Nothing is created: copy the statement and decide in the console.”
  • Tap Explain with AI to have your model explain the plan. It sends the engine, the query and the plan, and says “Written by … from the plan JSON. Check it before acting on it.” The first time per provider it asks Send to …?

You can't, and why

  • MySQL / MariaDB / PlanetScale give an estimated plan only, and SQLite (Turso, D1) a tree without costs (“This engine does not publish costs: it says what it does, not what it costs.”). Run it for real isn't drawn there.By design
  • On a cloud database, Run it for real on a write obeys Read-only and asks for your fingerprint if it destroys data.By design
  • On a Neon project reached over HTTP there is no real EXPLAIN ANALYZE.​Third party
  • It never creates an index; it only copies the CREATE INDEX.​By design
Measured execution plan tree with an index suggestion
Execution plan, measured: the red step is the expensive one

Schema: tree, ER, designer and compare

Tables, relations and design. The tree, the ER diagram, import and compare work on any connection that runs SQL and has tables.

Schema tree

Tools → Schema tree. On a landscape tablet the same tree hangs from the active connection in the side panel.

You can

  • Expand the connection's name, then Tables (N) and each table: its columns (name: type, with PK on the key) and, where listed, its indexes (name (columns)); Views (N) holds the views. A table says “(N rows)” when the count is known. The labels of this tree are in English in every language.
  • Tap a table or a column to open that table's data.
  • Indexes are listed on PostgreSQL, Neon, Supabase, Turso and D1; not on MySQL / MariaDB.

You can't, and why

  • The screen also draws Functions / Procedures, Sequences, Enums / Custom Types and Dependencies sections, but they are never filled.Not yet
  • Triggers are left out of the tree on purpose.By design

ER diagram

Tools → ER diagram. It draws the tables and relations of any SQL connection with tables: the local engine and your PostgreSQL and MySQL servers through their drivers, and Neon, Supabase, Turso and D1 by reading their catalog with SQL.

You can

  • Pinch and drag the canvas. The header says “N tables · M relationships”; zoomed out, “Columns hidden — zoom in to read them”. Tap a table to open its data.
  • Use the toolbar: Edit as design (copies the schema into the designer), Select Tables (Select All / Clear; none selected means all), Fit to screen, Auto-arrange, zoom in and out, Color by Schema, Minimap and Export Diagram (a PNG at 2× with the theme's background; the file picker proposes er-diagram.png).

You can't, and why

  • MongoDB, Redis, Upstash and Firestore have no ER diagram, and it never falls back to PocketCode's own storage.By design
  • Composite foreign keys are drawn as several single-column relations.Not yet
  • The diagram can't be edited in place: use Edit as design.​By design
ER diagram with customers, orders and subscribers
ER diagram of the local database

Schema designer

From the start screen (Schema Designer, no connection needed) or Tools → Schema designer. Projects are JSON files in the app's private storage.

You can

  • The project list has Search schemas…, cards with “N tables” and “N relations”, a ⋮ with Duplicate and Delete, and New Schema.
  • The wizard New Schema Project has three steps: Project Details (Project Name, description), Target Database (MySQL, PostgreSQL, SQLite, MariaDB, SQL Server or MongoDB) and Start From Template: Empty Schema or Blog (6 tables), E-Commerce (8), Social Network (7), SaaS Platform (7), Chat App (5) or Project Management (7). Back, Continue, Create Project.
  • In the editor, drag tables, Zoom to fit, Add table, Undo / Redo, and draw a relation by tapping a source column and then the target table (1:1, 1:N, N:M; No Action, Cascade, Set Null, Set Default or Restrict). The project name is editable and a chip shows the target engine.
  • The table editor sheet renames the table, sets its colour and adds columns: name, a type (Select Column Type, with suggestions and a reserved-word warning), Constraints (Primary Key, Auto Inc, Not Null, Unique, Indexed), Length, Precision, Scale, Default, Comment and Add FK.
  • Apply to … opens the console with the script, without running it, every destructive statement marked -- ⚠: “Script opened in the console: N statement(s), M marked ⚠. Nothing has been run”.

You can't, and why

  • Apply to … never runs the script: it is the most destructive operation in the module, so it passes through the console's safe mode and the plan's table limit. It needs a SQL connection (“Open a SQL connection to apply this design”) and at least one table.By design
  • The designer has no Pro gate of its own, but on Free the script's CREATE TABLE statements hit the limit of 4 tables when you run them in the console.Pro
  • Projects stay on this device: they aren't synced between devices, and the MongoDB target only adapts column types.By design

Export Schema

Export in the schema editor opens Export Schema.

You can

  • Pick one of seven formats: SQL DDL, Room Entity, Prisma, TypeORM, Django, JSON Schema or DBML, and tap Generate ….
  • Read the Generated Output (“N lines”), then Copy All (“Copied!”) or Share it as text.

You can't, and why

  • It generates text only and touches no database: use Apply to … to get a script in the console.By design

Import schema

Tools → Import schema (SQL connection with at least one table), or Edit as design in the ER diagram.

You can

  • Bring the open database's tables, columns, indexes and foreign keys into the designer. Afterwards it lists what could not be imported (“N thing(s) could not be imported”).

You can't, and why

  • Engines without SQL have no schema to import (“… does not speak SQL, so it has no schema to import”).By design
  • On SQLite (Turso, D1) indexes aren't imported, and composite foreign keys arrive as several single-column ones.Not yet

Compare schemas

Tools → Compare schemas, or the ⋮ of the table list → Schema Diff (local engine). It is a Pro tool. On a PlanetScale project the same entry shows the diff of the last deploy request and is free (see Database tools).

You can

  • Tap Save Snapshot (it keeps the schema for this connection: “Schema snapshot saved (N tables)”), change the schema, then Run Diff.
  • Read Added Tables, Removed Tables and Modified Tables (+ name: type and − name for columns).
  • Tap Generate Migration to write the SQL into the console without running it, quoted for the engine, with a full CREATE TABLE for new tables and the type and nullability changes.

You can't, and why

  • On Free, opening it from Tools or the menu, or tapping Run Diff, opens the Pro wall.Pro
  • It compares tables and columns (name, type, nullability), not indexes, foreign keys, views or sequences.By design
  • The screen lists only added and removed columns; a column whose type or nullability changed isn't shown there, although it is in the migration.Not yet

Backups

Tools → Backups (titled Backup & Restore) is offered on every connection, but only the local PostgreSQL can be backed up. It has three tabs: Create, History and Schedule.

Create

A backup is written to the app's storage; Your files moves dumps in and out.

You can

  • Pick the Backup Method (pg_dump or SQL Dump), add a Note (optional) and tap Start Backup (“Written to …”).
  • Under Your files, Save to… writes a dump straight to a document you choose, and Import backup… brings in a .sql or a pg_dump -Fc file: the method comes from the PGDMP signature, not from the extension. Saving and importing go through the system file picker, so the file ends up where you choose and survives uninstalling the app.

You can't, and why

  • Other connections say why: “<engine> runs on a server, so its backups belong to that provider. PocketCode can only back up databases stored on this device.” or “<engine> is not a SQL database — export its collections/keys instead.”By design
  • There are no cloud destinations (Drive, Firebase): the backups folder is private to the app, and only what Save to… or Export writes outside it survives an uninstall.By design

History and restore

Every backup, newest first.

You can

  • Each row shows the date, the method, “N tables · size” and the badges Imported and Scheduled, with Restore, Export and Delete. With nothing yet it says “No backups yet”; after a failed scheduled run, “The last backup failed”.
  • Restore asks “Overwrite the database?”. A copy of the current database is saved first (pre_restore_<time>.dump), so it can be undone; the result says “Restored — … Previous database kept as …”. A PGDMP dump is restored with pg_restore; a text dump is replayed over JDBC.

You can't, and why

  • If the safety copy fails, nothing is restored.By design
Backup History tab with a pg_dump backup and restore, export and delete buttons
Backups — restore takes a safety copy first

Schedule

A Pro switch for automatic backups.

You can

  • Turn Scheduled backups on and set the Frequency (Every hour, Every 6 hours, Every 12 hours, Daily or Weekly), the Time of day (3 by default) and Max backups to keep (7 by default). It runs in the background with WorkManager and is skipped while the battery or storage is low.

You can't, and why

  • Turning the schedule on or changing it is Pro (SCHEDULED_BACKUP). Creating, restoring, exporting, importing and deleting backups are free.Pro
  • There is no foreground service and no exact alarm: the system may postpone or kill the run, and the result is recorded in the history.Google Play
  • A scheduled run copies the local PostgreSQL (the last database you opened) only if the engine is running at that moment; it never starts it. It also always copies PocketCode's own internal app database, in a separate store whose history this screen doesn't show.By design

Tools

The grid icon opens Tools: 25 tools in six sections, with a search box and a Frequent row. On a landscape tablet it is a permanent rail (280 dp, folded to 72 dp). What doesn't apply to the open connection is hidden, not greyed out: with MongoDB, Redis, Upstash or Firestore only nine tools appear (Tables, Dashboards, Schema designer, Export, Backups, Monitor, Security, Audit log and Sharing).

SectionTools
ExploreTables, Schema tree, ER diagram — on this page.
QuerySQL console and Execution plan — on this page. Query history, Saved queries, Charts and Dashboards — in Database tools.
DesignSchema designer, New table, Compare schemas (Pro) and Import schema — on this page.
DataExport and Backups — on this page. Test data and Import — in Database tools.
ServerEngine settings, Extensions, Server log and New database (Pro badge on Free) — on this page. Monitor — in Database tools.
SecuritySecurity, Audit log and Sharing — in Database tools.

Start and Stop of the engine aren't in the catalog: they live on the engine card and the engine screen.

Monitoring, security, audit, dashboards, charts, test data, import, history, saved queries and sharing are covered in Database tools.

From the AI chat

The AI chat can use your databases without the module being open. Ask it in plain words (“what tables do I have?”, “how many orders were refunded?”) and it calls these tools:

ToolWhat it does
db_list_connectionsLists the local engine and your saved connections, and the projects of the cloud services you connected as service/project.
db_list_tablesTable names of a database.
db_schemaColumns and types of one table or all of them.
db_queryRuns a read-only statement: SELECT, WITH, EXPLAIN, SHOW or DESCRIBE. Anything that writes is refused.
db_executeRuns a statement that changes data or schema. It asks for your approval first, unless the chat is in Full access and Ask before acting outside this device is turned off.
  • The tools act on the connection you opened last, or on the local engine when you have nothing else set up. The model can name another connection from the list.
  • On a cloud database the chat respects the Read-only switch of the console and doesn't run destructive writes: it gives you the SQL to run from the SQL console.
  • Query results sent to the model are real rows (at most 200 for SQL). Masking rules don't apply to the chat. A sixth read-only tool, db_inspect, reads policies, schema health and saved SQL: see Database tools.

Free and Pro

Everything on this page is available on the free plan, with these limits (Pro lifts them):

LimitFreePro
Saved connections of your own1 (the local engine, provider accounts and the in-memory connections from Open in Database do not count; the ones added with Open… or Paste in Sharing, and opened PlanetScale branches, do)Unlimited
Saved queries5Unlimited
Console tabs2Unlimited
Databases in the local engine1 (postgres)Unlimited
Tables per connection4 (any engine; creating, importing or running CREATE TABLE counts)Unlimited
Compare schemas (SCHEMA_DIFF)Opens the Pro wallIncluded
Scheduled backups (SCHEDULED_BACKUP)Opens the Pro wall. Creating, restoring, exporting and importing backups are free.Included
Every limit above opens the same wall, titled Database Pro, whichever you hit. It says “Unlock more databases, tables and saved queries, schema comparison and scheduled backups.”, lists More databases, tables and saved queries, Schema comparison (Schema Diff) and Automatic scheduled backups, and has Continue with basic plan, which closes it, and Unlock DB Pro, which opens the paywall. The dashboards are free: they have no limit.

The rest has no plan limit: the SSH tunnel, every import and export format, the ER diagram, execution plans (including Run it for real), the AI features, writing to your cloud databases, manual backups and restore, the engine screen, monitoring, security, audit and dashboards.

Prices and the full Free / Pro matrix are in Plans & Pricing.

Keyboard shortcuts

Only with a physical keyboard, on a tablet in landscape, inside the console:

KeysAction
Ctrl+EnterRun
Ctrl+Shift+EnterRun the selection
Ctrl+T / Ctrl+WNew tab / close tab
Ctrl+SSave query
Ctrl+/Comment or uncomment the selected lines

Privacy and security

  • No PocketCode server: data goes from the app to the local engine, to your host (or its SSH jump host) or to the provider's API. Two details: a mongodb+srv:// cluster name is resolved with DNS over HTTPS against dns.google (then cloudflare-dns.com), and the AI features call the provider you chose. Your data never goes through a PocketCode server. Only with Cloud Sync on and Connections (SSH/DB) ticked do the metadata of your connections (name, host, port, engine and group; never user, password or TLS) go to your PocketCode account.
  • Where things live: connections, saved queries and folders, history (500), audit log (1,000), console tabs, saved views, schema snapshots, SSH host fingerprints and favourites are JSON files in the app's private storage, one set per account. Schema projects are separate files in the same private storage.
  • Passwords live in Android's encrypted storage, per account. The connection file keeps host, port, database and user, never the password. The app has Android cloud backup turned off.
  • The local engine accepts TCP only from the phone itself and always with a password (SCRAM-SHA-256). Its password is random and stored encrypted; the engine refuses to start without one. The Unix socket is inside the app's private directory.
  • AI: nothing is sent to a provider before you accept its consent dialog. The SQL assistant sends the dialect and your table and column names (no rows); the plan explanation sends the query and its plan; the chat tools send the rows they read.
  • Analytics, when enabled: the module reports the engine type, how long a query took and how many rows it returned, the export format and row count, and an error category. Never the SQL, names or values.
  • Masking and the biometric lock are described in Database tools.

Limitations

What doesn't work, and why, so it doesn't catch you by surprise:

  • The local engine needs a 64-bit ARM phone. It isn't included on x86 builds (emulators, x86 Chromebooks).Device
  • Local MariaDB isn't included: the code exists but no MariaDB package ships, so it is never offered.Not yet
  • The engine isn't kept alive in the background; Android may stop it, and scheduled backups are WorkManager jobs the system can postpone.Google Play
  • No psql or pg_isready in the app (their readline library is GPL-3).By design
  • Scripts: the console sends the whole editor at once, and each run uses its own connection, so BEGIN in one run and COMMIT in the next don't form a transaction.By design
  • Grid edits are applied statement by statement. If one fails, the ones before it stay applied.By design
  • MySQL / MariaDB: no index, foreign key or trigger lists, estimated row counts, authentication with mysql_native_password and caching_sha2_password (the full path of the second only over TLS), not ed25519, and never LOAD DATA LOCAL INFILE.​By design
  • SSH tunnel: local port forwarding only, PostgreSQL and MySQL / MariaDB only, no agent, no chained jumps, no key with a passphrase.By design
  • The SSH switch is drawn on every type's form but does nothing outside PostgreSQL and MySQL / MariaDB.Not yet
  • Neon: SQL through the account runs on projects with the default neondb database and neondb_owner role.Third party
  • Supabase: its API doesn't give the database password, so a real PostgreSQL connection needs Use a direct connection and the password once.Third party
  • Provider accounts need network and the service connected in Settings → Integrations → Connected Services (or from the Backend Manager). A mongodb+srv:// host also needs DNS over HTTPS.Needs network
  • ER diagram, console and plans don't exist for MongoDB, Redis, Upstash or Firestore.By design
  • Measured plans (Run it for real) are PostgreSQL-dialect only; MySQL plans are estimates and SQLite plans have no costs.By design
  • Backups cover only the local PostgreSQL. Your servers and cloud databases keep their backups with their provider.By design
  • Safe mode has no switch: it is always on.By design
  • Filter operators: BETWEEN has a single value field.Not yet
  • Search Objects in the ⋮ menu of the table list doesn't show results yet.Not yet
  • The schema tree draws Functions, Sequences, Enums and Dependencies sections that stay empty.Not yet
  • Use in project: Reveal and Copy URL don't ask for the fingerprint even when the biometric lock is on.Not yet
  • Some texts are in English in every language: Running / Stopped on the engine card and the first-run steps (“Preparing…”, “Extracting…”, “Setting up…”, “Installing database…”, “Verifying…”, “Ready”).Not yet

Troubleshooting

The titles are the messages the app shows.

“PostgreSQL is not included in this build for your device.”

The phone isn't 64-bit ARM, so the local engine can't run. Everything else in the module works.

“Engine stopped” and “Start the local PostgreSQL engine to work with its tables.”

The engine is off. Tap Start on that screen, or on the engine card in the start screen.

The engine card says Stopped after I come back

Android stopped the app in the background. Tap Start; PostgreSQL recovers on its own if it was writing. With Durability on, at worst the last milliseconds of committed transactions may be missing.

echo $DATABASE_URL prints nothing in the terminal

Start the engine, then open a new terminal session. A session opened before the engine started doesn't see the variables, and SSH sessions never do.

“The local engine is stopped, so there is no connection to hand out. Start it and come back.”

Use in project needs the engine running. Start it, then reopen the sheet.

“… cannot be tested from the app yet (no driver).”

Test Connection has no test for Turso, Upstash, Atlas and Cloudflare D1. Open the account instead: if the connection is wrong you will see it there.

“The SSH server key has changed. Connection stopped…”

The jump host's fingerprint differs from the one saved the first time. If you rebuilt the server, that's expected; otherwise someone may be in the middle, so don't continue.

Test Connection fails on a PostgreSQL server over TLS

Verify server checks the certificate against the authorities your phone trusts. If your server uses its own certificate, pick its CA with Choose CA certificate…. With Encrypt only (no verification) the connection is encrypted without checking the certificate, and the screen warns you.

“Applied %1$d of %2$d: …”

A queued edit failed. The ones before it stay applied (there is no transaction). Read the error, fix it and apply the rest again.

“The table already has N rows. A NOT NULL column needs a default value…”

Add column is disabled until you give the NOT NULL column a Default: the existing rows need something to hold.

“No se pudieron aplicar los cambios: la tabla no tiene clave primaria utilizable…”

This message is always in Spanish. It means the table has no usable primary key (or a row has it set to NULL), so the app can't identify rows safely and applies nothing.

“Read-only is on, so this write wasn't sent. Turn off Read-only above the editor to run it.”

You are on a Neon, Supabase, Turso or D1 database. Switch Read-only off above the editor, then run again; it will ask you to confirm and, for destructive writes, for your fingerprint.

Dangerous Operation appears for a query I trust

Safe mode checks the text, not your intent. Read the SQL in the dialog and tap Execute Anyway.

“No AI provider is connected. Connect one in AI settings to have a model write the query.”

The proposal says Offline — generated by rules, not a model. Connect a provider in the AI settings (or pick a model for SQL assistant) and tap Regenerate.

“The model didn't return SQL”

The model answered with text that isn't SQL, so there is no Accept. Read its answer, pick another model or rephrase, and tap Regenerate.

“Write a query first — the plan describes how it would run.”

Execution plan needs a query in the console editor. Write one, then open the plan or tap Explain.

“pg_stat_statements is not active, so there is nothing measured to show.”

Turn on Statement statistics in the engine's Settings and save (it restarts the engine), then tap Activate in Health.

“<engine> runs on a server, so its backups belong to that provider.”

Only the local PostgreSQL can be backed up from the phone. For a server or cloud database use its provider's backups, or export its tables.

“The “postgres” database is the engine's maintenance database and cannot be deleted.”

Delete database never applies to postgres or the database you are connected to. Switch to another database first, if it's another one you want to delete.

“Stopped waiting for the query. The server may still be running it.”

On Neon, Supabase, Turso and D1 Stop can't cancel a query on the server; it only stops waiting. Check the provider if it was heavy.

A Database Pro wall appears when I add a connection, a tab, a table or a saved query

Free allows 1 connection, 5 saved queries, 2 console tabs, 1 local database and 4 tables per connection. The wall is the same for all of them; Opening a PlanetScale branch, and Open… or Paste in Sharing (see Database tools), stop at the same one connection. Pro removes the limits.