# Support for PostgreSQL or MariaDB as a backend for the Grype database

**URL:** <https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616>\
**Category:** Grype\
**Created:** [April 20, 2026, 2:01pm UTC](https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616 "2026-04-20T14:01:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzofrnt](https://yyz2.discourse-cdn.com/free1/user_avatar/anchorecommunity.discourse.group/enzofrnt/32/288_2.png) [@enzofrnt](https://anchorecommunity.discourse.group/u/enzofrnt)\
**Post date:** [April 20, 2026, 2:01pm UTC](https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616/1 "2026-04-20T14:01:06Z")

</div>

Hello,

First of all, thank you for the work you are doing around open-source tools for vulnerability and SBOM management.

The Grype database you use is very powerful, but its usage is currently limited to a SQLite database. Do you think it would be possible for the database to be inserted into, or even directly created in, a database such as PostgreSQL or MariaDB?

This would be really interesting to simplify interactions with the database in certain contexts.

What do you think?

---

<div class="post-metadata">

**Author:** ![kzantow](https://yyz2.discourse-cdn.com/free1/user_avatar/anchorecommunity.discourse.group/kzantow/32/17_2.png) [@kzantow](https://anchorecommunity.discourse.group/u/kzantow)\
**Post date:** [April 23, 2026, 2:56pm UTC](https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616/2 "2026-04-23T14:56:41Z")

</div>

As far as I know that is not currently possible, since Grype [directly](https://github.com/anchore/grype/blob/89819276e8ebf63b4f607ca3a1b0faa3fc75f28d/grype/db/v6/db.go#L143) [uses SQLite](https://github.com/anchore/grype/blob/89819276e8ebf63b4f607ca3a1b0faa3fc75f28d/grype/db/internal/gormadapter/open.go#L129) in some places. However, Grype uses [GORM](https://gorm.io/) and uses queries that are fairly standard, so most of the database interaction should work with other databases.

I’m curious what difficulty you have with SQLite? If it’s just a matter of querying, you could probably import the whole thing into another RDBMS.

---

<div class="post-metadata">

**Author:** ![enzofrnt](https://yyz2.discourse-cdn.com/free1/user_avatar/anchorecommunity.discourse.group/enzofrnt/32/288_2.png) [@enzofrnt](https://anchorecommunity.discourse.group/u/enzofrnt)\
**Post date:** [April 29, 2026, 9:05am UTC](https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616/3 "2026-04-29T09:05:12Z")

</div>

Importing the whole thing is a possibility, but probably not as clean as a direct import into the database with direct updates. The difficulty is that I would like to create direct relationships between elements in my database and elements in the Grype database, and having two SQLite databases, or one SQLite and another type, doesn’t seem like the best idea for maintainability.

---

<div class="post-metadata">

**Author:** ![kzantow](https://yyz2.discourse-cdn.com/free1/user_avatar/anchorecommunity.discourse.group/kzantow/32/17_2.png) [@kzantow](https://anchorecommunity.discourse.group/u/kzantow)\
**Post date:** [May 1, 2026, 5:21pm UTC](https://anchorecommunity.discourse.group/t/support-for-postgresql-or-mariadb-as-a-backend-for-the-grype-database/616/4 "2026-05-01T17:21:13Z")

</div>

Sorry I don’t have any ideal solutions for what you’re trying to do. One of the distinct problems is that every Grype db has different IDs for what would otherwise be identical rows. It’s possible you could use [foreign data wrappers](https://wiki.postgresql.org/wiki/Foreign_data_wrappers) but because of the row ID changing between builds, this would not help a lot. I think your best bet might be to come up with some sort of ETL procedure that gives you the data you’re most interested in.
