Two questions come up in almost every company that runs SQL. Who can actually read this data? And will this query give the same answer somewhere else? Both usually get answered late, and by hand.
BareSQL is one small free program with two tools for them. BareSQL Audit lists every column each PostgreSQL login can read, the exact route that grants it, and which columns hold personal data. BareSQL Portable finds SQL that fails or returns a different answer on SQLite, PostgreSQL, MySQL and MariaDB, and suggests what to write instead.
The Pitch in Four Numbers
- 2.6 seconds to audit 1,000 tables and 50 logins, sampling values, on 2 CPUs.
- 69 SQL differences checked, each one run on all four engines.
- 1,804 answers recorded from the real SQLite, PostgreSQL, MySQL and MariaDB engines.
- 13 database server versions every change is tested on, PostgreSQL 13 to 18 among them.
BareSQL Audit
Working out who can read a sensitive column in PostgreSQL usually means hours in the catalog tables. Roles, inheritance, views, functions that run with their owner’s rights and row security all change the answer. The question keeps coming back: before every audit, and every time a new login appears, whether it’s for a contractor or an AI agent.
Audit answers it for every login at once. For each one it lists the columns it can read and the route that gets it there: a grant, a role membership, a view running with the owner’s rights, a default privilege. It marks personal data, and it saves results so the next audit can be compared with this one. Version 0.3.0 reads every database on a server in one run, since PostgreSQL roles belong to the whole server while tables belong to one database, and it reports what row security lets through.
The sample report, on a small shop database, finds two high and four medium findings, seven logins reading personal data and ten columns holding it. The headline finding is a newsletter table every role can read.
BareSQL Portable
Teams that test on SQLite and run PostgreSQL in production, or move from MySQL to PostgreSQL, find out late that the same query gives different answers. Seven divided by two is 3 on one engine and 3.5000 on another. NULLs sort to different ends. The project’s own posts are full of these: AVG returns four decimal places on MySQL and sixteen digits on PostgreSQL. COUNT with FILTER works on PostgreSQL and SQLite and fails on MySQL and MariaDB. GROUP BY counts Berlin and berlin as one city on MySQL and two on PostgreSQL. Column names like rank and key are reserved words on some engines.
Portable flags SQL like that before it ships. Its compare command runs a script on the real engines and reports every answer that differs. Every answer it quotes was recorded on all four engines, and the recordings live in the code repository. Version 0.2 added warnings for schema changes and reserved words that break on other engines.
How It’s Built
BareSQL is one file, written in Go with only the standard library. It installs nothing in your database and connects only to the databases you name. The compare feature calls the sqlite3 program, which macOS includes and Linux and Windows users install from the usual package sources.
Tests run on every change on Linux, macOS and Windows, against PostgreSQL 13 to 18, three MySQL versions and four MariaDB versions. Audit output is checked line by line against databases with planted leaks and near misses. An independent review covered both tools before the first release, and its findings were fixed or listed as known gaps in the README.
Who It’s For
- Teams facing a security audit or a privacy review who need to show who can read personal data.
- Anyone adding logins for contractors or AI agents who wants to know what that login can really see.
- Developers who test on SQLite and ship on PostgreSQL, or the other way round.
- Teams migrating between MySQL, MariaDB and PostgreSQL who want the differences up front.
Limits
Audit works only with PostgreSQL. Portable covers the four engines and the versions it’s tested on. It finds where SQL fails or differs. It doesn’t rewrite your queries for you, and it isn’t a general admin suite.
The Four-Question Screening
Every project featured here gets the same four questions, the way you’d screen a startup idea.
1. Where is the money in it?
Both tools are free under Apache 2.0, and there’s no paid tier yet. The money sits in compliance. Companies preparing for a SOC 2 audit, a GDPR review or a customer’s security questionnaire pay to prove who can read personal data, and they pay again every quarter. A paid version could keep audits on a schedule, track changes over time, produce reports an auditor accepts, and cover more databases than PostgreSQL. Migration projects are a second buyer: a portability check sold per migration, or bundled with consulting.
2. What real problem does it solve?
Two problems that cost real money when they’re found late. Access to sensitive columns piles up quietly through roles and views until nobody can say who sees what. And SQL that looks portable returns different numbers on a different engine, which turns into a wrong report or a failed migration in production.
3. The technology in plain words
Audit is like a building inspector who walks every corridor and writes down which keys open which rooms, including the side doors nobody remembers adding. Portable is like a proofreader for a book that will be printed by four different printers, each of which reads a few words differently. It runs the text through all four and marks every line that comes out different.
4. Moat and differentiation
Database security vendors sell big platforms, and migration tools sell conversions. BareSQL is small, local and specific: one file, nothing installed in the database, and answers backed by recordings from the real engines. That’s what earns trust with a database team. The moat that can grow is the library of recorded differences and the audit’s depth on PostgreSQL’s harder corners, the views, functions and row security, which take a long time to get right.
Why It Matters
More logins are touching production data than ever, and some of them now belong to AI agents. A fast, local answer to “who can read this column” is becoming routine hygiene. And as teams mix SQLite, PostgreSQL and MySQL across their stack, knowing where SQL quietly changes meaning saves a lot of bad surprises.
Follow the Project
Start with the quick start, look at the sample reports, read about Audit and Portable, or get the code from the BareSQL repository on GitHub. BareSQL is listed with the other open-source projects on SoftDevStudio.com, and more featured projects are in the Projects section.