External Database Access

Every basefyio project includes a dedicated database that you can access from any standard SQL client. Use pgAdmin, DBeaver, DataGrip, TablePlus, or a plain psql terminal — no vendor lock-in.

Finding Your Connection Details

Open your project in the basefyio dashboard, then go to Connection in the sidebar. You will see:

FieldDescription
HostExternal database hostname (e.g. db.basefyio.com)
PortConnection pooler port (default 6432)
DatabaseYour project's database name
UserDatabase username for your project
PasswordDatabase password (can be reset from the Connection page)
Connection URIFull connection string — copy and paste directly

pgAdmin

  1. Open pgAdmin and right-click ServersRegisterServer
  2. In the General tab, give it a name (e.g. your project name)
  3. In the Connection tab, fill in:
    • Host: your Host from the Connection page
    • Port: 6432
    • Maintenance database: your Database name
    • Username: your User
    • Password: your Password (check "Save password")
  4. Click Save

DBeaver

  1. Click New Database Connection (or Ctrl+Shift+N)
  2. Select PostgreSQL and click Next
  3. Fill in:
    • Host: your Host
    • Port: 6432
    • Database: your Database name
    • Username: your User
    • Password: your Password
  4. Click Test Connection to verify, then Finish

DataGrip / TablePlus

Both tools support pasting a full connection URI. Copy the Pooler Connection URI from the Connection page and paste it into the "URL" or "Import from URL" field.

Terminal (psql)

Copy the connection URI from the dashboard and run:

psql "postgresql://USER:PASSWORD@db.basefyio.com:6432/YOUR_DATABASE"

Replace the URI with the actual Pooler Connection URI from your Connection page.

Prisma, Drizzle, and ORMs

Use the connection strings from the Raw Editor tab on the Connection page. Two environment variables are provided:

  • DATABASE_URL — Connection pooler (for queries at runtime)
  • DIRECT_URL — Direct connection (for migrations and schema pushes)
# .env
DATABASE_URL=postgresql://USER:PASSWORD@db.basefyio.com:6432/YOUR_DATABASE
DIRECT_URL=postgresql://USER:PASSWORD@db.basefyio.com:6432/YOUR_DATABASE

In your Prisma schema:

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
}

Connection Pooling

All external connections go through a connection pooler running in transaction mode. This means:

  • Thousands of client connections are multiplexed onto a smaller set of database connections
  • Each transaction gets a dedicated database connection for its duration
  • Idle connections are returned to the pool automatically

For most use cases (queries, ORMs, GUI tools), the pooler works transparently. If you need session-level features (e.g. SET statements, prepared statements across transactions), use the Direct Connection URI instead.

Password Management

You can reset your database password from the Connection page in the dashboard. Generate a strong password or set your own. After resetting:

  • Update the password in your .env file and any connected tools
  • Active connections using the old password will be disconnected
  • The new password takes effect immediately

Security

  • Never commit database passwords to version control
  • Use .env files (added to .gitignore) for local development
  • Use your hosting platform's secret management for production deployments
  • The connection is encrypted in transit via TLS

For REST API access without a database client, see the API Reference. For SDK integration, see the SDK documentation.