Database integrations (PostgreSQL, MySQL, MongoDB)

Connect your own PostgreSQL, MySQL, or MongoDB database and sync bank data straight into a table or collection.

8 min read

On this page

BankSync can write your synced bank data directly into a database you own. Add a connection once, point a feed at a table (or collection), and every sync lands rows where your apps and dashboards already read from.

A database feed, from connection test to upsert write mode.

Before you start

You need: (1) a BankSync workspace with at least one connected bank, and (2) a reachable database with a user that can write to it. If you haven't connected a bank yet, start with Connecting your bank, then come back here.

Supported databases#

BankSync connects to three database engines today:

PostgreSQL

Syncs to a Postgres table. Also works with Postgres-compatible services (Supabase, Neon, Timescale, CockroachDB).

MySQL

Syncs to a MySQL table. Also works with MySQL-compatible services (MariaDB, Aurora MySQL, PlanetScale).

MongoDB

Syncs to a MongoDB collection. Works with self-hosted MongoDB and Atlas.

For Postgres the two container tiers are called Schema and Table. For MySQL they are Database and Table. For MongoDB they are Database and Collection.

Step 1: Add the database connection#

Add a connection

  1. Open Add Connection

    From your BankSync workspace, go to the Integrations tab and click "Add Connection".

  2. Choose your engine

    In the Add Connection dialog, the database engines appear under the "Databases" group. Search for "Postgres", "MySQL", or "Mongo" if you don't see it, then click the one you want.

  3. Enter your connection details

    Fill in the connection fields (see the field list below). You can also click "Paste a connection string instead" to auto-fill the form from a URL like postgresql://user:password@host:5432/database.

  4. Set the SSL mode

    Pick an SSL mode. The default is require, which encrypts the connection. Use verify-full to also authenticate the server's certificate (see the SSL modes section below).

  5. Test the connection

    Click "Test connection". A "Connection successful" message confirms BankSync can reach and authenticate against your database.

  6. Save it

    Click "Connect". The connection is saved and appears as a card on your Integrations tab, ready to pick in a feed's Destination tab.

The Connect PostgreSQL database connection form, filled in: a Display name, Host db.acme.internal, Port 5432, Database analytics, User banksync_writer, a masked Password, Schema public, SSL mode set to require, an empty CA certificate field, a Paste a connection string instead link, and Test connection and Connect buttons.
The database connect form filled in for a PostgreSQL connection.

Use a least-privilege user

The connect form recommends a least-privilege database user: INSERT (to write rows), plus CREATE if you want BankSync to create the table for you. There is no need to grant broad admin rights.

Connection fields by engine#

Required fields are marked with an asterisk in the form. Give the connection an optional Display name so it is easy to recognise later.

PostgreSQL#

FieldRequiredDefaultNotes
HostYesDatabase hostname or IP
PortYes5432
DatabaseYes
UserYes
PasswordYes
SchemaNopublic
SSL modeYesrequiredisable, require, or verify-full
CA certificate (PEM)NoOnly with verify-full when the server uses a private or self-signed CA

MySQL#

FieldRequiredDefaultNotes
HostYes
PortYes3306
DatabaseYes
UserYes
PasswordYes
SSL modeYesrequiredisable, require, or verify-full
CA certificate (PEM)No

MongoDB#

FieldRequiredDefaultNotes
HostYes
PortYes27017
DatabaseYes
UserNoA Password is required once a User is set
PasswordConditionalRequired when a User is provided
Auth databaseNoadmin
SSL modeYesdisable, require, or verify-full
CA certificate (PEM)No

SSL modes explained#

All three engines offer the same three SSL modes. Pick the strictest one your server supports:

SSL modeWhat it doesWhen to use it
disableNo encryption.Only for databases that do not accept TLS at all, ideally on a private network.
requireEncrypts the connection but does not verify the server's identity.The sensible default for most managed databases.
verify-fullEncrypts and authenticates the server's certificate (hostname and chain).When you need to be sure you are talking to your server. If it uses a private or self-signed CA, paste that CA into the "CA certificate (PEM)" field.

Network security: allowlist BankSync's IP#

If your database has a public endpoint, you can lock its firewall down so it only accepts connections from BankSync. BankSync always connects to your database from a small, fixed set of IP addresses, so you allowlist them once and leave them in place.

Allowlist these IP addresses

BankSync connects to your database from these fixed IPs. Add them to your database firewall so it accepts BankSync and nothing else.

Where to add the allowlist rule

Add the IP(s) above as an inbound/allow rule on whatever controls access to your database. The exact place depends on your host (see the table below). Pair this with an SSL mode of require or verify-full so the connection is both restricted by IP and encrypted. Allowlisting is optional — BankSync works without it — but it is the recommended way to minimise your database's exposure.
Where your database is hostedWhere to add BankSync's IP
SupabaseProject Settings → Database → Network Restrictions → add each IP as an allowed address (e.g. 203.0.113.10/32).
Amazon RDS / AuroraThe database's VPC security group → add an inbound rule for the database port from each IP (/32).
Google Cloud SQLConnections → Networking → Authorized networks → add each IP (/32).
Azure DatabaseNetworking → Firewall rules → add a rule for each IP.
NeonProject → Settings → IP Allow → add each IP.
MongoDB AtlasNetwork Access → IP Access List → add each IP.
Self-hostedYour host firewall (e.g. ufw, security group, or pg_hba.conf plus the OS firewall) → allow the database port from each IP.

Step 2: Point a feed at a table or collection#

A connection on its own does not move data. To start syncing, attach it to a feed.

Pick the database in a feed

  1. Create or open a feed

    Follow Creating your first feed to pick the accounts and data type you want to sync, then open the feed's Destination tab.

  2. Choose the database in the Destination tab

    In the feed's Destination tab, select your database connection card.

  3. Pick the target container

    Use the two-level picker to choose where rows land. For Postgres pick a Schema then a Table; for MySQL a Database then a Table; for MongoDB a Database then a Collection. Type in the search box to filter.

  4. Or let BankSync create the table

    If you don't already have a target, use the "Set this up for me" panel. BankSync can create a new table (or collection) for the feed's data type and map every column automatically in one click.

Choose how rows are written: Append vs Upsert

Open the feed's Mapping tab and switch to "Advanced". The question "How should we write rows?" lets database feeds pick Append or Upsert. Append inserts a new row each sync (simple, but re-syncs can create duplicates). Upsert matches rows on the key column(s) you choose under "Match rows on" and updates them in place, so re-syncing never duplicates. Upsert needs at least one key column, and a unique index on those columns is strongly recommended; when BankSync creates the table for you ("Set this up for me"), it creates that unique index too.

Confirm it worked#

You're set up correctly when all of the following are true:

  • The connect form showed "Connection successful" before you saved, and the connection appears as a card on your Integrations tab.
  • In the feed's Destination tab, the picker shows your chosen Schema/Database and Table/Collection filled in (not empty).
  • After the feed runs a sync, the rows appear in your database. Query the target table or collection directly to verify, for example a row count or the most recent rows.

Connection health states#

Database connections do not use OAuth tokens, so they never "expire" on a timer, but they can break when something changes on your side. BankSync reports one of four health states on the connection:

StateWhat it meansTypical fix
okBankSync can reach and authenticate against the database.Nothing to do.
auth_failedThe server rejected the credentials.The password was rotated or the user was dropped; open the connection, click "Edit connection", update the credentials, and re-run "Test connection".
unreachableBankSync cannot reach the host at all.The host or port changed, the instance is down, or a firewall / security group now blocks the connection. If you allowlist by IP, confirm BankSync's egress IPs (see "Network security: allowlist BankSync's IP" above) are still allowed.
tls_errorThe TLS handshake failed.A certificate was renewed or replaced; re-check the SSL mode, and with verify-full update the CA certificate (PEM).

Troubleshooting#

If the connection test fails

Connectivity: "Connection successful" never appears or you see an unreachable error. Make sure the database has a reachable endpoint and that any firewall or security group allows the connection. The connect form notes you must make sure your database accepts connections from BankSync. SSL errors: if the server uses a private or self-signed certificate, switch SSL mode to verify-full and paste the server's CA certificate into the CA certificate (PEM) field. If you only need encryption and not server verification, require is enough. Authentication: double-check the User and Password, and for MongoDB confirm the Auth database (defaults to admin) is correct for that user. Empty table list: if the picker shows no schemas/databases, the connected user may lack permission to list them, or the host is unreachable.

Next steps#

Now that your database is connected, finish wiring up the feed and choose your write mode.

Create your first feed

Use this page with your AI assistant

Every BankSync doc is available as plain Markdown for agents and LLMs.