multiple database in a single environment

41 views
Skip to first unread message

Bruno Bonacci

unread,
Mar 18, 2018, 4:55:31 PM3/18/18
to Sophia database
Hi,

In version 2.1 it is possible to create databases after the environment is created as shown in documentation


However in version 2.2 it seems that this is not possible as the same code returns the following error:

  sophia/environment/se_conf.c:894 no databases are defined

how can I create many databases under the same environment in version 2.2?

Additionally is the TTL feature available yet? 


where I can find some information?

thanks
Bruno

Bruno Bonacci

unread,
Mar 18, 2018, 6:34:59 PM3/18/18
to Sophia database

Hi,

I think I found the answer to the first question about the multi databases:

void *env = sp_env();
sp_setstring
(env, "sophia.path", "./storage", 0);
sp_setstring
(env, "db", "test1", 0);
sp_setstring
(env, "db", "test2", 0);
sp_setstring
(env, "db", "test3", 0);
sp_open
(env);


this creates/opens test1, test2, and test3.

What about the TTL?

Bruno
Reply all
Reply to author
Forward
0 new messages