datalevin

simongray 2025-01-24T12:30:42.729749Z

Is it possible to search for a phrase using full-text search? I noticed that searching for "red fox" in the example essentially gives you results for both "red" and "fox" but not for "red fox" specifically.

Huahai 2025-04-20T17:24:27.640129Z

Phrase search can now be done with expended search expressions

Huahai 2025-01-24T15:31:27.309939Z

If you turn on :index-position? , the search engine does proximity search by default. So "red fox" close together will come up ahead than if they appear individually. Extended search functionallity including full-blown phrase search and boolean operators, etc. are on the roadmap.

🙏 1
simongray 2025-01-24T16:37:43.044879Z

Thanks!

2025-01-24T14:51:46.739909Z

What strategies do you use when testing datalevin? With datomic I can use the in memory db just as a value, so from that perspective testing is fairly easy. Are there any specific strategies to consider when testing with datalevin?

Huahai 2025-01-24T15:35:10.312189Z

The same test strategy as if you are using sqlite. Creating a temporary DB and read/write on it for one test. Create another for another test. That's how Datalevin tests run internally. It's cheap to create many DL dbs.

👍 1
☝️ 1
ThomasFuston 2025-01-24T16:58:30.898209Z

Hello everyone, i just learned about datalog and Datelevin wanted to give it a try, while i am able to understand the queries, thx to the help fo some resources online and was able to make a very simple todo app work,, i struggle to understand how i would build a db schema for a bigger project i am kinda lost thinking to much in sql terms maybe - Are there resources on that which could help? I wasn't able to find them my self so far

Huahai 2025-01-24T17:10:58.350049Z

The same Entity Relation (ER) modeling approach for your SQL DB applies in Datalog.

Huahai 2025-01-24T17:13:25.320519Z

There's really no difference. If anything, one can argue that Datalog embodies the relational ideals more deeply.

Huahai 2025-01-24T17:15:33.147389Z

What are your struggling with?

ThomasFuston 2025-01-24T17:20:06.000369Z

So for simple Example: In Lets say in SQL i have a simple "Articles" "categories" example: Table Articles: id, title content, author Table Categories: id, name Table ArticlesInCategories: id_article, id_category would i do the exact same in Datalevin/Datalog?

Huahai 2025-01-24T17:20:54.004799Z

Why not?

Huahai 2025-01-24T17:21:13.811479Z

In fact, you don't need the ID

Huahai 2025-01-24T17:21:41.741669Z

ID is automatic in Datalevin, you only needs the domain attribute

Huahai 2025-01-24T17:22:25.258949Z

the general strategy is the following:

Huahai 2025-01-24T17:22:53.219569Z

table -> attribute namespace

Huahai 2025-01-24T17:23:05.208309Z

column -> attribute

Huahai 2025-01-24T17:23:22.775219Z

foreign key column -> ref

Huahai 2025-01-24T17:23:47.803409Z

so your schema above is translated into this:

Huahai 2025-01-24T17:25:44.050439Z

{:article/title {...}, :article/content {...}, :article/author {could be a ref}, :article/category {a ref}, :category/name {...}}

Huahai 2025-01-24T17:28:01.090319Z

that's it

ThomasFuston 2025-01-24T17:29:29.852459Z

Hmm, ok, mb i thougth... well i dont know what i thought, so basically not much if at all changes in the schema

ThomasFuston 2025-01-24T17:30:04.026109Z

ok, thank you for the clarification

Huahai 2025-01-24T17:31:21.719469Z

As you can see, Datalog schema is actually simpler, isn't it? You don't need to manually set up ID, which is an implementation details, not part of the domain.

👍 2
Huahai 2025-01-24T17:32:09.126039Z

What they call "incidental complexity".