datahike

erre lin 2025-07-24T03:42:31.838409Z

Hello, I’m trying out the Datahike with Postgres. I have read through the doc but can’t seem to figure out what to do when I’m done with the db. The example shows I can delete it. But I don’t want to delete it. I’m wondering is there a way to disconnect from the db? Or I don’t need to? And next time I just use, say, conn created earlier to connect to the db again (assuming db is running all the time)

timo 2025-07-24T08:20:47.226749Z

Hi @errelinaaron and glad you are using Datahike. I am assuming you are using replikativ/datahike-jdbc for working with PostgreSQL. You don't need to use the release -fn for PostgreSQL so there is no need to disconnect from postgresql. You should obviously not delete-database if you want to keep your data. You just reuse your conn or you run connect again to reconnect to your database.

erre lin 2025-07-24T15:54:28.160459Z

Ah thank you timo for the reply. Got a busy day and I’ll try out tmrw. One more question: I’m currently working with a big map with nested values. I have yet to figure out how to write a schema so I’ll probably use :read in cfg. But if I can store this complex data into db, is there a way I can check the schema? (I assume some magic stuff there, that the schema will be created automatically according to my data 🙈).

timo 2025-07-24T19:51:51.048059Z

if you want to do it correctly you should store each value distinctly, that's how datahike and datomic work. you should be able afaik to store structured data in datahike as well but you won't be able to make proper queries afaik

erre lin 2025-07-25T02:27:05.347499Z

I agree with you on that because I came across an online tutorial on Datomic yesterday and it demonstrates the points you’ve suggested. I think I need to figure out the schema for my data anyway. Thank you 🙏