# Assertz in SWISH

**URL:** <https://swi-prolog.discourse.group/t/assertz-in-swish/4542>\
**Category:** Predicate\
**Created:** [October 11, 2021, 3:06am UTC](https://swi-prolog.discourse.group/t/assertz-in-swish/4542 "2021-10-11T03:06:20Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [October 13, 2021, 10:43am UTC](https://swi-prolog.discourse.group/t/assertz-in-swish/4542/18 "2021-10-13T10:43:04Z")

</div>

> [@Boris](#):
>
> (SWI-)Prolog is not a replacement for a relational database without a lot of additional effort

I don’t see it that way. When I think of a relational database I also think of it bringing along SQL because that is how many people are introduced to relational databases and access the data in them.

If one removes the SQL baggage and replaces that with Prolog queries life is better. As you know I am a fan of [library(persistency)](https://www.swi-prolog.org/pldoc/man?section=persistency) and [data normalization](https://en.wikipedia.org/wiki/Database_normalization) and while I do know SQL, given the choice I would much rather use Prolog. Also when I use Prolog with normalized data like an SQL database I don’t pull the data from an SQL database but use library(persistency) instead. While I have not tried moving the persisted data into an SQL database, from my experience with using [Prolog with ODBC](https://swi-prolog.discourse.group/t/swi-prolog-connecting-to-postgresql-via-odbc/2404) it does not seem like a road block or even a lot of additional effort.

One point of note with library(persistency) that seems like a pit fall until you are aware of it is that Prolog terms like [blobs](https://swi-prolog.discourse.group/t/blob-types/4364) don’t persist until they are converted to atoms.

* * *

**EDIT**

For the sake of completeness: [Introductory Prolog tutorial for SQL programmers on Swish](https://swi-prolog.discourse.group/t/ive-put-an-introductory-prolog-tut-for-sql-programmers-on-swish/3636)

Note: I don’t do Prolog queries exactly the same as in the tutorial (think refactoring) but many of the underlying concepts from [Finding all Solutions to a Goal](https://www.swi-prolog.org/pldoc/man?section=allsolutions) are essential.

---

_[View the full topic](https://swi-prolog.discourse.group/t/assertz-in-swish/4542)._
