Is reading or writing the database an edge function? What's the difference between database calls, edge functions, and custom compute?
Is reading or writing the database an edge function? What's the difference between database calls, edge functions, and custom compute?
GET /api/database/records/{table}) and a typed SDK. Calling select or insert reads and writes the database directly, with nothing to deploy and nothing running. This is all you need for ordinary create/read/update/delete. See Database.Edge Function. Reach for one when the auto-generated API isn’t enough and you want your own server-side logic: a payment webhook, an auth hook, code that fires when a row is INSERTed / UPDATEd / DELETEd, or a scheduled job. The point is that it runs once per request or event and then exits. See Edge Functions.Custom Compute. Use this when you need a process that stays up, like a queue worker or an AI inference loop. An edge function can’t do this because it doesn’t run continuously. See Custom Compute.Quick rule: just moving data in and out? That’s the database (auto REST). Writing logic that runs and finishes? Edge function. Need something running all the time? Custom compute.How do I query a table in a schema other than `public`?
How do I query a table in a schema other than `public`?
public. You only have another schema if you created one yourself with CREATE SCHEMA (InsForge’s own internal schemas, like auth and storage, aren’t exposed to the data API, so .schema() and ?schema= can’t reach them; as project admin you can still read them with raw SQL, e.g. insforge db query or the dashboard SQL editor). Once you have one, you can read and write it from the dashboard, the REST API, the CLI, and the SDK.The examples below use a schema you created called my_schema.Dashboard. Open Database and use the schema selector at the top of the sidebar. Any schema you created is listed alongside public, and picking it browses that schema’s tables.REST API. The records endpoint takes the target schema either as a query param or as a PostgREST profile header. Reads use Accept-Profile, writes and RPC use Content-Profile:db query, just schema-qualify the table:.schema() before the query builder (supported by @insforge/sdk). It maps to the same Accept-Profile / Content-Profile header, so reads, writes, and RPC all route to the schema you name:anon and authenticated roles have no privileges on it until you grant them, no matter who owns the tables, so calls come back empty or permission-denied until you do. Grant each role you expose, then add RLS:How do I turn row-level security (RLS) on or off for a table?
How do I turn row-level security (RLS) on or off for a table?
POST /api/database/tables, or the SDK), RLS is enabled unless you explicitly pass rlsEnabled: false.There is no field to toggle RLS on the update-table-schema endpoint (PATCH /api/database/tables/{table}/schema) — it only handles columns, foreign keys, and renames. To change RLS on an existing table, run one SQL statement:run-raw-sql tool, or the raw SQL REST endpoint (POST /api/database/advance/rawsql/unrestricted).Does InsForge have a `service_role` key / `INSFORGE_SERVICE_ROLE_KEY`?
Does InsForge have a `service_role` key / `INSFORGE_SERVICE_ROLE_KEY`?
ik_), the full-access admin key. Every project has two keys:- Anon Key: public, for the browser. Requests run as the
anonrole, gated by RLS. This is the one that hitspermission denied for schema storage. - API Key: full-access admin key, server-only. Bypasses RLS.
npx @insforge/cli secrets get API_KEY.Use it from trusted server code through createAdminClient, never the browser:NEXT_PUBLIC_, VITE_, or PUBLIC_ prefix).Why did my project get paused, and how do I keep it from pausing?
Why did my project get paused, and how do I keep it from pausing?
- Inactivity. A free project is paused after 7 days with no requests. We email a heads-up first, and any request resets the 7-day clock.
- Usage limit. If your organization goes over the Free usage limits, its projects stay paused until you upgrade.
My project is paused. How do I restart it?
My project is paused. How do I restart it?
- You can restore a free project from the dashboard for up to 30 days after it pauses. After that it’s archived and you can only download the database backup and storage files (still no data loss).
- If it was paused because the organization hit its usage limit, Upgrade to Pro to restore it.
How do I authenticate the CLI without a browser?
How do I authenticate the CLI without a browser?
npx @insforge/cli login opens a browser to sign in. On a headless machine, a remote server, or CI, use a user API key instead. No browser needed.The quickest way is the setup prompt from the dashboard, which signs in and links the project for you:Open the Install page
Pick your coding agent
Copy the prompt
login --user-api-key with it. Add --json for machine-readable output.The key grants full access to your account, so keep it secret and rotate it if it leaks.What is FLY_API_TOKEN?
What is FLY_API_TOKEN?
FLY_API_TOKEN (a Fly API token from fly tokens create org) and FLY_ORG (your Fly org slug from fly orgs list) in your .env, then restart. Both are required, and until they’re set, compute endpoints return 503 COMPUTE_NOT_CONFIGURED.On InsForge Cloud you never touch this. Compute is managed for you, and the rest of the platform (database, auth, storage, edge functions) needs no Fly token at all.Can this assistant help with something specific to my own project?
Can this assistant help with something specific to my own project?
npx @insforge/cli diagnose. See Diagnostics & advisor.How do I get my database's Postgres connection string?
How do I get my database's Postgres connection string?
psql, a database GUI, an ORM (Prisma, Drizzle), or an external service like Better Auth that needs its own Postgres. Print it with the CLI:--json to get { "connectionURL": "..." } for scripts. The command works for cloud projects only — on a self-hosted instance Postgres is exposed directly by your docker-compose setup, so use the local Postgres credentials (the DATABASE_URL / POSTGRES_* values from your .env) instead.The string connects as the privileged postgres role, so it isn’t limited by row-level security and it embeds that role’s password. Treat it like a secret: keep it server-side and never ship it to the browser.How do I import or load an existing Postgres database into InsForge?
How do I import or load an existing Postgres database into InsForge?
pg_dump, pg_restore, and psql — connect to it directly, so an import is just a dump-then-restore. No special InsForge command is involved.- Dump your local (or other) database:
- Get your InsForge connection string (cloud projects only):
- Restore into InsForge:
- Pass
--no-ownerso restored objects are owned by thepostgresrole rather than roles that only exist in your source database. - The connection string connects as the privileged
postgresrole (it bypasses row-level security), so treat it as a secret and run these commands server-side only. - This works for cloud projects only. On a self-hosted instance, restore against your local Postgres credentials (the
DATABASE_URL/POSTGRES_*values from your.env) instead. - A restore writes into your live database and can overwrite existing objects. Take a manual backup first — see Database backups and restore.
--single-transactionruns the restore as one transaction, so if a statement fails (a conflicting object, a missing extension or role, a constraint error) the whole import rolls back instead of leaving the database half-restored.- Imported tables do not get InsForge’s managed access automatically. A raw restore skips the
anon/authenticatedgrants and row-level security InsForge applies, so imported tables are not reachable through the REST API or SDK — and any access rules from your source dump don’t carry InsForge’s RLS protection — until you grant access and add RLS policies for each table (see Database). If you’d rather version schema changes in git, see Database migrations.
How do I take down or remove a deployed site?
How do I take down or remove a deployed site?
deployments delete command and no dashboard action for it. Deployed sites are hosted externally, so even deleting your project (npx @insforge/cli projects delete --project <id>) tears down your backend resources — database, storage, and backend branches — but does not remove the hosted site.In practice this rarely matters. If you do need a deployed site taken down, ask the InsForge team in Discord.Two related actions that are not the same as removing a live site:- Cancel a build that’s still running:
npx @insforge/cli deployments cancel <id>stops an in-progress deployment; it does not take down a site that is already live. - Replace what’s live: redeploy over the same site with
npx @insforge/cli deployments deploy ./frontend— the newest ready deployment serves the URL.